go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers-sdk/v1/upstream/upstream.proto (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  syntax = "proto3";
     5  
     6  package mondoo.cnquery.upstream.v1;
     7  option go_package = "go.mondoo.com/cnquery/providers-sdk/v1/upstream";
     8  
     9  message UpstreamConfig {
    10    string asset_mrn = 1;
    11    string space_mrn = 2;
    12    string api_endpoint = 3;
    13    bool incognito = 4;
    14    ServiceAccountCredentials creds = 5;
    15  }
    16  
    17  message ServiceAccountCredentials {
    18    string mrn = 1;
    19    string parent_mrn = 2;
    20    string private_key = 3;
    21    string certificate = 4;
    22    string api_endpoint = 5;
    23  }
    24  
    25  service AgentManager {
    26    // RegisterAgent registers a new managed agent
    27    rpc RegisterAgent(AgentRegistrationRequest) returns (AgentRegistrationConfirmation);
    28    // UnRegister removes the managed agent from management
    29    rpc UnRegisterAgent(Mrn) returns (Confirmation);
    30  
    31    // Service Account Credential Test Endpoint
    32    rpc PingPong(Ping) returns (Pong);
    33  }
    34  
    35  message Ping {}
    36  message Pong {}
    37  
    38  message AgentRegistrationRequest {
    39    string token = 1;
    40    string name = 2;
    41    AgentInfo agent_info = 3;
    42  }
    43  
    44  message AgentInfo {
    45    string mrn = 1;
    46    string version = 2;
    47    string build = 3;
    48    string platform_name = 4;
    49    string platform_release = 5;
    50    string platform_arch = 6;
    51    string platform_ip = 7;
    52    string platform_hostname = 8;
    53    map<string, string> labels = 18;
    54    string platform_id = 20;
    55  }
    56  
    57  message AgentRegistrationConfirmation {
    58    string agent_mrn = 1;
    59    ServiceAccountCredentials credential = 2;
    60  }
    61  
    62  message Mrn { string mrn = 1; }
    63  
    64  message Confirmation { string mrn = 1; }
    65  
    66  service SecureTokenService {
    67    rpc ExchangeSSH (ExchangeSSHKeyRequest) returns (ExchangeSSHKeyResponse) {}
    68  }
    69  
    70  message ExchangeSSHKeyRequest {
    71    Claims claims = 1;
    72    repeated SshSignature signatures = 2;
    73  }
    74  
    75  message ExchangeSSHKeyResponse {
    76    string mrn = 1;
    77    string parent_mrn = 2;
    78    string private_key = 3;
    79    string certificate = 4;
    80    string api_endpoint = 5;
    81  }
    82  
    83  // Claims follow https://datatracker.ietf.org/doc/html/rfc8693#section-2.1
    84  message Claims {
    85    string subject = 1;
    86    // NumericDate as defined in RFC 7519, which uses RFC 3339
    87    string exp = 2;
    88    // NumericDate as defined in RFC 7519, which uses RFC 3339
    89    string iat = 3;
    90    string resource = 4;
    91  }
    92  
    93  message SshSignature {
    94    string alg = 1;
    95    string kid = 2;
    96    string sig = 3;
    97  }