AWS IAM Permission Boundary or Guardrail Policy Deleted by Unusual Identity

Detects the first time an AWS identity successfully deletes an IAM managed policy whose ARN contains guardrail-related keywords (for example Boundary, Deny, Restrict, Guard, SCP, Guardrail). Adversaries who have obtained elevated IAM privileges may delete policies to remove restrictive permissions boundaries, eliminate deny-based guardrails, or clean up after a privilege escalation operation. Infrastructure-as-code tools (Terraform, CloudFormation, Pulumi, and Ansible) are excluded because policy lifecycle management is a routine part of automated deployments. A policy deletion by an identity not seen performing this activity during the prior seven days may indicate newly compromised credentials being used to modify the account's permission structure.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/07/27"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2026/07/27"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects the first time an AWS identity successfully deletes an IAM managed policy whose ARN contains
 11guardrail-related keywords (for example Boundary, Deny, Restrict, Guard, SCP, Guardrail). Adversaries who have
 12obtained elevated IAM privileges may delete policies to remove restrictive permissions boundaries,
 13eliminate deny-based guardrails, or clean up after a privilege escalation operation. Infrastructure-as-code tools (Terraform, CloudFormation, Pulumi, and Ansible) are excluded because policy lifecycle management is a routine part of automated deployments. A policy deletion by an identity not seen performing this activity during the prior seven days may indicate newly compromised credentials being used to modify the account's permission structure.
 14"""
 15false_positives = [
 16    """
 17    New IAM administrator roles, recently provisioned automation accounts, or first-time
 18    IaC deployments may legitimately delete policies for the first time. Validate that the
 19    identity is an authorized IAM management role and that the deleted policy was obsolete
 20    or replaced as part of a known change.
 21    """,
 22]
 23from = "now-6m"
 24index = ["logs-aws.cloudtrail-*"]
 25interval = "5m"
 26language = "kuery"
 27license = "Elastic License v2"
 28name = "AWS IAM Permission Boundary or Guardrail Policy Deleted by Unusual Identity"
 29note = """## Triage and analysis
 30
 31### Investigating AWS IAM Permission Boundary or Guardrail Policy Deleted by Unusual Identity
 32
 33This rule fires the first time an identity deletes a customer-managed IAM policy in the prior 7 days. Policy deletion is a privilege-escalation or defense-evasion primitive: removing a deny-based policy or permissions boundary silently expands the effective access of every principal that policy applied to.
 34
 35### Possible investigation steps
 36
 37- Identify the deleting principal (`aws.cloudtrail.user_identity.arn`) and determine whether they have a history of IAM policy management in audit logs beyond the 7-day window.
 38- Review `aws.cloudtrail.request_parameters` to identify the policy ARN that was deleted. Policies with names containing "Boundary", "Deny", or "Restrict" in the ARN are highest priority.
 39- Check whether any principal previously had this policy attached as a permissions boundary — if so, those principals may now operate without that constraint.
 40- Review the same identity's CloudTrail activity for other IAM privilege escalation indicators in the same session: `CreatePolicyVersion`, `SetDefaultPolicyVersion`, `AttachRolePolicy`, `UpdateAssumeRolePolicy`.
 41- Determine whether this identity was recently assumed via `AssumeRole` from an unusual source IP.
 42
 43### False positive analysis
 44
 45- First-time IaC deployments (Terraform apply, CDK deploy) that manage IAM resources will appear as new identities performing policy deletions.
 46- New service accounts introduced to handle IAM lifecycle management.
 47
 48### Response and remediation
 49
 50- If unauthorized, determine whether the deleted policy was a permissions boundary and re-apply it immediately to all affected principals.
 51- Revoke or disable the credentials used to perform the deletion pending investigation.
 52- Review all principals that had the policy attached and audit their current effective permissions.
 53"""
 54references = [
 55    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeletePolicy.html",
 56]
 57risk_score = 47
 58rule_id = "f4a82031-9c8e-4b23-a7d5-6e1094b2c539"
 59setup = "The AWS CloudTrail integration must be enabled and configured to collect IAM management events."
 60severity = "medium"
 61tags = [
 62    "Domain: Cloud",
 63    "Data Source: AWS",
 64    "Data Source: Amazon Web Services",
 65    "Data Source: AWS IAM",
 66    "Use Case: Identity and Access Audit",
 67    "Tactic: Defense Evasion",
 68    "Tactic: Persistence",
 69    "Resources: Investigation Guide",
 70]
 71timestamp_override = "event.ingested"
 72type = "new_terms"
 73
 74query = '''
 75data_stream.dataset: "aws.cloudtrail"
 76    and event.provider: "iam.amazonaws.com"
 77    and event.action: "DeletePolicy"
 78    and event.outcome: "success"
 79    and not aws.cloudtrail.user_identity.type: "AWSService"
 80    and aws.cloudtrail.request_parameters: (*Boundary* or *boundary* or *Deny* or *deny* or *Restrict* or *restrict* or *Guard* or *guard* or *SCP* or *Guardrail* or *guardrail*)
 81    and not user_agent.original: (*Terraform* or *terraform* or "cloudformation.amazonaws.com" or *pulumi* or *Pulumi* or *ansible* or *Ansible*)
 82'''
 83
 84[[rule.threat]]
 85framework = "MITRE ATT&CK"
 86
 87[[rule.threat.technique]]
 88id = "T1562"
 89name = "Impair Defenses"
 90reference = "https://attack.mitre.org/techniques/T1562/"
 91
 92[rule.threat.tactic]
 93id = "TA0005"
 94name = "Defense Evasion"
 95reference = "https://attack.mitre.org/tactics/TA0005/"
 96
 97[[rule.threat]]
 98framework = "MITRE ATT&CK"
 99
100[[rule.threat.technique]]
101id = "T1098"
102name = "Account Manipulation"
103reference = "https://attack.mitre.org/techniques/T1098/"
104
105[rule.threat.tactic]
106id = "TA0003"
107name = "Persistence"
108reference = "https://attack.mitre.org/tactics/TA0003/"
109
110[rule.new_terms]
111field = "new_terms_fields"
112value = ["aws.cloudtrail.user_identity.arn"]
113[[rule.new_terms.history_window_start]]
114field = "history_window_start"
115value = "now-7d"
116
117[rule.investigation_fields]
118field_names = [
119    "@timestamp",
120    "aws.cloudtrail.user_identity.session_context.session_issuer.arn",
121    "aws.cloudtrail.user_identity.type",
122    "event.action",
123    "event.outcome",
124    "aws.cloudtrail.request_parameters",
125    "source.ip",
126    "cloud.region",
127    "cloud.account.id",
128]

Triage and analysis

Investigating AWS IAM Permission Boundary or Guardrail Policy Deleted by Unusual Identity

This rule fires the first time an identity deletes a customer-managed IAM policy in the prior 7 days. Policy deletion is a privilege-escalation or defense-evasion primitive: removing a deny-based policy or permissions boundary silently expands the effective access of every principal that policy applied to.

Possible investigation steps

  • Identify the deleting principal (aws.cloudtrail.user_identity.arn) and determine whether they have a history of IAM policy management in audit logs beyond the 7-day window.
  • Review aws.cloudtrail.request_parameters to identify the policy ARN that was deleted. Policies with names containing "Boundary", "Deny", or "Restrict" in the ARN are highest priority.
  • Check whether any principal previously had this policy attached as a permissions boundary — if so, those principals may now operate without that constraint.
  • Review the same identity's CloudTrail activity for other IAM privilege escalation indicators in the same session: CreatePolicyVersion, SetDefaultPolicyVersion, AttachRolePolicy, UpdateAssumeRolePolicy.
  • Determine whether this identity was recently assumed via AssumeRole from an unusual source IP.

False positive analysis

  • First-time IaC deployments (Terraform apply, CDK deploy) that manage IAM resources will appear as new identities performing policy deletions.
  • New service accounts introduced to handle IAM lifecycle management.

Response and remediation

  • If unauthorized, determine whether the deleted policy was a permissions boundary and re-apply it immediately to all affected principals.
  • Revoke or disable the credentials used to perform the deletion pending investigation.
  • Review all principals that had the policy attached and audit their current effective permissions.

References

Related rules

to-top