assuredworkloads.proto 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. // Copyright 2022 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.assuredworkloads.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/duration.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/protobuf/timestamp.proto";
  25. option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/assuredworkloads/v1;assuredworkloads";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "AssuredworkloadsProto";
  29. option java_package = "com.google.cloud.assuredworkloads.v1";
  30. option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1";
  31. option ruby_package = "Google::Cloud::AssuredWorkloads::V1";
  32. option (google.api.resource_definition) = {
  33. type: "assuredworkloads.googleapis.com/Location"
  34. pattern: "organizations/{organization}/locations/{location}"
  35. };
  36. // Service to manage AssuredWorkloads.
  37. service AssuredWorkloadsService {
  38. option (google.api.default_host) = "assuredworkloads.googleapis.com";
  39. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  40. // Creates Assured Workload.
  41. rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) {
  42. option (google.api.http) = {
  43. post: "/v1/{parent=organizations/*/locations/*}/workloads"
  44. body: "workload"
  45. };
  46. option (google.api.method_signature) = "parent,workload";
  47. option (google.longrunning.operation_info) = {
  48. response_type: "Workload"
  49. metadata_type: "CreateWorkloadOperationMetadata"
  50. };
  51. }
  52. // Updates an existing workload.
  53. // Currently allows updating of workload display_name and labels.
  54. // For force updates don't set etag field in the Workload.
  55. // Only one update operation per workload can be in progress.
  56. rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) {
  57. option (google.api.http) = {
  58. patch: "/v1/{workload.name=organizations/*/locations/*/workloads/*}"
  59. body: "workload"
  60. };
  61. option (google.api.method_signature) = "workload,update_mask";
  62. }
  63. // Restrict the list of resources allowed in the Workload environment.
  64. // The current list of allowed products can be found at
  65. // https://cloud.google.com/assured-workloads/docs/supported-products
  66. // In addition to assuredworkloads.workload.update permission, the user should
  67. // also have orgpolicy.policy.set permission on the folder resource
  68. // to use this functionality.
  69. rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) {
  70. option (google.api.http) = {
  71. post: "/v1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources"
  72. body: "*"
  73. };
  74. }
  75. // Deletes the workload. Make sure that workload's direct children are already
  76. // in a deleted state, otherwise the request will fail with a
  77. // FAILED_PRECONDITION error.
  78. rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) {
  79. option (google.api.http) = {
  80. delete: "/v1/{name=organizations/*/locations/*/workloads/*}"
  81. };
  82. option (google.api.method_signature) = "name";
  83. }
  84. // Gets Assured Workload associated with a CRM Node
  85. rpc GetWorkload(GetWorkloadRequest) returns (Workload) {
  86. option (google.api.http) = {
  87. get: "/v1/{name=organizations/*/locations/*/workloads/*}"
  88. };
  89. option (google.api.method_signature) = "name";
  90. }
  91. // Lists Assured Workloads under a CRM Node.
  92. rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) {
  93. option (google.api.http) = {
  94. get: "/v1/{parent=organizations/*/locations/*}/workloads"
  95. };
  96. option (google.api.method_signature) = "parent";
  97. }
  98. // Lists the Violations in the AssuredWorkload Environment.
  99. // Callers may also choose to read across multiple Workloads as per
  100. // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
  101. // character) as a wildcard character instead of workload-id in the parent.
  102. // Format `organizations/{org_id}/locations/{location}/workloads/-`
  103. rpc ListViolations(ListViolationsRequest) returns (ListViolationsResponse) {
  104. option (google.api.method_signature) = "parent";
  105. }
  106. // Retrieves Assured Workload Violation based on ID.
  107. rpc GetViolation(GetViolationRequest) returns (Violation) {
  108. option (google.api.method_signature) = "name";
  109. }
  110. // Acknowledges an existing violation. By acknowledging a violation, users
  111. // acknowledge the existence of a compliance violation in their workload and
  112. // decide to ignore it due to a valid business justification. Acknowledgement
  113. // is a permanent operation and it cannot be reverted.
  114. rpc AcknowledgeViolation(AcknowledgeViolationRequest) returns (AcknowledgeViolationResponse) {
  115. }
  116. }
  117. // Request for creating a workload.
  118. message CreateWorkloadRequest {
  119. // Required. The resource name of the new Workload's parent.
  120. // Must be of the form `organizations/{org_id}/locations/{location_id}`.
  121. string parent = 1 [
  122. (google.api.field_behavior) = REQUIRED,
  123. (google.api.resource_reference) = {
  124. child_type: "assuredworkloads.googleapis.com/Workload"
  125. }
  126. ];
  127. // Required. Assured Workload to create
  128. Workload workload = 2 [(google.api.field_behavior) = REQUIRED];
  129. // Optional. A identifier associated with the workload and underlying projects which
  130. // allows for the break down of billing costs for a workload. The value
  131. // provided for the identifier will add a label to the workload and contained
  132. // projects with the identifier as the value.
  133. string external_id = 3 [(google.api.field_behavior) = OPTIONAL];
  134. }
  135. // Request for Updating a workload.
  136. message UpdateWorkloadRequest {
  137. // Required. The workload to update.
  138. // The workload's `name` field is used to identify the workload to be updated.
  139. // Format:
  140. // organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
  141. Workload workload = 1 [(google.api.field_behavior) = REQUIRED];
  142. // Required. The list of fields to be updated.
  143. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  144. }
  145. // Request for deleting a Workload.
  146. message DeleteWorkloadRequest {
  147. // Required. The `name` field is used to identify the workload.
  148. // Format:
  149. // organizations/{org_id}/locations/{location_id}/workloads/{workload_id}
  150. string name = 1 [
  151. (google.api.field_behavior) = REQUIRED,
  152. (google.api.resource_reference) = {
  153. type: "assuredworkloads.googleapis.com/Workload"
  154. }
  155. ];
  156. // Optional. The etag of the workload.
  157. // If this is provided, it must match the server's etag.
  158. string etag = 2 [(google.api.field_behavior) = OPTIONAL];
  159. }
  160. // Request for fetching a workload.
  161. message GetWorkloadRequest {
  162. // Required. The resource name of the Workload to fetch. This is the workload's
  163. // relative path in the API, formatted as
  164. // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
  165. // For example,
  166. // "organizations/123/locations/us-east1/workloads/assured-workload-1".
  167. string name = 1 [
  168. (google.api.field_behavior) = REQUIRED,
  169. (google.api.resource_reference) = {
  170. type: "assuredworkloads.googleapis.com/Workload"
  171. }
  172. ];
  173. }
  174. // Request for fetching workloads in an organization.
  175. message ListWorkloadsRequest {
  176. // Required. Parent Resource to list workloads from.
  177. // Must be of the form `organizations/{org_id}/locations/{location}`.
  178. string parent = 1 [
  179. (google.api.field_behavior) = REQUIRED,
  180. (google.api.resource_reference) = {
  181. child_type: "assuredworkloads.googleapis.com/Workload"
  182. }
  183. ];
  184. // Page size.
  185. int32 page_size = 2;
  186. // Page token returned from previous request. Page token contains context from
  187. // previous request. Page token needs to be passed in the second and following
  188. // requests.
  189. string page_token = 3;
  190. // A custom filter for filtering by properties of a workload. At this time,
  191. // only filtering by labels is supported.
  192. string filter = 4;
  193. }
  194. // Response of ListWorkloads endpoint.
  195. message ListWorkloadsResponse {
  196. // List of Workloads under a given parent.
  197. repeated Workload workloads = 1;
  198. // The next page token. Return empty if reached the last page.
  199. string next_page_token = 2;
  200. }
  201. // A Workload object for managing highly regulated workloads of cloud
  202. // customers.
  203. message Workload {
  204. option (google.api.resource) = {
  205. type: "assuredworkloads.googleapis.com/Workload"
  206. pattern: "organizations/{organization}/locations/{location}/workloads/{workload}"
  207. };
  208. // Represent the resources that are children of this Workload.
  209. message ResourceInfo {
  210. // The type of resource.
  211. enum ResourceType {
  212. // Unknown resource type.
  213. RESOURCE_TYPE_UNSPECIFIED = 0;
  214. // Consumer project.
  215. // AssuredWorkloads Projects are no longer supported. This field will be
  216. // ignored only in CreateWorkload requests. ListWorkloads and GetWorkload
  217. // will continue to provide projects information.
  218. // Use CONSUMER_FOLDER instead.
  219. CONSUMER_PROJECT = 1 [deprecated = true];
  220. // Consumer Folder.
  221. CONSUMER_FOLDER = 4;
  222. // Consumer project containing encryption keys.
  223. ENCRYPTION_KEYS_PROJECT = 2;
  224. // Keyring resource that hosts encryption keys.
  225. KEYRING = 3;
  226. }
  227. // Resource identifier.
  228. // For a project this represents project_number.
  229. int64 resource_id = 1;
  230. // Indicates the type of resource.
  231. ResourceType resource_type = 2;
  232. }
  233. // Supported Compliance Regimes.
  234. enum ComplianceRegime {
  235. // Unknown compliance regime.
  236. COMPLIANCE_REGIME_UNSPECIFIED = 0;
  237. // Information protection as per DoD IL4 requirements.
  238. IL4 = 1;
  239. // Criminal Justice Information Services (CJIS) Security policies.
  240. CJIS = 2;
  241. // FedRAMP High data protection controls
  242. FEDRAMP_HIGH = 3;
  243. // FedRAMP Moderate data protection controls
  244. FEDRAMP_MODERATE = 4;
  245. // Assured Workloads For US Regions data protection controls
  246. US_REGIONAL_ACCESS = 5;
  247. // Health Insurance Portability and Accountability Act controls
  248. HIPAA = 6;
  249. // Health Information Trust Alliance controls
  250. HITRUST = 7;
  251. // Assured Workloads For EU Regions and Support controls
  252. EU_REGIONS_AND_SUPPORT = 8;
  253. // Assured Workloads For Canada Regions and Support controls
  254. CA_REGIONS_AND_SUPPORT = 9;
  255. // International Traffic in Arms Regulations
  256. ITAR = 10;
  257. // Assured Workloads for Australia Regions and Support controls
  258. // Available for public preview consumption.
  259. // Don't create production workloads.
  260. AU_REGIONS_AND_US_SUPPORT = 11;
  261. // Assured Workloads for Partners
  262. ASSURED_WORKLOADS_FOR_PARTNERS = 12;
  263. }
  264. // Settings specific to the Key Management Service.
  265. // This message is deprecated.
  266. // In order to create a Keyring, callers should specify,
  267. // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
  268. message KMSSettings {
  269. option deprecated = true;
  270. // Required. Input only. Immutable. The time at which the Key Management Service will automatically create a
  271. // new version of the crypto key and mark it as the primary.
  272. google.protobuf.Timestamp next_rotation_time = 1 [
  273. (google.api.field_behavior) = REQUIRED,
  274. (google.api.field_behavior) = INPUT_ONLY,
  275. (google.api.field_behavior) = IMMUTABLE
  276. ];
  277. // Required. Input only. Immutable. [next_rotation_time] will be advanced by this period when the Key
  278. // Management Service automatically rotates a key. Must be at least 24 hours
  279. // and at most 876,000 hours.
  280. google.protobuf.Duration rotation_period = 2 [
  281. (google.api.field_behavior) = REQUIRED,
  282. (google.api.field_behavior) = INPUT_ONLY,
  283. (google.api.field_behavior) = IMMUTABLE
  284. ];
  285. }
  286. // Represent the custom settings for the resources to be created.
  287. message ResourceSettings {
  288. // Resource identifier.
  289. // For a project this represents project_id. If the project is already
  290. // taken, the workload creation will fail.
  291. // For KeyRing, this represents the keyring_id.
  292. // For a folder, don't set this value as folder_id is assigned by Google.
  293. string resource_id = 1;
  294. // Indicates the type of resource. This field should be specified to
  295. // correspond the id to the right resource type (CONSUMER_FOLDER or
  296. // ENCRYPTION_KEYS_PROJECT)
  297. ResourceInfo.ResourceType resource_type = 2;
  298. // User-assigned resource display name.
  299. // If not empty it will be used to create a resource with the specified
  300. // name.
  301. string display_name = 3;
  302. }
  303. // Key Access Justifications(KAJ) Enrollment State.
  304. enum KajEnrollmentState {
  305. // Default State for KAJ Enrollment.
  306. KAJ_ENROLLMENT_STATE_UNSPECIFIED = 0;
  307. // Pending State for KAJ Enrollment.
  308. KAJ_ENROLLMENT_STATE_PENDING = 1;
  309. // Complete State for KAJ Enrollment.
  310. KAJ_ENROLLMENT_STATE_COMPLETE = 2;
  311. }
  312. // Signed Access Approvals (SAA) enrollment response.
  313. message SaaEnrollmentResponse {
  314. // Setup state of SAA enrollment.
  315. enum SetupState {
  316. // Unspecified.
  317. SETUP_STATE_UNSPECIFIED = 0;
  318. // SAA enrollment pending.
  319. STATUS_PENDING = 1;
  320. // SAA enrollment comopleted.
  321. STATUS_COMPLETE = 2;
  322. }
  323. // Setup error of SAA enrollment.
  324. enum SetupError {
  325. // Unspecified.
  326. SETUP_ERROR_UNSPECIFIED = 0;
  327. // Invalid states for all customers, to be redirected to AA UI for
  328. // additional details.
  329. ERROR_INVALID_BASE_SETUP = 1;
  330. // Returned when there is not an EKM key configured.
  331. ERROR_MISSING_EXTERNAL_SIGNING_KEY = 2;
  332. // Returned when there are no enrolled services or the customer is
  333. // enrolled in CAA only for a subset of services.
  334. ERROR_NOT_ALL_SERVICES_ENROLLED = 3;
  335. // Returned when exception was encountered during evaluation of other
  336. // criteria.
  337. ERROR_SETUP_CHECK_FAILED = 4;
  338. }
  339. // Indicates SAA enrollment status of a given workload.
  340. optional SetupState setup_status = 1;
  341. // Indicates SAA enrollment setup error if any.
  342. repeated SetupError setup_errors = 2;
  343. }
  344. // Supported Assured Workloads Partners.
  345. enum Partner {
  346. // Unknown partner regime/controls.
  347. PARTNER_UNSPECIFIED = 0;
  348. // S3NS regime/controls.
  349. LOCAL_CONTROLS_BY_S3NS = 1;
  350. }
  351. // Optional. The resource name of the workload.
  352. // Format:
  353. // organizations/{organization}/locations/{location}/workloads/{workload}
  354. //
  355. // Read-only.
  356. string name = 1 [(google.api.field_behavior) = OPTIONAL];
  357. // Required. The user-assigned display name of the Workload.
  358. // When present it must be between 4 to 30 characters.
  359. // Allowed characters are: lowercase and uppercase letters, numbers,
  360. // hyphen, and spaces.
  361. //
  362. // Example: My Workload
  363. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  364. // Output only. The resources associated with this workload.
  365. // These resources will be created when creating the workload.
  366. // If any of the projects already exist, the workload creation will fail.
  367. // Always read only.
  368. repeated ResourceInfo resources = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  369. // Required. Immutable. Compliance Regime associated with this workload.
  370. ComplianceRegime compliance_regime = 4 [
  371. (google.api.field_behavior) = REQUIRED,
  372. (google.api.field_behavior) = IMMUTABLE
  373. ];
  374. // Output only. Immutable. The Workload creation timestamp.
  375. google.protobuf.Timestamp create_time = 5 [
  376. (google.api.field_behavior) = OUTPUT_ONLY,
  377. (google.api.field_behavior) = IMMUTABLE
  378. ];
  379. // Optional. The billing account used for the resources which are
  380. // direct children of workload. This billing account is initially associated
  381. // with the resources created as part of Workload creation.
  382. // After the initial creation of these resources, the customer can change
  383. // the assigned billing account.
  384. // The resource name has the form
  385. // `billingAccounts/{billing_account_id}`. For example,
  386. // `billingAccounts/012345-567890-ABCDEF`.
  387. string billing_account = 6 [(google.api.field_behavior) = OPTIONAL];
  388. // Optional. ETag of the workload, it is calculated on the basis
  389. // of the Workload contents. It will be used in Update & Delete operations.
  390. string etag = 9 [(google.api.field_behavior) = OPTIONAL];
  391. // Optional. Labels applied to the workload.
  392. map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
  393. // Input only. The parent resource for the resources managed by this Assured Workload. May
  394. // be either empty or a folder resource which is a child of the
  395. // Workload parent. If not specified all resources are created under the
  396. // parent organization.
  397. // Format:
  398. // folders/{folder_id}
  399. string provisioned_resources_parent = 13 [(google.api.field_behavior) = INPUT_ONLY];
  400. // Input only. Settings used to create a CMEK crypto key. When set, a project with a KMS
  401. // CMEK key is provisioned.
  402. // This field is deprecated as of Feb 28, 2022.
  403. // In order to create a Keyring, callers should specify,
  404. // ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type field.
  405. KMSSettings kms_settings = 14 [
  406. deprecated = true,
  407. (google.api.field_behavior) = INPUT_ONLY
  408. ];
  409. // Input only. Resource properties that are used to customize workload resources.
  410. // These properties (such as custom project id) will be used to create
  411. // workload resources if possible. This field is optional.
  412. repeated ResourceSettings resource_settings = 15 [(google.api.field_behavior) = INPUT_ONLY];
  413. // Output only. Represents the KAJ enrollment state of the given workload.
  414. KajEnrollmentState kaj_enrollment_state = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  415. // Optional. Indicates the sovereignty status of the given workload.
  416. // Currently meant to be used by Europe/Canada customers.
  417. bool enable_sovereign_controls = 18 [(google.api.field_behavior) = OPTIONAL];
  418. // Output only. Represents the SAA enrollment response of the given workload.
  419. // SAA enrollment response is queried during GetWorkload call.
  420. // In failure cases, user friendly error message is shown in SAA details page.
  421. SaaEnrollmentResponse saa_enrollment_response = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  422. // Output only. Urls for services which are compliant for this Assured Workload, but which
  423. // are currently disallowed by the ResourceUsageRestriction org policy.
  424. // Invoke RestrictAllowedResources endpoint to allow your project developers
  425. // to use these services in their environment."
  426. repeated string compliant_but_disallowed_services = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  427. // Optional. Compliance Regime associated with this workload.
  428. Partner partner = 25 [(google.api.field_behavior) = OPTIONAL];
  429. }
  430. // Operation metadata to give request details of CreateWorkload.
  431. message CreateWorkloadOperationMetadata {
  432. // Optional. Time when the operation was created.
  433. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OPTIONAL];
  434. // Optional. The display name of the workload.
  435. string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
  436. // Optional. The parent of the workload.
  437. string parent = 3 [(google.api.field_behavior) = OPTIONAL];
  438. // Optional. Compliance controls that should be applied to the resources managed by
  439. // the workload.
  440. Workload.ComplianceRegime compliance_regime = 4 [(google.api.field_behavior) = OPTIONAL];
  441. }
  442. // Request for restricting list of available resources in Workload environment.
  443. message RestrictAllowedResourcesRequest {
  444. // The type of restriction.
  445. enum RestrictionType {
  446. // Unknown restriction type.
  447. RESTRICTION_TYPE_UNSPECIFIED = 0;
  448. // Allow the use all of all gcp products, irrespective of the compliance
  449. // posture. This effectively removes gcp.restrictServiceUsage OrgPolicy
  450. // on the AssuredWorkloads Folder.
  451. ALLOW_ALL_GCP_RESOURCES = 1;
  452. // Based on Workload's compliance regime, allowed list changes.
  453. // See - https://cloud.google.com/assured-workloads/docs/supported-products
  454. // for the list of supported resources.
  455. ALLOW_COMPLIANT_RESOURCES = 2;
  456. }
  457. // Required. The resource name of the Workload. This is the workloads's
  458. // relative path in the API, formatted as
  459. // "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
  460. // For example,
  461. // "organizations/123/locations/us-east1/workloads/assured-workload-1".
  462. string name = 1 [(google.api.field_behavior) = REQUIRED];
  463. // Required. The type of restriction for using gcp products in the Workload environment.
  464. RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED];
  465. }
  466. // Response for restricting the list of allowed resources.
  467. message RestrictAllowedResourcesResponse {
  468. }
  469. // Request for acknowledging the violation
  470. // Next Id: 4
  471. message AcknowledgeViolationRequest {
  472. // Required. The resource name of the Violation to acknowledge.
  473. // Format:
  474. // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
  475. string name = 1 [(google.api.field_behavior) = REQUIRED];
  476. // Required. Business justification explaining the need for violation acknowledgement
  477. string comment = 2 [(google.api.field_behavior) = REQUIRED];
  478. // Optional. This field is deprecated and will be removed in future version of the API.
  479. // Name of the OrgPolicy which was modified with non-compliant change and
  480. // resulted in this violation.
  481. // Format:
  482. // projects/{project_number}/policies/{constraint_name}
  483. // folders/{folder_id}/policies/{constraint_name}
  484. // organizations/{organization_id}/policies/{constraint_name}
  485. string non_compliant_org_policy = 3 [
  486. deprecated = true,
  487. (google.api.field_behavior) = OPTIONAL
  488. ];
  489. }
  490. // Response for violation acknowledgement
  491. message AcknowledgeViolationResponse {
  492. }
  493. // Interval defining a time window.
  494. message TimeWindow {
  495. // The start of the time window.
  496. google.protobuf.Timestamp start_time = 1;
  497. // The end of the time window.
  498. google.protobuf.Timestamp end_time = 2;
  499. }
  500. // Request for fetching violations in an organization.
  501. message ListViolationsRequest {
  502. // Required. The Workload name.
  503. // Format `organizations/{org_id}/locations/{location}/workloads/{workload}`.
  504. string parent = 1 [
  505. (google.api.field_behavior) = REQUIRED,
  506. (google.api.resource_reference) = {
  507. child_type: "assuredworkloads.googleapis.com/Violation"
  508. }
  509. ];
  510. // Optional. Specifies the time window for retrieving active Violations.
  511. // When specified, retrieves Violations that were active between start_time
  512. // and end_time.
  513. TimeWindow interval = 2 [(google.api.field_behavior) = OPTIONAL];
  514. // Optional. Page size.
  515. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  516. // Optional. Page token returned from previous request.
  517. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  518. // Optional. A custom filter for filtering by the Violations properties.
  519. string filter = 5 [(google.api.field_behavior) = OPTIONAL];
  520. }
  521. // Response of ListViolations endpoint.
  522. message ListViolationsResponse {
  523. // List of Violations under a Workload.
  524. repeated Violation violations = 1;
  525. // The next page token. Returns empty if reached the last page.
  526. string next_page_token = 2;
  527. }
  528. // Request for fetching a Workload Violation.
  529. message GetViolationRequest {
  530. // Required. The resource name of the Violation to fetch (ie. Violation.name).
  531. // Format:
  532. // organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}
  533. string name = 1 [
  534. (google.api.field_behavior) = REQUIRED,
  535. (google.api.resource_reference) = {
  536. type: "assuredworkloads.googleapis.com/Violation"
  537. }
  538. ];
  539. }
  540. // Workload monitoring Violation.
  541. message Violation {
  542. option (google.api.resource) = {
  543. type: "assuredworkloads.googleapis.com/Violation"
  544. pattern: "organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}"
  545. };
  546. // Violation State Values
  547. enum State {
  548. // Unspecified state.
  549. STATE_UNSPECIFIED = 0;
  550. // Violation is resolved.
  551. RESOLVED = 2;
  552. // Violation is Unresolved
  553. UNRESOLVED = 3;
  554. // Violation is Exception
  555. EXCEPTION = 4;
  556. }
  557. // Represents remediation guidance to resolve compliance violation for
  558. // AssuredWorkload
  559. message Remediation {
  560. // Classifying remediation into various types based on the kind of
  561. // violation. For example, violations caused due to changes in boolean org
  562. // policy requires different remediation instructions compared to violation
  563. // caused due to changes in allowed values of list org policy.
  564. enum RemediationType {
  565. // Unspecified remediation type
  566. REMEDIATION_TYPE_UNSPECIFIED = 0;
  567. // Remediation type for boolean org policy
  568. REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION = 1;
  569. // Remediation type for list org policy which have allowed values in the
  570. // monitoring rule
  571. REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION = 2;
  572. // Remediation type for list org policy which have denied values in the
  573. // monitoring rule
  574. REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION = 3;
  575. // Remediation type for gcp.restrictCmekCryptoKeyProjects
  576. REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION = 4;
  577. }
  578. // Instructions to remediate violation
  579. message Instructions {
  580. // Remediation instructions to resolve violation via gcloud cli
  581. message Gcloud {
  582. // Gcloud command to resolve violation
  583. repeated string gcloud_commands = 1;
  584. // Steps to resolve violation via gcloud cli
  585. repeated string steps = 2;
  586. // Additional urls for more information about steps
  587. repeated string additional_links = 3;
  588. }
  589. // Remediation instructions to resolve violation via cloud console
  590. message Console {
  591. // Link to console page where violations can be resolved
  592. repeated string console_uris = 1;
  593. // Steps to resolve violation via cloud console
  594. repeated string steps = 2;
  595. // Additional urls for more information about steps
  596. repeated string additional_links = 3;
  597. }
  598. // Remediation instructions to resolve violation via gcloud cli
  599. Gcloud gcloud_instructions = 1;
  600. // Remediation instructions to resolve violation via cloud console
  601. Console console_instructions = 2;
  602. }
  603. // Required. Remediation instructions to resolve violations
  604. Instructions instructions = 1 [(google.api.field_behavior) = REQUIRED];
  605. // Values that can resolve the violation
  606. // For example: for list org policy violations, this will either be the list
  607. // of allowed or denied values
  608. repeated string compliant_values = 2;
  609. // Output only. Reemediation type based on the type of org policy values violated
  610. RemediationType remediation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  611. }
  612. // Output only. Immutable. Name of the Violation.
  613. // Format:
  614. // organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
  615. string name = 1 [
  616. (google.api.field_behavior) = OUTPUT_ONLY,
  617. (google.api.field_behavior) = IMMUTABLE
  618. ];
  619. // Output only. Description for the Violation.
  620. // e.g. OrgPolicy gcp.resourceLocations has non compliant value.
  621. string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  622. // Output only. Time of the event which triggered the Violation.
  623. google.protobuf.Timestamp begin_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  624. // Output only. The last time when the Violation record was updated.
  625. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  626. // Output only. Time of the event which fixed the Violation.
  627. // If the violation is ACTIVE this will be empty.
  628. google.protobuf.Timestamp resolve_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  629. // Output only. Category under which this violation is mapped.
  630. // e.g. Location, Service Usage, Access, Encryption, etc.
  631. string category = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  632. // Output only. State of the violation
  633. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  634. // Output only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in
  635. // this violation.
  636. string org_policy_constraint = 8 [
  637. (google.api.field_behavior) = OUTPUT_ONLY,
  638. (google.api.field_behavior) = IMMUTABLE
  639. ];
  640. // Output only. Immutable. Audit Log Link for violated resource
  641. // Format:
  642. // https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
  643. string audit_log_link = 11 [
  644. (google.api.field_behavior) = OUTPUT_ONLY,
  645. (google.api.field_behavior) = IMMUTABLE
  646. ];
  647. // Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and
  648. // resulted this violation.
  649. // Format:
  650. // projects/{project_number}/policies/{constraint_name}
  651. // folders/{folder_id}/policies/{constraint_name}
  652. // organizations/{organization_id}/policies/{constraint_name}
  653. string non_compliant_org_policy = 12 [
  654. (google.api.field_behavior) = OUTPUT_ONLY,
  655. (google.api.field_behavior) = IMMUTABLE
  656. ];
  657. // Output only. Compliance violation remediation
  658. Remediation remediation = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  659. // Output only. A boolean that indicates if the violation is acknowledged
  660. bool acknowledged = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  661. // Optional. Timestamp when this violation was acknowledged last.
  662. // This will be absent when acknowledged field is marked as false.
  663. optional google.protobuf.Timestamp acknowledgement_time = 15 [(google.api.field_behavior) = OPTIONAL];
  664. // Output only. Immutable. Audit Log link to find business justification provided for violation
  665. // exception. Format:
  666. // https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
  667. string exception_audit_log_link = 16 [
  668. (google.api.field_behavior) = OUTPUT_ONLY,
  669. (google.api.field_behavior) = IMMUTABLE
  670. ];
  671. }