accessapproval.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. // Copyright 2020 Google LLC
  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.accessapproval.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/protobuf/empty.proto";
  20. import "google/protobuf/field_mask.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option csharp_namespace = "Google.Cloud.AccessApproval.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/accessapproval/v1;accessapproval";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "AccessApprovalProto";
  26. option java_package = "com.google.cloud.accessapproval.v1";
  27. option php_namespace = "Google\\Cloud\\AccessApproval\\V1";
  28. option ruby_package = "Google::Cloud::AccessApproval::V1";
  29. // This API allows a customer to manage accesses to cloud resources by
  30. // Google personnel. It defines the following resource model:
  31. //
  32. // - The API has a collection of
  33. // [ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
  34. // resources, named `approvalRequests/{approval_request_id}`
  35. // - The API has top-level settings per Project/Folder/Organization, named
  36. // `accessApprovalSettings`
  37. //
  38. // The service also periodically emails a list of recipients, defined at the
  39. // Project/Folder/Organization level in the accessApprovalSettings, when there
  40. // is a pending ApprovalRequest for them to act on. The ApprovalRequests can
  41. // also optionally be published to a Cloud Pub/Sub topic owned by the customer
  42. // (for Beta, the Pub/Sub setup is managed manually).
  43. //
  44. // ApprovalRequests can be approved or dismissed. Google personel can only
  45. // access the indicated resource or resources if the request is approved
  46. // (subject to some exclusions:
  47. // https://cloud.google.com/access-approval/docs/overview#exclusions).
  48. //
  49. // Note: Using Access Approval functionality will mean that Google may not be
  50. // able to meet the SLAs for your chosen products, as any support response times
  51. // may be dramatically increased. As such the SLAs do not apply to any service
  52. // disruption to the extent impacted by Customer's use of Access Approval. Do
  53. // not enable Access Approval for projects where you may require high service
  54. // availability and rapid response by Google Cloud Support.
  55. //
  56. // After a request is approved or dismissed, no further action may be taken on
  57. // it. Requests with the requested_expiration in the past or with no activity
  58. // for 14 days are considered dismissed. When an approval expires, the request
  59. // is considered dismissed.
  60. //
  61. // If a request is not approved or dismissed, we call it pending.
  62. service AccessApproval {
  63. option (google.api.default_host) = "accessapproval.googleapis.com";
  64. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  65. // Lists approval requests associated with a project, folder, or organization.
  66. // Approval requests can be filtered by state (pending, active, dismissed).
  67. // The order is reverse chronological.
  68. rpc ListApprovalRequests(ListApprovalRequestsMessage) returns (ListApprovalRequestsResponse) {
  69. option (google.api.http) = {
  70. get: "/v1/{parent=projects/*}/approvalRequests"
  71. additional_bindings {
  72. get: "/v1/{parent=folders/*}/approvalRequests"
  73. }
  74. additional_bindings {
  75. get: "/v1/{parent=organizations/*}/approvalRequests"
  76. }
  77. };
  78. option (google.api.method_signature) = "parent";
  79. }
  80. // Gets an approval request. Returns NOT_FOUND if the request does not exist.
  81. rpc GetApprovalRequest(GetApprovalRequestMessage) returns (ApprovalRequest) {
  82. option (google.api.http) = {
  83. get: "/v1/{name=projects/*/approvalRequests/*}"
  84. additional_bindings {
  85. get: "/v1/{name=folders/*/approvalRequests/*}"
  86. }
  87. additional_bindings {
  88. get: "/v1/{name=organizations/*/approvalRequests/*}"
  89. }
  90. };
  91. option (google.api.method_signature) = "name";
  92. }
  93. // Approves a request and returns the updated ApprovalRequest.
  94. //
  95. // Returns NOT_FOUND if the request does not exist. Returns
  96. // FAILED_PRECONDITION if the request exists but is not in a pending state.
  97. rpc ApproveApprovalRequest(ApproveApprovalRequestMessage) returns (ApprovalRequest) {
  98. option (google.api.http) = {
  99. post: "/v1/{name=projects/*/approvalRequests/*}:approve"
  100. body: "*"
  101. additional_bindings {
  102. post: "/v1/{name=folders/*/approvalRequests/*}:approve"
  103. body: "*"
  104. }
  105. additional_bindings {
  106. post: "/v1/{name=organizations/*/approvalRequests/*}:approve"
  107. body: "*"
  108. }
  109. };
  110. }
  111. // Dismisses a request. Returns the updated ApprovalRequest.
  112. //
  113. // NOTE: This does not deny access to the resource if another request has been
  114. // made and approved. It is equivalent in effect to ignoring the request
  115. // altogether.
  116. //
  117. // Returns NOT_FOUND if the request does not exist.
  118. //
  119. // Returns FAILED_PRECONDITION if the request exists but is not in a pending
  120. // state.
  121. rpc DismissApprovalRequest(DismissApprovalRequestMessage) returns (ApprovalRequest) {
  122. option (google.api.http) = {
  123. post: "/v1/{name=projects/*/approvalRequests/*}:dismiss"
  124. body: "*"
  125. additional_bindings {
  126. post: "/v1/{name=folders/*/approvalRequests/*}:dismiss"
  127. body: "*"
  128. }
  129. additional_bindings {
  130. post: "/v1/{name=organizations/*/approvalRequests/*}:dismiss"
  131. body: "*"
  132. }
  133. };
  134. }
  135. // Gets the settings associated with a project, folder, or organization.
  136. rpc GetAccessApprovalSettings(GetAccessApprovalSettingsMessage) returns (AccessApprovalSettings) {
  137. option (google.api.http) = {
  138. get: "/v1/{name=projects/*/accessApprovalSettings}"
  139. additional_bindings {
  140. get: "/v1/{name=folders/*/accessApprovalSettings}"
  141. }
  142. additional_bindings {
  143. get: "/v1/{name=organizations/*/accessApprovalSettings}"
  144. }
  145. };
  146. option (google.api.method_signature) = "name";
  147. }
  148. // Updates the settings associated with a project, folder, or organization.
  149. // Settings to update are determined by the value of field_mask.
  150. rpc UpdateAccessApprovalSettings(UpdateAccessApprovalSettingsMessage) returns (AccessApprovalSettings) {
  151. option (google.api.http) = {
  152. patch: "/v1/{settings.name=projects/*/accessApprovalSettings}"
  153. body: "settings"
  154. additional_bindings {
  155. patch: "/v1/{settings.name=folders/*/accessApprovalSettings}"
  156. body: "settings"
  157. }
  158. additional_bindings {
  159. patch: "/v1/{settings.name=organizations/*/accessApprovalSettings}"
  160. body: "settings"
  161. }
  162. };
  163. option (google.api.method_signature) = "settings,update_mask";
  164. }
  165. // Deletes the settings associated with a project, folder, or organization.
  166. // This will have the effect of disabling Access Approval for the project,
  167. // folder, or organization, but only if all ancestors also have Access
  168. // Approval disabled. If Access Approval is enabled at a higher level of the
  169. // hierarchy, then Access Approval will still be enabled at this level as
  170. // the settings are inherited.
  171. rpc DeleteAccessApprovalSettings(DeleteAccessApprovalSettingsMessage) returns (google.protobuf.Empty) {
  172. option (google.api.http) = {
  173. delete: "/v1/{name=projects/*/accessApprovalSettings}"
  174. additional_bindings {
  175. delete: "/v1/{name=folders/*/accessApprovalSettings}"
  176. }
  177. additional_bindings {
  178. delete: "/v1/{name=organizations/*/accessApprovalSettings}"
  179. }
  180. };
  181. option (google.api.method_signature) = "name";
  182. }
  183. }
  184. // Home office and physical location of the principal.
  185. message AccessLocations {
  186. // The "home office" location of the principal. A two-letter country code
  187. // (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
  188. // limited situations Google systems may refer refer to a region code instead
  189. // of a country code.
  190. // Possible Region Codes:
  191. //
  192. // - ASI: Asia
  193. // - EUR: Europe
  194. // - OCE: Oceania
  195. // - AFR: Africa
  196. // - NAM: North America
  197. // - SAM: South America
  198. // - ANT: Antarctica
  199. // - ANY: Any location
  200. //
  201. string principal_office_country = 1;
  202. // Physical location of the principal at the time of the access. A
  203. // two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
  204. // a region code. In some limited situations Google systems may refer refer to
  205. // a region code instead of a country code.
  206. // Possible Region Codes:
  207. //
  208. // - ASI: Asia
  209. // - EUR: Europe
  210. // - OCE: Oceania
  211. // - AFR: Africa
  212. // - NAM: North America
  213. // - SAM: South America
  214. // - ANT: Antarctica
  215. // - ANY: Any location
  216. //
  217. string principal_physical_location_country = 2;
  218. }
  219. message AccessReason {
  220. // Type of access justification.
  221. enum Type {
  222. // Default value for proto, shouldn't be used.
  223. TYPE_UNSPECIFIED = 0;
  224. // Customer made a request or raised an issue that required the principal to
  225. // access customer data. `detail` is of the form ("#####" is the issue ID):
  226. //
  227. // - "Feedback Report: #####"
  228. // - "Case Number: #####"
  229. // - "Case ID: #####"
  230. // - "E-PIN Reference: #####"
  231. // - "Google-#####"
  232. // - "T-#####"
  233. //
  234. CUSTOMER_INITIATED_SUPPORT = 1;
  235. // The principal accessed customer data in order to diagnose or resolve a
  236. // suspected issue in services or a known outage. Often this access is used
  237. // to confirm that customers are not affected by a suspected service issue
  238. // or to remediate a reversible system issue.
  239. GOOGLE_INITIATED_SERVICE = 2;
  240. // Google initiated service for security, fraud, abuse, or compliance
  241. // purposes.
  242. GOOGLE_INITIATED_REVIEW = 3;
  243. }
  244. // Type of access justification.
  245. Type type = 1;
  246. // More detail about certain reason types. See comments for each type above.
  247. string detail = 2;
  248. }
  249. // A decision that has been made to approve access to a resource.
  250. message ApproveDecision {
  251. // The time at which approval was granted.
  252. google.protobuf.Timestamp approve_time = 1;
  253. // The time at which the approval expires.
  254. google.protobuf.Timestamp expire_time = 2;
  255. }
  256. // A decision that has been made to dismiss an approval request.
  257. message DismissDecision {
  258. // The time at which the approval request was dismissed.
  259. google.protobuf.Timestamp dismiss_time = 1;
  260. }
  261. // The properties associated with the resource of the request.
  262. message ResourceProperties {
  263. // Whether an approval will exclude the descendants of the resource being
  264. // requested.
  265. bool excludes_descendants = 1;
  266. }
  267. // A request for the customer to approve access to a resource.
  268. message ApprovalRequest {
  269. // The resource name of the request. Format is
  270. // "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
  271. string name = 1;
  272. // The resource for which approval is being requested. The format of the
  273. // resource name is defined at
  274. // https://cloud.google.com/apis/design/resource_names. The resource name here
  275. // may either be a "full" resource name (e.g.
  276. // "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
  277. // resource name (e.g. "shelves/shelf1/books/book2") as described in the
  278. // resource name specification.
  279. string requested_resource_name = 2;
  280. // Properties related to the resource represented by requested_resource_name.
  281. ResourceProperties requested_resource_properties = 9;
  282. // The justification for which approval is being requested.
  283. AccessReason requested_reason = 3;
  284. // The locations for which approval is being requested.
  285. AccessLocations requested_locations = 4;
  286. // The time at which approval was requested.
  287. google.protobuf.Timestamp request_time = 5;
  288. // The requested expiration for the approval. If the request is approved,
  289. // access will be granted from the time of approval until the expiration time.
  290. google.protobuf.Timestamp requested_expiration = 6;
  291. // The current decision on the approval request.
  292. oneof decision {
  293. // Access was approved.
  294. ApproveDecision approve = 7;
  295. // The request was dismissed.
  296. DismissDecision dismiss = 8;
  297. }
  298. }
  299. // Represents the enrollment of a cloud resource into a specific service.
  300. message EnrolledService {
  301. // The product for which Access Approval will be enrolled. Allowed values are
  302. // listed below (case-sensitive):
  303. //
  304. // - all
  305. // - appengine.googleapis.com
  306. // - bigquery.googleapis.com
  307. // - bigtable.googleapis.com
  308. // - cloudkms.googleapis.com
  309. // - compute.googleapis.com
  310. // - dataflow.googleapis.com
  311. // - iam.googleapis.com
  312. // - pubsub.googleapis.com
  313. // - storage.googleapis.com
  314. //
  315. string cloud_product = 1;
  316. // The enrollment level of the service.
  317. EnrollmentLevel enrollment_level = 2;
  318. }
  319. // Represents the type of enrollment for a given service to Access Approval.
  320. enum EnrollmentLevel {
  321. // Default value for proto, shouldn't be used.
  322. ENROLLMENT_LEVEL_UNSPECIFIED = 0;
  323. // Service is enrolled in Access Approval for all requests
  324. BLOCK_ALL = 1;
  325. }
  326. // Settings on a Project/Folder/Organization related to Access Approval.
  327. message AccessApprovalSettings {
  328. // The resource name of the settings. Format is one of:
  329. //
  330. // - "projects/{project_id}/accessApprovalSettings"
  331. // - "folders/{folder_id}/accessApprovalSettings"
  332. // - "organizations/{organization_id}/accessApprovalSettings"
  333. //
  334. string name = 1;
  335. // A list of email addresses to which notifications relating to approval
  336. // requests should be sent. Notifications relating to a resource will be sent
  337. // to all emails in the settings of ancestor resources of that resource. A
  338. // maximum of 50 email addresses are allowed.
  339. repeated string notification_emails = 2;
  340. // A list of Google Cloud Services for which the given resource has Access
  341. // Approval enrolled. Access requests for the resource given by name against
  342. // any of these services contained here will be required to have explicit
  343. // approval. If name refers to an organization, enrollment can be done for
  344. // individual services. If name refers to a folder or project, enrollment can
  345. // only be done on an all or nothing basis.
  346. //
  347. // If a cloud_product is repeated in this list, the first entry will be
  348. // honored and all following entries will be discarded. A maximum of 10
  349. // enrolled services will be enforced, to be expanded as the set of supported
  350. // services is expanded.
  351. repeated EnrolledService enrolled_services = 3;
  352. // Output only. This field is read only (not settable via
  353. // UpdateAccessAccessApprovalSettings method). If the field is true, that
  354. // indicates that at least one service is enrolled for Access Approval in one
  355. // or more ancestors of the Project or Folder (this field will always be
  356. // unset for the organization since organizations do not have ancestors).
  357. bool enrolled_ancestor = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  358. }
  359. // Request to list approval requests.
  360. message ListApprovalRequestsMessage {
  361. // The parent resource. This may be "projects/{project_id}",
  362. // "folders/{folder_id}", or "organizations/{organization_id}".
  363. string parent = 1;
  364. // A filter on the type of approval requests to retrieve. Must be one of the
  365. // following values:
  366. //
  367. // - [not set]: Requests that are pending or have active approvals.
  368. // - ALL: All requests.
  369. // - PENDING: Only pending requests.
  370. // - ACTIVE: Only active (i.e. currently approved) requests.
  371. // - DISMISSED: Only dismissed (including expired) requests.
  372. //
  373. string filter = 2;
  374. // Requested page size.
  375. int32 page_size = 3;
  376. // A token identifying the page of results to return.
  377. string page_token = 4;
  378. }
  379. // Response to listing of ApprovalRequest objects.
  380. message ListApprovalRequestsResponse {
  381. // Approval request details.
  382. repeated ApprovalRequest approval_requests = 1;
  383. // Token to retrieve the next page of results, or empty if there are no more.
  384. string next_page_token = 2;
  385. }
  386. // Request to get an approval request.
  387. message GetApprovalRequestMessage {
  388. // Name of the approval request to retrieve.
  389. string name = 1;
  390. }
  391. // Request to approve an ApprovalRequest.
  392. message ApproveApprovalRequestMessage {
  393. // Name of the approval request to approve.
  394. string name = 1;
  395. // The expiration time of this approval.
  396. google.protobuf.Timestamp expire_time = 2;
  397. }
  398. // Request to dismiss an approval request.
  399. message DismissApprovalRequestMessage {
  400. // Name of the ApprovalRequest to dismiss.
  401. string name = 1;
  402. }
  403. // Request to get access approval settings.
  404. message GetAccessApprovalSettingsMessage {
  405. // Name of the AccessApprovalSettings to retrieve.
  406. string name = 1;
  407. }
  408. // Request to update access approval settings.
  409. message UpdateAccessApprovalSettingsMessage {
  410. // The new AccessApprovalSettings.
  411. AccessApprovalSettings settings = 1;
  412. // The update mask applies to the settings. Only the top level fields of
  413. // AccessApprovalSettings (notification_emails & enrolled_services) are
  414. // supported. For each field, if it is included, the currently stored value
  415. // will be entirely overwritten with the value of the field passed in this
  416. // request.
  417. //
  418. // For the `FieldMask` definition, see
  419. // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  420. // If this field is left unset, only the notification_emails field will be
  421. // updated.
  422. google.protobuf.FieldMask update_mask = 2;
  423. }
  424. // Request to delete access approval settings.
  425. message DeleteAccessApprovalSettingsMessage {
  426. // Name of the AccessApprovalSettings to delete.
  427. string name = 1;
  428. }