AWS IAM Group Deletion

Detects when an IAM group is deleted using the DeleteGroup API call. Deletion of an IAM group may represent a malicious attempt to remove audit trails, disrupt operations, or hide adversary activity (for example after using the group briefly for privileged access). This can be an indicator of impact or cleanup in an attack lifecycle.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/05/21"
  3integration = ["aws"]
  4maturity = "production"
  5updated_date = "2025/10/30"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Detects when an IAM group is deleted using the DeleteGroup API call. Deletion of an IAM group may represent a malicious
 11attempt to remove audit trails, disrupt operations, or hide adversary activity (for example after using the group
 12briefly for privileged access). This can be an indicator of impact or cleanup in an attack lifecycle.
 13"""
 14false_positives = [
 15    """
 16    Legitimate group deletion during decommissioning of projects, clean-up of service accounts, or identity lifecycle
 17    changes may trigger this alert. Verify whether the user identity, user agent, and/or hostname should be making
 18    changes in your environment. Resource group deletions by unfamiliar users or hosts should be investigated. If known
 19    behavior is causing false positives, it can be exempted from the rule.
 20    """,
 21]
 22from = "now-6m"
 23index = ["filebeat-*", "logs-aws.cloudtrail-*"]
 24language = "kuery"
 25license = "Elastic License v2"
 26name = "AWS IAM Group Deletion"
 27note = """## Triage and analysis
 28
 29> **Disclaimer**:
 30> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
 31
 32### Investigating AWS IAM Group Deletion
 33
 34Attackers sometimes remove groups to erase evidence, disrupt operations, or prevent users from receiving needed permissions (Impact). Deletion can also follow malicious cleanup after attaching policies and using the group briefly. This alert fires on `DeleteGroup` API call. Consider intentional disruption or covering tracks, particularly if the group was privileged or recently modified.
 35
 36### Possible investigation steps
 37
 38- **Identify the actor and environment**  
 39  - Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.access_key_id`.  
 40  - Check `source.ip`, `user_agent.original`, `cloud.account.id`, `cloud.region` for atypical activity.
 41
 42- **Determine what was lost**
 43  - From `aws.cloudtrail.request_parameters`, capture `groupName`.  
 44  - Use history or logs to identify existing members and attached policies prior to deletion (ex: `GetGroup`, `ListAttachedGroupPolicies`).  
 45  - Determine if the group contained privileged roles/policies that could have been weaponized.
 46
 47- **Correlate with related activity**
 48  - Look in the prior 1–24h for `DetachGroupPolicy`, `RemoveUserFromGroup`, `DeleteGroupPolicy`, which often precede deletion in adversary cleanup workflows.  
 49  - After deletion, monitor for creation of new similarly-named groups, or re-attachment of policies to other groups/roles.
 50
 51### False positive analysis
 52
 53- Projects & services that are being decommissioned often require group deletion. Confirm through internal inventory and change control.  
 54- Sandbox or dev accounts frequently create and delete groups; ensure the environment context is understood.
 55
 56### Response and remediation
 57
 58- **Containment**: If deletion was unauthorized, restrict the actor’s IAM privileges and block further configuration changes.  
 59- **Investigation and scoping**: Recover details of the deleted group (members, policies) from logs or AWS Config, and determine the impact of the deletion (which users lost membership, service account disruption).  
 60- **Recovery and hardening**: Recreate the group if necessary, restore intended policies and memberships, enforce change-control for group deletions, restrict `iam:DeleteGroup` privileges, and create alerts for destructive IAM operations.
 61
 62### Additional information
 63[AWS Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/)
 64"""
 65references = [
 66    "https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iam/delete-group.html",
 67    "https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteGroup.html",
 68]
 69risk_score = 21
 70rule_id = "867616ec-41e5-4edc-ada2-ab13ab45de8a"
 71severity = "low"
 72tags = [
 73    "Domain: Cloud",
 74    "Data Source: AWS",
 75    "Data Source: Amazon Web Services",
 76    "Data Source: AWS IAM",
 77    "Tactic: Impact",
 78    "Resources: Investigation Guide",
 79]
 80timestamp_override = "event.ingested"
 81type = "query"
 82
 83query = '''
 84event.dataset: aws.cloudtrail and 
 85    event.provider: iam.amazonaws.com and 
 86    event.action: DeleteGroup and 
 87    event.outcome: success
 88'''
 89
 90
 91[[rule.threat]]
 92framework = "MITRE ATT&CK"
 93[[rule.threat.technique]]
 94id = "T1531"
 95name = "Account Access Removal"
 96reference = "https://attack.mitre.org/techniques/T1531/"
 97
 98
 99[rule.threat.tactic]
100id = "TA0040"
101name = "Impact"
102reference = "https://attack.mitre.org/tactics/TA0040/"
103
104[rule.investigation_fields]
105field_names = [
106    "@timestamp",
107    "user.name",
108    "user_agent.original",
109    "source.ip",
110    "aws.cloudtrail.user_identity.arn",
111    "aws.cloudtrail.user_identity.type",
112    "aws.cloudtrail.user_identity.access_key_id",
113    "event.action",
114    "event.outcome",
115    "cloud.account.id",
116    "cloud.region",
117    "aws.cloudtrail.request_parameters",
118]

Triage and analysis

Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.

Investigating AWS IAM Group Deletion

Attackers sometimes remove groups to erase evidence, disrupt operations, or prevent users from receiving needed permissions (Impact). Deletion can also follow malicious cleanup after attaching policies and using the group briefly. This alert fires on DeleteGroup API call. Consider intentional disruption or covering tracks, particularly if the group was privileged or recently modified.

Possible investigation steps

  • Identify the actor and environment

    • Review aws.cloudtrail.user_identity.arn, aws.cloudtrail.user_identity.access_key_id.
    • Check source.ip, user_agent.original, cloud.account.id, cloud.region for atypical activity.
  • Determine what was lost

    • From aws.cloudtrail.request_parameters, capture groupName.
    • Use history or logs to identify existing members and attached policies prior to deletion (ex: GetGroup, ListAttachedGroupPolicies).
    • Determine if the group contained privileged roles/policies that could have been weaponized.
  • Correlate with related activity

    • Look in the prior 1–24h for DetachGroupPolicy, RemoveUserFromGroup, DeleteGroupPolicy, which often precede deletion in adversary cleanup workflows.
    • After deletion, monitor for creation of new similarly-named groups, or re-attachment of policies to other groups/roles.

False positive analysis

  • Projects & services that are being decommissioned often require group deletion. Confirm through internal inventory and change control.
  • Sandbox or dev accounts frequently create and delete groups; ensure the environment context is understood.

Response and remediation

  • Containment: If deletion was unauthorized, restrict the actor’s IAM privileges and block further configuration changes.
  • Investigation and scoping: Recover details of the deleted group (members, policies) from logs or AWS Config, and determine the impact of the deletion (which users lost membership, service account disruption).
  • Recovery and hardening: Recreate the group if necessary, restore intended policies and memberships, enforce change-control for group deletions, restrict iam:DeleteGroup privileges, and create alerts for destructive IAM operations.

Additional information

AWS Security Best Practices

References

Related rules

to-top