AWS Batch Job Submitted with Container Override by Unusual Identity
Detects the first time an AWS identity submits an AWS Batch job with a container command override ("containerOverrides.command"), indicating a runtime-modified execution environment. Command overrides allow the submitter to replace the default command of a job definition at submission time. This flexibility is commonly abused by adversaries to inject malicious commands or exfiltration logic into otherwise legitimate Batch compute environments without modifying the underlying job definition — making the malicious activity harder to detect through configuration review alone.
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 submits an AWS Batch job with a container command override ("containerOverrides.command"),
11indicating a runtime-modified execution environment. Command overrides allow the submitter to
12replace the default command of a job definition at submission time. This flexibility is commonly abused by adversaries
13to inject malicious commands or exfiltration logic into otherwise legitimate Batch compute environments without modifying
14the underlying job definition — making the malicious activity harder to detect through
15configuration review alone.
16"""
17false_positives = [
18 """
19 Development teams and data pipelines may legitimately use container overrides to parameterize
20 job executions with dynamic inputs. Validate that the submitting identity, job queue, and
21 override content are consistent with expected workload behavior.
22 """,
23]
24from = "now-6m"
25index = ["logs-aws.cloudtrail-*"]
26language = "kuery"
27license = "Elastic License v2"
28name = "AWS Batch Job Submitted with Container Override by Unusual Identity"
29note = """## Triage and analysis
30
31### Investigating AWS Batch Job Submitted with Container Override by Unusual Identity
32
33This rule fires when an identity submits a Batch job with a container command override and has not been observed doing so in the prior 7 days. Container overrides at submission time bypass job definition review — an adversary can inject a malicious command into an approved job definition without modifying it, making the change invisible to IaC drift detection or configuration compliance tools.
34
35### Possible investigation steps
36
37- Identify the submitting principal (`aws.cloudtrail.user_identity.arn`) and determine whether they are expected to use AWS Batch with runtime overrides.
38- Review `aws.cloudtrail.request_parameters` to extract the overridden command in `containerOverrides.command` - this is the trigger. Also inspect any environment variables or resource requirements present. Look for shell commands, curl/wget calls, base64-encoded payloads, or references to external endpoints in the command override.
39- Identify the job queue and job definition used to understand the compute environment and IAM role the job will execute under.
40- Search for `DescribeJobs` events after the submission to track execution status and output.
41- Correlate with S3 `GetObject` or `PutObject` events from the Batch execution role during the job's execution window to identify data access or exfiltration.
42
43### False positive analysis
44
45- ETL and data processing pipelines that parameterize job commands at submission time.
46- CI/CD systems that submit test jobs with dynamic parameters.
47
48### Response and remediation
49
50- If unauthorized, cancel the job immediately using `TerminateJob`.
51- Review the Batch compute environment's IAM execution role for the scope of data access the job had.
52- Restrict `batch:SubmitJob` with `Condition` keys on `batch:Image` and job queue ARNs to prevent arbitrary container override submissions.
53"""
54references = [
55 "https://docs.aws.amazon.com/batch/latest/APIReference/API_SubmitJob.html",
56 "https://docs.aws.amazon.com/batch/latest/APIReference/API_ContainerOverrides.html",
57]
58risk_score = 47
59rule_id = "2b7d9e61-4c83-4f1a-9e52-0b8a3d7c6f29"
60setup = "The AWS CloudTrail integration must be enabled and configured to collect Batch management events (`batch.amazonaws.com`)."
61severity = "medium"
62tags = [
63 "Domain: Cloud",
64 "Data Source: AWS",
65 "Data Source: Amazon Web Services",
66 "Data Source: AWS Batch",
67 "Use Case: Threat Detection",
68 "Tactic: Execution",
69 "Resources: Investigation Guide",
70]
71timestamp_override = "event.ingested"
72type = "new_terms"
73
74query = '''
75data_stream.dataset: "aws.cloudtrail"
76 and event.provider: "batch.amazonaws.com"
77 and event.action: "SubmitJob"
78 and event.outcome: "success"
79 and aws.cloudtrail.request_parameters: (*containerOverrides* and *command*)
80'''
81
82[[rule.threat]]
83framework = "MITRE ATT&CK"
84
85[[rule.threat.technique]]
86id = "T1059"
87name = "Command and Scripting Interpreter"
88reference = "https://attack.mitre.org/techniques/T1059/"
89
90[rule.threat.tactic]
91id = "TA0002"
92name = "Execution"
93reference = "https://attack.mitre.org/tactics/TA0002/"
94
95[rule.new_terms]
96field = "new_terms_fields"
97value = ["aws.cloudtrail.user_identity.arn"]
98[[rule.new_terms.history_window_start]]
99field = "history_window_start"
100value = "now-7d"
101
102[rule.investigation_fields]
103field_names = [
104 "@timestamp",
105 "aws.cloudtrail.user_identity.arn",
106 "aws.cloudtrail.user_identity.type",
107 "event.action",
108 "event.outcome",
109 "aws.cloudtrail.request_parameters",
110 "source.ip",
111 "cloud.region",
112 "cloud.account.id",
113]
Triage and analysis
Investigating AWS Batch Job Submitted with Container Override by Unusual Identity
This rule fires when an identity submits a Batch job with a container command override and has not been observed doing so in the prior 7 days. Container overrides at submission time bypass job definition review — an adversary can inject a malicious command into an approved job definition without modifying it, making the change invisible to IaC drift detection or configuration compliance tools.
Possible investigation steps
- Identify the submitting principal (
aws.cloudtrail.user_identity.arn) and determine whether they are expected to use AWS Batch with runtime overrides. - Review
aws.cloudtrail.request_parametersto extract the overridden command incontainerOverrides.command- this is the trigger. Also inspect any environment variables or resource requirements present. Look for shell commands, curl/wget calls, base64-encoded payloads, or references to external endpoints in the command override. - Identify the job queue and job definition used to understand the compute environment and IAM role the job will execute under.
- Search for
DescribeJobsevents after the submission to track execution status and output. - Correlate with S3
GetObjectorPutObjectevents from the Batch execution role during the job's execution window to identify data access or exfiltration.
False positive analysis
- ETL and data processing pipelines that parameterize job commands at submission time.
- CI/CD systems that submit test jobs with dynamic parameters.
Response and remediation
- If unauthorized, cancel the job immediately using
TerminateJob. - Review the Batch compute environment's IAM execution role for the scope of data access the job had.
- Restrict
batch:SubmitJobwithConditionkeys onbatch:Imageand job queue ARNs to prevent arbitrary container override submissions.
References
Related rules
- AWS CloudShell Environment Created
- AWS SSM Command Document Created by Rare User
- AWS SageMaker Notebook Lifecycle Configuration With Suspicious Script Content
- AWS Lambda Function Invoked Cross-Account
- AWS Lambda Function Invoked from an Unusual Source ASN