Skip to main content

violations

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

Overview

Nameviolations
TypeResource
Idgoogle.assuredworkloads.violations

Fields

NameDatatypeDescription
namestringOutput only. Immutable. Name of the Violation. Format: organizations/{organization}/locations/{location}/workloads/{workload_id}/violations/{violations_id}
descriptionstringOutput only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value.
acknowledgedbooleanA boolean that indicates if the violation is acknowledged
acknowledgementTimestringOptional. 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}
beginTimestringOutput 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.
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.
remediationobjectRepresents remediation guidance to resolve compliance violation for AssuredWorkload
resolveTimestringOutput 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
updateTimestringOutput only. The last time when the Violation record was updated.
violationTypestringOutput only. Type of the violation

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, organizationsId, violationsId, workloadsIdRetrieves Assured Workload Violation based on ID.
listSELECTlocationsId, organizationsId, workloadsIdLists 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/-
acknowledgeEXEClocationsId, organizationsId, violationsId, workloadsIdAcknowledges 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.

SELECT examples

Lists 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/-

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