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