diff --git a/rules/integrations/aws/impact_s3_static_site_js_file_uploaded.toml b/rules/integrations/aws/impact_s3_static_site_js_file_uploaded.toml index d9266c64427..c54d42b1ba9 100644 --- a/rules/integrations/aws/impact_s3_static_site_js_file_uploaded.toml +++ b/rules/integrations/aws/impact_s3_static_site_js_file_uploaded.toml @@ -2,12 +2,12 @@ creation_date = "2025/04/15" integration = ["aws"] maturity = "production" -updated_date = "2025/09/25" +updated_date = "2025/10/28" [rule] author = ["Elastic"] description = """ -This rule detects when a JavaScript file is uploaded or accessed in an S3 static site directory (`static/js/`) by an IAM +This rule detects when a JavaScript file is uploaded in an S3 static site directory (`static/js/`) by an IAM user or assumed role. This can indicate suspicious modification of web content hosted on S3, such as injecting malicious scripts into a static website frontend. """ @@ -17,7 +17,7 @@ false_positives = [ Verify the user agent, source IP, and whether the modification was expected. """, ] -from = "now-9m" +from = "now-6m" language = "esql" license = "Elastic License v2" name = "AWS S3 Static Site JavaScript File Uploaded" @@ -73,10 +73,11 @@ query = ''' from logs-aws.cloudtrail* metadata _id, _version, _index | where - // S3 object read/write activity + // S3 object write activity event.dataset == "aws.cloudtrail" and event.provider == "s3.amazonaws.com" - and event.action in ("GetObject", "PutObject") + and event.action == "PutObject" + and event.outcome == "success" // IAM users or assumed roles only and aws.cloudtrail.user_identity.type in ("IAMUser", "AssumedRole") @@ -88,7 +89,7 @@ from logs-aws.cloudtrail* metadata _id, _version, _index and not ( user_agent.original like "*Terraform*" or user_agent.original like "*Ansible*" - or user_agent.original like "*Pulumni*" + or user_agent.original like "*Pulumi*" ) // Extract fields from request parameters @@ -127,10 +128,27 @@ id = "T1565.001" name = "Stored Data Manipulation" reference = "https://attack.mitre.org/techniques/T1565/001/" - - [rule.threat.tactic] id = "TA0040" name = "Impact" reference = "https://attack.mitre.org/tactics/TA0040/" +[rule.investigation_fields] +field_names = [ + "@timestamp", + "user.name", + "user_agent.original", + "source.ip", + "aws.cloudtrail.user_identity.arn", + "aws.cloudtrail.user_identity.type", + "aws.cloudtrail.user_identity.access_key_id", + "aws.cloudtrail.resources.arn", + "aws.cloudtrail.resources.type", + "event.action", + "event.outcome", + "cloud.account.id", + "cloud.region", + "aws.cloudtrail.request_parameters", + "aws.cloudtrail.response_elements" +] +