Detection rules › Panther

S3 Bucket Deleted

Severity
informational
Group by
userIdentity.arn
Compliance
Stratus Red Team aws.defense-evasion.cloudtrail-lifecycle-rule, aws.exfiltration.s3-backdoor-bucket-policy
Log types
AWS.CloudTrail
Tags
AWS, Impact:Data Destruction
Reference
https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjects.html
Source
github.com/panther-labs/panther-analysis

A S3 Bucket, Policy, or Website was deleted

MITRE ATT&CK coverage

TacticTechniques
ImpactT1485 Data Destruction

Rule body yaml

AnalysisType: rule
Filename: aws_s3_bucket_deleted.py
RuleID: "AWS.S3.BucketDeleted"
DisplayName: "S3 Bucket Deleted"
Enabled: true
LogTypes:
  - AWS.CloudTrail
Tags:
  - AWS
  - Impact:Data Destruction
Reports:
  MITRE ATT&CK:
    - TA0040:T1485

  Stratus Red Team:
    - aws.defense-evasion.cloudtrail-lifecycle-rule
    - aws.exfiltration.s3-backdoor-bucket-policy
Severity: Info
Description: A S3 Bucket, Policy, or Website was deleted
Runbook: Explore if this bucket deletion was potentially destructive
Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjects.html
SummaryAttributes:
  - sourceIpAddress
  - userAgent
  - recipientAccountId
  - vpcEndpointId
Tests:
  - Name: An S3 Bucket was deleted
    ExpectedResult: true
    Log:
      {
        "eventVersion": "1.05",
        "errorCode": "",
        "userIdentity":
          {
            "type": "AssumedRole",
            "principalId": "AAAAAAAAAAAAAAAAAAAAA:user_name",
            "arn": "arn:aws:sts::123456789012:assumed-role/BucketAdministrator/user_name",
            "accountId": "123456789012",
            "accessKeyId": "AAAAAAAAAAAAAAAAAAAAA",
            "sessionContext":
              {
                "attributes":
                  {
                    "mfaAuthenticated": "true",
                    "creationDate": "2020-02-14T00:11:28Z",
                  },
                "sessionIssuer":
                  {
                    "type": "Role",
                    "principalId": "AAAAAAAAAAAAAAAAAAAAA",
                    "arn": "arn:aws:iam::123456789012:role/BucketAdministrator",
                    "accountId": "123456789012",
                    "userName": "BucketAdministrator",
                  },
              },
          },
        "eventTime": "2020-02-14T00:43:54Z",
        "eventSource": "s3.amazonaws.com",
        "eventName": "DeleteBucket",
        "awsRegion": "us-east-2",
        "sourceIPAddress": "157.130.196.214",
        "userAgent": "[S3Console/0.4, aws-internal/3 aws-sdk-java/1.11.666 Linux/4.9.184-0.1.ac.235.83.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.232-b09 java/1.8.0_232 vendor/Oracle_Corporation]",
        "requestParameters":
          { "host": ["s3-us-east-2.amazonaws.com"], "bucketName": "secrets" },
        "responseElements": null,
        "additionalEventData":
          {
            "SignatureVersion": "SigV4",
            "CipherSuite": "ECDHE-RSA-AES128-SHA",
            "AuthenticationMethod": "AuthHeader",
            "vpcEndpointId": "vpce-aaa333c9",
          },
        "requestID": "EEEE5AAAAAA44444",
        "eventID": "6795ef5c-7777-4444-8888-cabb7f252bd3",
        "eventType": "AwsApiCall",
        "recipientAccountId": "123456789012",
        "vpcEndpointId": "vpce-aaa333c9",
      }
  - Name: S3 Bucket Deletion Failed
    ExpectedResult: false
    Log:
      {
        "eventName": "DeleteBucket",
        "errorCode": "BucketNotEmpty",
        "errorMessage": "The bucket you tried to delete is not empty",
        "awsRegion": "us-east-2",
        "sourceIPAddress": "157.130.196.214",
        "userAgent": "[S3Console/0.4, aws-internal/3 aws-sdk-java/1.11.666 Linux/4.9.184-0.1.ac.235.83.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.232-b09 java/1.8.0_232 vendor/Oracle_Corporation]",
        "responseElements": null,
        "requestID": "EEEE5AAAAAA44444",
        "userIdentity": {},
        "eventID": "6795ef5c-7777-4444-8888-cabb7f252bd3",
        "eventType": "AwsApiCall",
        "recipientAccountId": "123456789012",
        "vpcEndpointId": "vpce-aaa333c9",
      }
  - Name: An S3 Object Deleted
    ExpectedResult: false
    Log:
      {
        "eventName": "DeleteObject",
        "awsRegion": "us-east-2",
        "sourceIPAddress": "157.130.196.214",
        "userAgent": "[S3Console/0.4, aws-internal/3 aws-sdk-java/1.11.666 Linux/4.9.184-0.1.ac.235.83.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.232-b09 java/1.8.0_232 vendor/Oracle_Corporation]",
        "responseElements": null,
        "requestID": "EEEE5AAAAAA44444",
        "eventID": "6795ef5c-7777-4444-8888-cabb7f252bd3",
        "userIdentity": {},
        "eventType": "AwsApiCall",
        "recipientAccountId": "123456789012",
        "vpcEndpointId": "vpce-aaa333c9",
      }

Detection logic

Condition

eventName starts_with "DeleteBucket"
not (errorCode is_not_null or errorMessage is_not_null)

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
errorCodeis_not_null(no value, null check)
errorMessageis_not_null(no value, null check)

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
eventNamestarts_with
  • DeleteBucket

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
eventName
eventSource
awsRegion
recipientAccountId
sourceIPAddress
userAgent
userIdentity
typeuserIdentity.type