audit_log.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Copyright 2016 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.audit;
  16. import "google/api/annotations.proto";
  17. import "google/protobuf/any.proto";
  18. import "google/protobuf/struct.proto";
  19. import "google/rpc/status.proto";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "AuditLogProto";
  22. option java_package = "com.google.cloud.audit";
  23. // Common audit log format for Google Cloud Platform API operations.
  24. message AuditLog {
  25. // The name of the API service performing the operation. For example,
  26. // `"datastore.googleapis.com"`.
  27. string service_name = 7;
  28. // The name of the service method or operation.
  29. // For API calls, this should be the name of the API method.
  30. // For example,
  31. //
  32. // "google.datastore.v1.Datastore.RunQuery"
  33. // "google.logging.v1.LoggingService.DeleteLog"
  34. string method_name = 8;
  35. // The resource or collection that is the target of the operation.
  36. // The name is a scheme-less URI, not including the API service name.
  37. // For example:
  38. //
  39. // "shelves/SHELF_ID/books"
  40. // "shelves/SHELF_ID/books/BOOK_ID"
  41. string resource_name = 11;
  42. // The number of items returned from a List or Query API method,
  43. // if applicable.
  44. int64 num_response_items = 12;
  45. // The status of the overall operation.
  46. google.rpc.Status status = 2;
  47. // Authentication information.
  48. AuthenticationInfo authentication_info = 3;
  49. // Authorization information. If there are multiple
  50. // resources or permissions involved, then there is
  51. // one AuthorizationInfo element for each {resource, permission} tuple.
  52. repeated AuthorizationInfo authorization_info = 9;
  53. // Metadata about the operation.
  54. RequestMetadata request_metadata = 4;
  55. // The operation request. This may not include all request parameters,
  56. // such as those that are too large, privacy-sensitive, or duplicated
  57. // elsewhere in the log record.
  58. // It should never include user-generated data, such as file contents.
  59. // When the JSON object represented here has a proto equivalent, the proto
  60. // name will be indicated in the `@type` property.
  61. google.protobuf.Struct request = 16;
  62. // The operation response. This may not include all response elements,
  63. // such as those that are too large, privacy-sensitive, or duplicated
  64. // elsewhere in the log record.
  65. // It should never include user-generated data, such as file contents.
  66. // When the JSON object represented here has a proto equivalent, the proto
  67. // name will be indicated in the `@type` property.
  68. google.protobuf.Struct response = 17;
  69. // Other service-specific data about the request, response, and other
  70. // activities.
  71. google.protobuf.Any service_data = 15;
  72. }
  73. // Authentication information for the operation.
  74. message AuthenticationInfo {
  75. // The email address of the authenticated user making the request.
  76. string principal_email = 1;
  77. }
  78. // Authorization information for the operation.
  79. message AuthorizationInfo {
  80. // The resource being accessed, as a REST-style string. For example:
  81. //
  82. // bigquery.googlapis.com/projects/PROJECTID/datasets/DATASETID
  83. string resource = 1;
  84. // The required IAM permission.
  85. string permission = 2;
  86. // Whether or not authorization for `resource` and `permission`
  87. // was granted.
  88. bool granted = 3;
  89. }
  90. // Metadata about the request.
  91. message RequestMetadata {
  92. // The IP address of the caller.
  93. string caller_ip = 1;
  94. // The user agent of the caller.
  95. // This information is not authenticated and should be treated accordingly.
  96. // For example:
  97. //
  98. // + `google-api-python-client/1.4.0`:
  99. // The request was made by the Google API client for Python.
  100. // + `Cloud SDK Command Line Tool apitools-client/1.0 gcloud/0.9.62`:
  101. // The request was made by the Google Cloud SDK CLI (gcloud).
  102. // + `AppEngine-Google; (+http://code.google.com/appengine; appid: s~my-project`:
  103. // The request was made from the `my-project` App Engine app.
  104. string caller_supplied_user_agent = 2;
  105. }