github.com/cloudwan/edgelq-sdk@v1.15.4/audit/proto/v1/activity_log_custom.proto (about)

     1  syntax = "proto3";
     2  
     3  package ntt.audit.v1;
     4  
     5  import "edgelq-sdk/audit/proto/v1/activity_log.proto";
     6  import "edgelq-sdk/audit/proto/v1/common.proto";
     7  import "edgelq-sdk/common/rpc/status.proto";
     8  
     9  option go_package = "github.com/cloudwan/edgelq-sdk/audit/client/v1/activity_log;activity_log_client";
    10  option java_multiple_files = false;
    11  option java_outer_classname = "ActivityLogCustomProto";
    12  option java_package = "com.ntt.audit.pb.v1";
    13  
    14  // A request message of the [ListActivityLogs](#listactivitylogs-method) method.
    15  //
    16  // It returns activities for specified time range and within specified filter.
    17  // Activity logs are stored only in region which executed them and never
    18  // duplicated. Because of that its important to pay attention to region IDs in a
    19  // request object.
    20  //
    21  // Basic supported filters are:
    22  //
    23  // * --filter 'service.name=[SERVICE_NAME]' (what is happening in this service)
    24  // * --filter 'service.name=[SERVICE_NAME] and method.type=[METHOD_NAME]' (what
    25  // is happening for this API call)
    26  // * --filter 'authentication.principal=[PRINCIPAL_NAME]' (what that person is
    27  // doing)
    28  // * --filter 'request_id=[REQUEST_ID]' (I have request ID, what is actually
    29  // this?)
    30  // * --filter 'service.name=[SERVICE_NAME] and
    31  // resource.name=[FULL_RESOURCE_NAME]' (can I see activities on this resource?)
    32  //
    33  // Its also possible to filter logs by their region of activity, by using field
    34  // service.region_id in a filter field. It's important to note that logs may be
    35  // present in multiple locations, if request was routed somewhere else or split
    36  // and merged across many regions. Those activity logs may have different
    37  // activity log names, but they will share same values in fields request_id
    38  // and request_routing.
    39  //
    40  // Be aware, that server will append scope filter condition (and scope=...) to
    41  // the filter. Scope(s) will be extracted from fields parents in
    42  // ListActivityLogsRequest object. Note you can query for multiple at once,
    43  // both projects and organizations.
    44  //
    45  // For all of the above filters you can replace filter condition compare (=)
    46  // with IN operator. You can therefore query for multiple services, methods or
    47  // users at once. Above filters are also preferred as we have optimization for
    48  // them.
    49  //
    50  // Activity logs can be filtered by custom labels (field labels in
    51  // ActivityLog).  Labels are defined per each API method, so you must specify
    52  // service.name and method.type conditions to be able to query by labels.
    53  //
    54  // For example, suppose you have a CreateVM method, which creates resource
    55  // "VM".  Suppose there is a field "group" within resource body, which is
    56  // reference to other resource.  If you want to make a query like "who was
    57  // creating VMs for that group", then you need to create label "group" inside
    58  // resource body.  Then you will be able to make a query with following
    59  // filter condition:
    60  //
    61  // ```
    62  // --filter 'service.name="vms.domain.com" and \
    63  //           method.type=CreateVM and \
    64  //           labels.group=mySpecialVMGroup'
    65  // ```
    66  //
    67  // Be aware, that Create/Update requests, which have resource object in their
    68  // own bodies, will automatically inherit resource labels. So, basically you
    69  // need to define "group" label in resource spec, not inside request. This is
    70  // useful, as both Create/Update methods will have this label. This also allows
    71  // code-gen to continue maintaining *derived.proto files.
    72  //
    73  // Examples of usage (with cuttle - we are interested only in one region and
    74  // scope):
    75  //
    76  // * Checks connections to all devices within ssh-demo project starting
    77  //   from 8th of September 12 UTC time
    78  //
    79  //   ```bash
    80  //   cuttle audit query activity-log --parents 'projects/ssh-demo' \
    81  //     --filter 'service.name="devices.edgelq.com" and \
    82  //               method.type="ConnectToDevice" and \
    83  //               service.regionId="us-west"' \
    84  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
    85  //     -o json
    86  //   ```
    87  //
    88  // * Checks connections to device demo-device within ssh-demo project
    89  //   starting from 8th of September 12 UTC time
    90  //
    91  //   ```bash
    92  //   cuttle audit query activity-log --parents 'projects/ssh-demo' \
    93  //     --filter 'service.name="devices.edgelq.com" and \
    94  //               method.type="ConnectToDevice" and \
    95  //               service.regionId="us-west" and \
    96  //               resource.name="projects/ssh-demo/devices/demo-device"' \
    97  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
    98  //     -o json
    99  //   ```
   100  //
   101  // * Checks what is happening within whole iam service for project demo
   102  //   starting from 8th of September 12 UTC time
   103  //
   104  //   ```bash
   105  //   cuttle audit query activity-log --parents 'projects/demo' \
   106  //     --filter 'service.name="iam.edgelq.com"' \
   107  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
   108  //     -o json
   109  //   ```
   110  //
   111  // * Checks activities within one hour for whole iam service for selected
   112  // methods
   113  //
   114  //   ```bash
   115  //   cuttle audit query activity-log --parents 'projects/demo' \
   116  //     --filter 'service.name="iam.edgelq.com" and \
   117  //               method.type IN ["CreateRoleBinding", "UpdateRoleBinding", \
   118  //               "DeleteRoleBinding"] and \
   119  //               service.regionId="us-west"' \
   120  //     --interval '{"startTime":"2020-09-08T12:00:00Z",
   121  //                  "endTime":"2020-09-08T13:00:00Z"}' \
   122  //     -o json
   123  //   ```
   124  //
   125  // * Checks modification of RoleBinding
   126  //
   127  //   ```bash
   128  //   cuttle audit query activity-log --parents 'projects/demo' \
   129  //     --filter 'service.name="iam.edgelq.com" and \
   130  //               method.type="UpdateRoleBinding" and \
   131  //               labels.resource_name="projects/x/roleBindings/myRB"' \
   132  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
   133  //     -o json
   134  //   ```
   135  //
   136  // * Checks what was happening with some device
   137  //
   138  //   ```bash
   139  //   cuttle audit query activity-log --parents 'projects/demo' \
   140  //     --filter 'service.name="devices.edgelq.com" and \
   141  //               resource.name="projects/x/devices/myDevice" and \
   142  //               service.regionId="us-west"' \
   143  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
   144  //     -o json
   145  //   ```
   146  //
   147  // * Checks activities made by specific user (we need their email)
   148  //
   149  //   ```bash
   150  //   cuttle audit query activity-log --parents 'projects/demo' \
   151  //     --filter 'authentication.principal="user:we.know.who@domain.com" and \
   152  //               service.regionId="us-west"' \
   153  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
   154  //     -o json
   155  //   ```
   156  //
   157  // * Checks activities made by specific service account (we need it's email)
   158  //
   159  //   ```bash
   160  //   cuttle audit query activity-log --parents 'projects/demo' \
   161  //     --filter 'authentication.principal="serviceAccount:sa@domain.com" and \
   162  //               service.regionId="us-west"' \
   163  //     --interval '{"startTime":"2020-09-08T12:00:00Z"}' \
   164  //     -o json
   165  //   ```
   166  message ListActivityLogsRequest {
   167    // Parent references of ntt.audit.v1.ActivityLog - provides list of all
   168    // scopes we want to query about
   169    repeated string parents = 1;
   170  
   171    // A audit filter that specifies which activity logs should be returned
   172    string filter = 2;
   173  
   174    // The time interval for which results should be returned. Only logs
   175    // that contain data points in the specified interval are included
   176    // in the response.
   177    TimeInterval interval = 4;
   178  
   179    // Cap on a number of activity logs to be included in a response.
   180    // Number of logs in an actual response can be higher, since logs are
   181    // read in bulk with second precision - exceed logs above the limit will share
   182    // same timestamp as the logs below the limit.
   183    //
   184    // Results will be adjusted to the "end time" taken from interval field
   185    // (adjusted also by page_token if provided).
   186    int32 page_size = 5;
   187  
   188    // Token which identifies next page with further results. Token should be
   189    // taken from
   190    // [ListActivityLogsResponse.next_page_token][ntt.audit.v1.ListActivityLogsResponse.next_page_token].
   191    string page_token = 6;
   192  
   193    reserved 3;
   194  }
   195  
   196  // A response message of the [ListActivityLogs](#listactivitylogs-method)
   197  // method.
   198  message ListActivityLogsResponse {
   199    // One or more activity method logs that match the filter included in the
   200    // request. Contains results from all queried regions. Its possible however
   201    // that some logs may be missing, for this see execution_errors.
   202    repeated ActivityLog activity_logs = 1;
   203  
   204    // If there are more results than have been returned, then this field is set
   205    // to a non-empty value. To see the additional results,
   206    // use that value as `pageToken` in the next call to this method.
   207    string next_page_token = 2;
   208  
   209    // Query execution errors that may have caused the response data returned to
   210    // be incomplete. Because logs are stored only locally (for each region), all
   211    // activity log queries are split and merged by a receiving request server
   212    // according to the queried regions. Its possible that some regions will fail
   213    // when request is redirected to them, but others not. For each failed region,
   214    // one execution error will be appended. In each ntt.rpc.Status message,
   215    // fields code and message will contain error obtained from failed regional
   216    // server, while field details will contain always one item and this item will
   217    // be of type ErrorDetails.
   218    repeated ntt.rpc.Status execution_errors = 3;
   219  
   220    // ErrorDetails is used when one of the queried regions fails to produce
   221    // results. It is used in execution_errors field (see subfield
   222    // ntt.rpc.Status.details).
   223    message ErrorDetails {
   224      // region id which failed to give results.
   225      string region_id = 1;
   226    }
   227  }
   228  
   229  // A request message of the [CreateActivityLogs](#createactivitylogs-method)
   230  // method.
   231  message CreateActivityLogsRequest {
   232    // List of activity logs to be added to service. Can be coming from different
   233    // scopes but must be submitted to the same region and service.
   234    repeated ActivityLog activity_logs = 1;
   235  }
   236  
   237  // A response message of the [CreateActivityLogs](#createactivitylogs-method)
   238  // nmethod.
   239  message CreateActivityLogsResponse {
   240    // Activity log names - one name per each activity log, in same order
   241    // as in the request
   242    repeated string log_names = 1;
   243  }