- [Resource: Violation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Violation)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Violation.SCHEMA_REPRESENTATION)
- [State](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#State)
- [Remediation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Remediation)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Remediation.SCHEMA_REPRESENTATION)
- [Instructions](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Instructions)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Instructions.SCHEMA_REPRESENTATION)
- [Gcloud](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Gcloud)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Gcloud.SCHEMA_REPRESENTATION)
- [Console](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Console)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#Console.SCHEMA_REPRESENTATION)
- [RemediationType](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#RemediationType)
- [ExceptionContext](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#ExceptionContext)
  - [JSON representation](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#ExceptionContext.SCHEMA_REPRESENTATION)
- [ViolationType](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#ViolationType)
- [Methods](https://docs.cloud.google.com/assured-workloads/docs/reference/rest/v1beta1/organizations.locations.workloads.violations.md.txt#METHODS_SUMMARY)

## Resource: Violation

A compliance violation that's detected by Assured Workloads monitoring. A violation is created when an organization policy or a resource in a workload (or a Data Boundary scope) changes in a way that doesn't comply with the controls of the applicable compliance regime or framework.

| JSON representation |
|---|
| ``` { "name": string, "description": string, "beginTime": string, "updateTime": string, "resolveTime": string, "category": string, "state": enum (`State`), "orgPolicyConstraint": string, "auditLogLink": string, "nonCompliantOrgPolicy": string, "remediation": { object (`Remediation`) }, "acknowledged": boolean, "exceptionAuditLogLink": string, "exceptionContexts": [ { object (`ExceptionContext`) } ], "violationType": enum (`ViolationType`), "associatedOrgPolicyViolationId": string, "parentProjectNumber": string, "resourceType": string, "resourceName": string, "childResourceViolationCount": integer, "affectedFrameworks": [ string ], "remediationMarkdown": string, "acknowledgementTime": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Immutable. The resource name of the violation. Format: `organizations/{organization}/locations/{location}/workloads/{workloadId}/violations/{violations_id}` |
| `description` | `string` Output only. A description of the violation. For example, `OrgPolicy gcp.resourceLocations has non compliant value.` |
| `beginTime` | ``string (`Timestamp` format)`` Output only. The time of the event that triggered the violation. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `updateTime` | ``string (`Timestamp` format)`` Output only. The time when the violation record was last updated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `resolveTime` | ``string (`Timestamp` format)`` Output only. The time of the event that resolved the violation. This field is empty if the violation is unresolved. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `category` | `string` Output only. The category that the violation is mapped to. For example, `Location`, `Service Usage`, `Access`, or `Encryption`. |
| `state` | ``enum (`State`)`` Output only. The state of the violation. |
| `orgPolicyConstraint (deprecated)` | `string` > [!WARNING] > This item is deprecated! Output only. Immutable. Deprecated: This field is deprecated and might be removed in a future version of the API. Use `nonCompliantOrgPolicy` instead, which contains the full resource name of the organization policy, including the constraint name. The organization policy constraint that was changed in a non-compliant way, which resulted in this violation. |
| `auditLogLink` | `string` Output only. Immutable. A link to the Cloud Audit Logs entries for the violated resource. Format: `https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}` |
| `nonCompliantOrgPolicy` | `string` Output only. Immutable. The name of the organization policy that was modified with a non-compliant change and resulted in this violation. Formats: - `projects/{project_number}/policies/{constraintName}` - `folders/{folderId}/policies/{constraintName}` - `organizations/{organizationId}/policies/{constraintName}` |
| `remediation` | ``object (`Remediation`)`` Output only. The remediation guidance for the violation. |
| `acknowledged` | `boolean` Whether the violation has been acknowledged. |
| `exceptionAuditLogLink` | `string` Output only. Immutable. A link to the Cloud Audit Logs entries that contain the business justification that was provided when the violation was acknowledged. Format: `https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}` |
| `exceptionContexts[]` | ``object (`ExceptionContext`)`` Output only. The details of all of the acknowledgements (exceptions) for the violation. |
| `violationType` | ``enum (`ViolationType`)`` Output only. The type of the violation. |
| `associatedOrgPolicyViolationId` | `string` Optional. Output only. For resource violations, the ID of the organization policy violation that caused this resource violation. This field is empty for organization policy violations. |
| `parentProjectNumber` | `string` Optional. Output only. For resource violations, the number of the project that contains the non-compliant resource. This field is empty for organization policy violations. |
| `resourceType` | `string` Optional. Output only. For resource violations, the type of the non-compliant resource. For example, `compute.googleapis.com/Disk`. This field is empty for organization policy violations. |
| `resourceName` | `string` Optional. Output only. For resource violations, the full resource name of the non-compliant resource. For example, `//storage.googleapis.com/myprojectxyz-testbucket`. This field is empty for organization policy violations. |
| `childResourceViolationCount` | `integer` Optional. Output only. For organization policy violations, the number of resource violations that are associated with this violation. This field is `0` for resource violations. |
| `affectedFrameworks[]` | `string` Output only. The IDs of the compliance frameworks that are affected by this violation. For example, `builtin-fedramp-high`. This field is only populated when using `VIOLATION_VIEW_DATA_BOUNDARY`. |
| `remediationMarkdown` | `string` Output only. The remediation instructions for the violation, in Markdown format. This field is only populated by `violations.get` when using `VIOLATION_VIEW_DATA_BOUNDARY`. When this field isn't populated, see `remediation` instead. |
| `acknowledgementTime` | ``string (`Timestamp` format)`` Optional. The time when the violation was first acknowledged. To find the most recent time that the violation was acknowledged, check `exceptionContexts`. This field is absent when `acknowledged` is `false`. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## State

The state of a violation.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Default value. The state isn't specified. |
| `RESOLVED` | The violation is resolved. |
| `UNRESOLVED` | The violation is unresolved and hasn't been acknowledged. |
| `EXCEPTION` | The violation is unresolved and has been acknowledged as an exception. |

## Remediation

Remediation guidance to resolve a compliance violation.

| JSON representation |
|---|
| ``` { "instructions": { object (`Instructions`) }, "compliantValues": [ string ], "remediationType": enum (`RemediationType`) } ``` |

| Fields ||
|---|---|
| `instructions` | ``object (`Instructions`)`` Required. The instructions to resolve the violation. |
| `compliantValues[]` | `string` The values that can resolve the violation. For example, for list organization policy violations, this field contains the list of allowed or denied values. |
| `remediationType` | ``enum (`RemediationType`)`` Output only. The remediation type, which is based on the type of organization policy values that were violated. |

## Instructions

Instructions to remediate a violation.

| JSON representation |
|---|
| ``` { "gcloudInstructions": { object (`Gcloud`) }, "consoleInstructions": { object (`Console`) } } ``` |

| Fields ||
|---|---|
| `gcloudInstructions` | ``object (`Gcloud`)`` Instructions to resolve the violation by using the gcloud CLI. |
| `consoleInstructions` | ``object (`Console`)`` Instructions to resolve the violation by using the Google Cloud console. |

## Gcloud

Instructions to remediate a violation by using the Google Cloud CLI.

| JSON representation |
|---|
| ``` { "gcloudCommands": [ string ], "steps": [ string ], "additionalLinks": [ string ] } ``` |

| Fields ||
|---|---|
| `gcloudCommands[]` | `string` The gcloud CLI commands that resolve the violation. |
| `steps[]` | `string` The steps to resolve the violation by using the gcloud CLI. |
| `additionalLinks[]` | `string` Additional URLs with more information about the steps. |

## Console

Instructions to remediate a violation by using the Google Cloud console.

| JSON representation |
|---|
| ``` { "consoleUris": [ string ], "steps": [ string ], "additionalLinks": [ string ] } ``` |

| Fields ||
|---|---|
| `consoleUris[]` | `string` Links to the Google Cloud console pages where the violation can be resolved. |
| `steps[]` | `string` The steps to resolve the violation by using the Google Cloud console. |
| `additionalLinks[]` | `string` Additional URLs with more information about the steps. |

## RemediationType

The type of remediation, which is based on the kind of violation. For example, violations that are caused by changes in a boolean organization policy require different remediation instructions than violations that are caused by changes in the allowed values of a list organization policy.

| Enums ||
|---|---|
| `REMEDIATION_TYPE_UNSPECIFIED` | Default value. The remediation type isn't specified. |
| `REMEDIATION_BOOLEAN_ORG_POLICY_VIOLATION` | Remediation for a boolean organization policy violation. |
| `REMEDIATION_LIST_ALLOWED_VALUES_ORG_POLICY_VIOLATION` | Remediation for a list organization policy violation where the monitoring rule specifies allowed values. |
| `REMEDIATION_LIST_DENIED_VALUES_ORG_POLICY_VIOLATION` | Remediation for a list organization policy violation where the monitoring rule specifies denied values. |
| `REMEDIATION_RESTRICT_CMEK_CRYPTO_KEY_PROJECTS_ORG_POLICY_VIOLATION` | Remediation for a `gcp.restrictCmekCryptoKeyProjects` organization policy violation. |
| `REMEDIATION_RESOURCE_VIOLATION` | Remediation for a resource violation. |
| `REMEDIATION_RESOURCE_VIOLATION_NON_CMEK_SERVICES` | Remediation for a resource violation that's caused by the `gcp.restrictNonCmekServices` organization policy. |

## ExceptionContext

Details about an acknowledgement (exception) of a violation.

| JSON representation |
|---|
| ``` { "comment": string, "acknowledgementTime": string, "userName": string } ``` |

| Fields ||
|---|---|
| `comment` | `string` The business justification that was provided when the violation was acknowledged. |
| `acknowledgementTime` | ``string (`Timestamp` format)`` The time when the violation was acknowledged. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `userName` | `string` The name of the user (or service account) who acknowledged the violation. |

## ViolationType

The type of a violation.

| Enums ||
|---|---|
| `VIOLATION_TYPE_UNSPECIFIED` | Default value. The violation type isn't specified. |
| `ORG_POLICY` | A violation that's caused by a non-compliant change to an organization policy. |
| `RESOURCE` | A violation that's caused by a non-compliant resource. |

| ## Methods ||
|---|---|
| ### `acknowledge` | Acknowledges an existing violation. |
| ### `get` | Retrieves an Assured Workloads violation by its resource name. |
| ### `list` | Lists the Violations in the AssuredWorkload Environment. |