Skip to main content

violations

Creates, updates, deletes, gets or lists a violations resource.

Overview

Nameviolations
TypeResource
Idgoogle.assuredworkloads.violations

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Immutable. Name of the Violation. Format: organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
acknowledgedbooleanA boolean that indicates if the violation is acknowledged
acknowledgementTimestring (google-datetime)Optional. Timestamp when this violation was acknowledged first. Check exception_contexts to find the last time the violation was acknowledged when there are more than one violations. This field will be absent when acknowledged field is marked as false.
associatedOrgPolicyViolationIdstringOptional. Output only. Violation Id of the org-policy violation due to which the resource violation is caused. Empty for org-policy violations.
auditLogLinkstringOutput only. Immutable. Audit Log Link for violated resource Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{timeRange}{folder}
beginTimestring (google-datetime)Output only. Time of the event which triggered the Violation.
categorystringOutput only. Category under which this violation is mapped. e.g. Location, Service Usage, Access, Encryption, etc.
descriptionstringOutput only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
exceptionAuditLogLinkstringOutput only. Immutable. Audit Log link to find business justification provided for violation exception. Format: https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
exceptionContextsarrayOutput only. List of all the exception detail added for the violation.
nonCompliantOrgPolicystringOutput only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and resulted this violation. Format: projects/{project_number}/policies/{constraint_name} folders/{folder_id}/policies/{constraint_name} organizations/{organization_id}/policies/{constraint_name}
orgPolicyConstraintstringOutput only. Immutable. The org-policy-constraint that was incorrectly changed, which resulted in this violation.
parentProjectNumberstringOptional. Output only. Parent project number where resource is present. Empty for org-policy violations.
remediationobjectOutput only. Compliance violation remediation (id: GoogleCloudAssuredworkloadsV1ViolationRemediation)
resolveTimestring (google-datetime)Output only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty.
resourceNamestringOptional. Output only. Name of the resource like //storage.googleapis.com/myprojectxyz-testbucket. Empty for org-policy violations.
resourceTypestringOptional. Output only. Type of the resource like compute.googleapis.com/Disk, etc. Empty for org-policy violations.
statestringOutput only. State of the violation
updateTimestring (google-datetime)Output only. The last time when the Violation record was updated.
violationTypestringOutput only. Type of the violation

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectorganizationsId, locationsId, workloadsId, violationsIdRetrieves Assured Workload Violation based on ID.
listselectorganizationsId, locationsId, workloadsIdinterval.startTime, interval.endTime, pageSize, pageToken, filterLists the Violations in the AssuredWorkload Environment. Callers may also choose to read across multiple Workloads as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format organizations/{org_id}/locations/{location}/workloads/-
acknowledgeexecorganizationsId, locationsId, workloadsId, violationsIdAcknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
organizationsIdstring
violationsIdstring
workloadsIdstring
filterstring
interval.endTimestring (google-datetime)
interval.startTimestring (google-datetime)
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Retrieves Assured Workload Violation based on ID.

SELECT
name,
acknowledged,
acknowledgementTime,
associatedOrgPolicyViolationId,
auditLogLink,
beginTime,
category,
description,
exceptionAuditLogLink,
exceptionContexts,
nonCompliantOrgPolicy,
orgPolicyConstraint,
parentProjectNumber,
remediation,
resolveTime,
resourceName,
resourceType,
state,
updateTime,
violationType
FROM google.assuredworkloads.violations
WHERE organizationsId = '{{ organizationsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND workloadsId = '{{ workloadsId }}' -- required
AND violationsId = '{{ violationsId }}' -- required;

Lifecycle Methods

Acknowledges an existing violation. By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.

EXEC google.assuredworkloads.violations.acknowledge 
@organizationsId='{{ organizationsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@workloadsId='{{ workloadsId }}' --required,
@violationsId='{{ violationsId }}' --required
@@json=
'{
"comment": "{{ comment }}",
"nonCompliantOrgPolicy": "{{ nonCompliantOrgPolicy }}",
"acknowledgeType": "{{ acknowledgeType }}"
}';