HIGH AWS Config Defense Evasion / Security Control Tampering LTR-0020 ✓ validated

Detect CloudTrail Deletion and All-Traffic Security Groups in AWS Config History

Published · Updated

MITRE ATT&CK: T1562.007T1562.008

Sigma Rule

title: AWS Config CloudTrail Deletion or All-Traffic Security Group
id: 9ac4798c-466d-4f98-a64b-a3561f6eb903
status: experimental
description: >
  Detects two ways of removing a cloud control, as recorded in AWS Config
  configuration items: a CloudTrail trail deleted (the audit log itself), and a
  security group that allows all protocols (ipProtocol -1) from 0.0.0.0/0, which
  removes network containment entirely.
references:
  - https://attack.mitre.org/techniques/T1562/007/
  - https://attack.mitre.org/techniques/T1562/008/
author: LogTriage
date: 2026/10/06
modified: 2026/10/20
logsource:
  product: aws
  service: config
detection:
  cloudtrail_deleted:
    resourceType: 'AWS::CloudTrail::Trail'
    configurationItemStatus: 'ResourceDeleted'
  security_group_open_to_all:
    resourceType: 'AWS::EC2::SecurityGroup'
    ipProtocol: '-1'
    cidrIp: '0.0.0.0/0'
  condition: cloudtrail_deleted or security_group_open_to_all
falsepositives:
  - Planned CloudTrail consolidation into an organization trail
  - Lab or sandbox accounts that tolerate all-traffic security groups
level: high
tags:
  - attack.defense_evasion
  - attack.t1562.007
  - attack.t1562.008
How the rule decides

1 · Each event is compared with 2 selections. Every field in a selection must match; listed values are alternatives.

cloudtrail_deleted
  • resourceType is AWS::CloudTrail::Trail
  • and configurationItemStatus is ResourceDeleted
security_group_open_to_all
  • resourceType is AWS::EC2::SecurityGroup
  • and ipProtocol is -1
  • and cidrIp is 0.0.0.0/0

2 · An event counts when

cloudtrail_deletedorsecurity_group_open_to_all

Alert high Checked on every deploy: fires on aws_config_changes.json, silent on aws_config_normal.json — both in the public sample dataset ↗︎

What this rule detects

AWS Config records the state of each resource after every change, which makes it a strong second source for one specific category of events: someone tearing down the controls that would catch them. This rule fires on either of two signals:

  1. A CloudTrail trail deleted: AWS::CloudTrail::Trail with configurationItemStatus: ResourceDeleted.
  2. A security group opened to everything: AWS::EC2::SecurityGroup whose configuration carries an ingress rule with ipProtocol: -1 (all protocols) from cidrIp: 0.0.0.0/0.

Both are tampering with a cloud control (MITRE T1562), and both are rare enough outside planned changes that a single occurrence justifies an alert.

Detection logic

Two selections, either of which fires the rule:

  • cloudtrail_deleted requires the resource type and the ResourceDeleted status, so a trail that was only reconfigured does not fire it.
  • security_group_open_to_all requires the security group type, the all-protocols value -1 and the CIDR 0.0.0.0/0 in the same configuration item. Field paths depend on how your SIEM flattens the configuration; in the raw item they sit under configuration.ipPermissions.

There is no count threshold.

Validated against a real sample

Validated against aws_config_changes.json (shipped with LogTriage), three configuration items in the same account:

  • AWS::IAM::Policy SecurityPolicy, ResourceDeleted (context only; it does not fire this rule)
  • AWS::EC2::SecurityGroup sg-0abc123def456789 (“Production security group”), status OK, with an ingress rule of ipProtocol: -1 from cidrIp: 0.0.0.0/0
  • AWS::CloudTrail::Trail, ResourceDeleted

The rule fires on the security group and the trail. It stays silent on the matching benign log, whose only configuration items are a running EC2 instance (OK) and a newly discovered S3 bucket with public access blocked.

False positives

The legitimate version of each signal is traceable to a change: a regional trail retired while an organization-wide trail stays active, or a sandbox account where all-traffic security groups are tolerated. Correlate the actor and timing with your change records, and scope the security group selection to production accounts if sandboxes are noisy.

Frequently Asked Questions

Why only all-protocol rules, and not any security group opened to 0.0.0.0/0?
Because many security groups are legitimately open to the internet on one port, such as a public load balancer's HTTPS listener, and alerting on all of them buries the one that matters. An ingress rule with `ipProtocol: -1` from `0.0.0.0/0` allows every protocol and port from every address. Almost nothing needs that, and it removes network containment entirely.
Why use AWS Config for this instead of CloudTrail?
Because one of the two signals is CloudTrail itself. CloudTrail records the API call (DeleteTrail, AuthorizeSecurityGroupIngress) the moment it happens, which is faster, but it only helps if the trail still exists. AWS Config is a separate, resource-centric record of the resulting state, so it still shows the trail's deletion after the trail is gone. Running the rule on Config history gives you a second source that does not depend on the control under attack.
What do the configuration item statuses mean?
AWS Config records a configuration item with a `configurationItemStatus` of `OK` when a resource is created or changed, `ResourceDiscovered` the first time Config sees it, `ResourceDeleted` when it is deleted, and `ResourceNotRecorded` or `ResourceDeletedNotRecorded` for resource types it is not recording. A deleted trail therefore appears as `AWS::CloudTrail::Trail` with `ResourceDeleted`; an opened security group appears as an `OK` item whose configuration carries the new ingress rule.
Why was IAM policy deletion removed from this rule?
An earlier version also fired on deleted IAM policies, reasoning that roles silently lose a restriction when their policy is deleted. That does not hold: AWS requires a managed policy to be detached from every user, group and role before it can be deleted, so the detachments show up first. Policy deletions are routine cleanup far more often than tampering, so they no longer fire this rule.

Related Resources

Reference

See this detection run on a real report

Try the live demo with a pre-loaded malicious log set — no signup required — or upload your own log file and get a full AI-reviewed threat report in minutes.