Remediate policy violations
Use a policy result and its remediation guidance to investigate a violation and check a later evaluation.
Before You Begin
Obtain query access and identify a resource result. Arrange the source-platform permissions and change approval needed for remediation. This walkthrough uses the AWS Support Role policy and synthetic identifiers; it does not trigger changes or evaluations automatically.
Inspect the AWS Support Role Result
Follow Find your first policy result using /ce/ca/aws/account/aws-support-role. Select an INCOMPLIANT account result and retain its policy ID, object.id, and runTime.
For example, an illustrative account named example-account could report an unattached support policy. Verify the actual message and account identifiers before applying this example's corrective steps.
Review Evidence and Remediation Guidance
Read currentStateMessage, currentStateReferences, and remediationMessage together. Check the deciding condition against policy details. The support-role example examines the AWSSupportAccess policy and IAM role attachments; choose the action that addresses the recorded condition.
Record statusDate and the incompliance dates before making changes. incompliantStartDate records first entry into incompliance; a null incompliantEndDate alone does not establish whether a resource remains incompliant.
Apply and Record the Approved Change
For an account needing a new support role:
-
Prepare
TrustPolicy.jsonwith a trust relationship allowing the intended principal to assume the role. Have the account owner confirm the principal and target account. -
Replace
YOUR_AWS_PROFILEandYOUR_SUPPORT_ROLEbelow with the approved profile and role name. Create the role using that trust policy:aws iam create-role --profile YOUR_AWS_PROFILE --role-name YOUR_SUPPORT_ROLE --assume-role-policy-document file://TrustPolicy.json -
Attach the AWS-managed Support permissions policy:
aws iam attach-role-policy --profile YOUR_AWS_PROFILE --role-name YOUR_SUPPORT_ROLE --policy-arn arn:aws:iam::aws:policy/AWSSupportAccess
If an appropriate role already exists, review its trust relationship and attach the policy to that role rather than creating another. Retain the account, role identifier, change time, and performed actions with your investigation notes.
Compare a Subsequent Evaluation
After inventory collection and a subsequent policy evaluation, query the same policy and resource IDs. Review the run to check execution and input snapshot timing against the change time.
Compare status and evidence with the earlier result. COMPLIANT confirms that the later evaluation satisfied this check. A transition away from INCOMPLIANT can also lead to another status, so do not treat an incompliance end date alone as proof of compliance.
Use Query compliance data to compare recorded observations. If using CeFindings or CeFindingsTrend, verify their exported definitions before relying on their result selection.
Investigate an Unchanged Status
Check whether you are reading a new evaluation and whether its input data reflects the change. Then confirm the correct account, role, policy attachment, and remaining condition evidence.
If the result is UNDETERMINED, investigate missing data rather than assuming remediation succeeded or failed. If no newer result appears, confirm collection and evaluation timing with your Technical Account Manager (TAM). Do not assume an on-demand trigger or fixed refresh interval.
Keep before-and-after result identifiers and the change record when escalating an unresolved outcome. See Review resource results for further evidence checks.