Skip to content

Commit bd132c3

Browse files
[Detection Rules] Adding Documents for v8.18.9 Pre-Built Detection Rules (#6948)
1 parent 2c9b666 commit bd132c3

File tree

94 files changed

+8336
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+8336
-250
lines changed
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
[[prebuilt-rule-8-18-9-aws-dynamodb-table-exported-to-s3]]
2+
=== AWS DynamoDB Table Exported to S3
3+
4+
Identifies when an AWS DynamoDB table is exported to S3. Adversaries may use the ExportTableToPointInTime operation to collect sensitive information or exfiltrate data from DynamoDB tables. This rule detects unusual user activity by monitoring for the ExportTableToPointInTime action in CloudTrail logs. This is a New Terms rule that only flags when this behavior is observed by the "user.name" for the first time.
5+
6+
*Rule type*: new_terms
7+
8+
*Rule indices*:
9+
10+
* filebeat-*
11+
* logs-aws.cloudtrail-*
12+
13+
*Severity*: low
14+
15+
*Risk score*: 21
16+
17+
*Runs every*: 5m
18+
19+
*Searches indices from*: now-6m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
20+
21+
*Maximum alerts per execution*: 100
22+
23+
*References*:
24+
25+
* https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExportTableToPointInTime.html
26+
27+
*Tags*:
28+
29+
* Domain: Cloud
30+
* Data Source: AWS
31+
* Data Source: Amazon Web Services
32+
* Data Source: AWS DynamoDB
33+
* Resources: Investigation Guide
34+
* Use Case: Threat Detection
35+
* Tactic: Exfiltration
36+
37+
*Version*: 4
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
## Triage and analysis
50+
51+
52+
*Investigating AWS DynamoDB Table Exported to S3*
53+
54+
55+
This rule identifies when an AWS DynamoDB table is exported to S3. Adversaries may use the ExportTableToPointInTime operation to collect sensitive information or exfiltrate data from DynamoDB tables. This rule detects unusual user activity by monitoring for the ExportTableToPointInTime action in CloudTrail logs.
56+
57+
This is a New Terms rule that only flags when this behavior is observed for the first time.
58+
59+
60+
*Possible Investigation Steps*
61+
62+
- Identify the Actor: Review the `aws.cloudtrail.user_identity.arn` field to identify the user who requested the export. Verify if this actor typically performs such actions and has the necessary permissions. It may be unusual for this activity to originate from certain user types, such as an assumed role or federated user.
63+
- Review the Source IP: Check the `source.ip` field to determine the source of the request. If the request comes from an unexpected location or IP address, it may indicate a compromised account or unauthorized access.
64+
- Review Access Key: Check the `aws.cloudtrail.user_identity.access_key_id` field to identify the access key used for the request. Determine if this key has been compromised.
65+
- Analyze the Request Parameters: Examine the `aws.cloudtrail.request_parameters` field to understand the details of the ExportTableToPointInTime request. Look for any unusual parameters or patterns that may indicate malicious intent. This also details the DynamoDB table being exported.
66+
67+
68+
*False Positive Analysis*
69+
70+
- Historical User Actions: If the user has a history of exporting DynamoDB tables for legitimate purposes, this may be a false positive. Review the user's activity logs to determine if this behavior is consistent with their normal actions.
71+
- Automated Processes: Some automated processes or applications may perform exports on DynamoDB tables as part of their functionality. If the user is associated with such a process, this may be a false positive.
72+
73+
74+
*Response and Remediation*
75+
76+
- Immediate Review and Reversal: If the ExportTableToPointInTime action is determined to be unauthorized, immediately revoke the user's access to the DynamoDB table and any associated resources. This may involve disabling the user's access keys or removing their permissions.
77+
- Investigate Compromise: If the ExportTableToPointInTime action is determined to be malicious, investigate the source and destination of the request and any potential compromise of the user's account. If the destination S3 bucket is not known, it may be a sign of data exfiltration and may require incident response.
78+
- Review IAM Policies: Review the IAM policies associated with the user to ensure that they have the appropriate permissions for their role. If necessary, update the policies to restrict access to sensitive resources.
79+
- Monitor for Future Activity: Continue to monitor the user's activity for any further suspicious behavior. Set up additional alerts or logging to detect any future unauthorized access attempts.
80+
81+
82+
*Additional Information*
83+
84+
85+
For further guidance on managing and securing DynamoDB in AWS environments, refer to the https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/security.html[AWS DynamoDB documentation] and AWS best practices for security.
86+
87+
88+
==== Setup
89+
90+
91+
DynamoDB data events must be enabled in CloudTrail to capture the ExportTableToPointInTime actions. Ensure that the AWS CloudTrail service is configured to log data events for DynamoDB tables.
92+
93+
==== Rule query
94+
95+
96+
[source, js]
97+
----------------------------------
98+
event.dataset: "aws.cloudtrail"
99+
and event.provider: "dynamodb.amazonaws.com"
100+
and event.action: "ExportTableToPointInTime"
101+
and event.outcome: "success"
102+
103+
----------------------------------
104+
105+
*Framework*: MITRE ATT&CK^TM^
106+
107+
* Tactic:
108+
** Name: Exfiltration
109+
** ID: TA0010
110+
** Reference URL: https://attack.mitre.org/tactics/TA0010/
111+
* Technique:
112+
** Name: Exfiltration Over Web Service
113+
** ID: T1567
114+
** Reference URL: https://attack.mitre.org/techniques/T1567/
115+
* Sub-technique:
116+
** Name: Exfiltration to Cloud Storage
117+
** ID: T1567.002
118+
** Reference URL: https://attack.mitre.org/techniques/T1567/002/
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
[[prebuilt-rule-8-18-9-aws-ec2-ami-shared-with-another-account]]
2+
=== AWS EC2 AMI Shared with Another Account
3+
4+
Identifies an AWS Amazon Machine Image (AMI) being shared with another AWS account. Adversaries with access may share an AMI with an external AWS account as a means of data exfiltration. AMIs can contain secrets, bash histories, code artifacts, and other sensitive data that adversaries may abuse if shared with unauthorized accounts. AMIs can be made publicly available accidentally as well.
5+
6+
*Rule type*: query
7+
8+
*Rule indices*:
9+
10+
* filebeat-*
11+
* logs-aws.cloudtrail-*
12+
13+
*Severity*: medium
14+
15+
*Risk score*: 47
16+
17+
*Runs every*: 5m
18+
19+
*Searches indices from*: now-6m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
20+
21+
*Maximum alerts per execution*: 100
22+
23+
*References*:
24+
25+
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html
26+
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-explicit.html
27+
* https://stratus-red-team.cloud/attack-techniques/AWS/aws.exfiltration.ec2-share-ami/
28+
29+
*Tags*:
30+
31+
* Domain: Cloud
32+
* Data Source: AWS
33+
* Data Source: Amazon Web Services
34+
* Data Source: AWS EC2
35+
* Use Case: Threat Detection
36+
* Tactic: Exfiltration
37+
* Resources: Investigation Guide
38+
39+
*Version*: 6
40+
41+
*Rule authors*:
42+
43+
* Elastic
44+
45+
*Rule license*: Elastic License v2
46+
47+
48+
==== Investigation guide
49+
50+
51+
52+
*Triage and analysis*
53+
54+
55+
56+
*Investigating AWS EC2 AMI Shared with Another Account*
57+
58+
59+
This rule identifies when an Amazon Machine Image (AMI) is shared with another AWS account. While sharing AMIs is a common practice, adversaries may exploit this feature to exfiltrate data by sharing AMIs with external accounts under their control.
60+
61+
62+
*Possible Investigation Steps*
63+
64+
65+
- **Review the Sharing Event**: Identify the AMI involved and review the event details in AWS CloudTrail. Look for `ModifyImageAttribute` actions where the AMI attributes were changed to include additional user accounts.
66+
- **Request and Response Parameters**: Check the `aws.cloudtrail.request_parameters` and `aws.response.response_elements` fields in the CloudTrail event to identify the AMI ID and the user ID of the account with which the AMI was shared.
67+
- **Verify the Shared AMI**: Check the AMI that was shared and its contents to determine the sensitivity of the data stored within it.
68+
- **Contextualize with Recent Changes**: Compare this sharing event against recent changes in AMI configurations and deployments. Look for any other recent permissions changes or unusual administrative actions.
69+
- **Validate External Account**: Examine the AWS account to which the AMI was shared. Determine whether this account is known and previously authorized to access such resources.
70+
- **Interview Relevant Personnel**: If the share was initiated by a user, verify the intent and authorization for this action with the person or team responsible for managing AMI deployments.
71+
- **Audit Related Security Policies**: Check the security policies governing AMI sharing within your organization to ensure they are being followed and are adequate to prevent unauthorized sharing.
72+
73+
74+
*False Positive Analysis*
75+
76+
77+
- **Legitimate Sharing Practices**: AMI sharing is a common and legitimate practice for collaboration and resource management in AWS. Always verify that the sharing activity was unauthorized before escalating.
78+
- **Automation Tools**: Some organizations use automation tools for AMI management which might programmatically share AMIs. Verify if such tools are in operation and whether their actions are responsible for the observed behavior.
79+
- **AWS Services**: Some AWS services, such as WorkSpaces and Backup, automate AMI sharing when users configure cross-account sharing or disaster recovery plans. These will appear in CloudTrail with `userIdentity.invokedBy` and `source.address` fields like `workspaces.amazonaws.com` or `backup.amazonaws.com`. Confirm that such activity aligns with your organization's approved configurations.
80+
81+
82+
*Response and Remediation*
83+
84+
85+
- **Review and Revoke Unauthorized Shares**: If the share is found to be unauthorized, immediately revoke the shared permissions from the AMI.
86+
- **Enhance Monitoring of Shared AMIs**: Implement monitoring to track changes to shared AMIs and alert on unauthorized access patterns.
87+
- **Incident Response**: If malicious intent is confirmed, consider it a data breach incident and initiate the incident response protocol. This includes further investigation, containment, and recovery.
88+
- **Policy Update**: Review and possibly update your organization’s policies on AMI sharing to tighten control and prevent unauthorized access.
89+
- **Educate Users**: Conduct training sessions for users involved in managing AMIs to reinforce best practices and organizational policies regarding AMI sharing.
90+
91+
92+
*Additional Information*
93+
94+
95+
For more information on managing and sharing AMIs, refer to the https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html[Amazon EC2 User Guide on AMIs] and https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-explicit.html[Sharing AMIs]. Additionally, explore adversarial techniques related to data exfiltration via AMI sharing as documented by Stratus Red Team https://stratus-red-team.cloud/attack-techniques/AWS/aws.exfiltration.ec2-share-ami/[here].
96+
97+
98+
99+
==== Rule query
100+
101+
102+
[source, js]
103+
----------------------------------
104+
event.dataset: "aws.cloudtrail" and event.provider: "ec2.amazonaws.com"
105+
and event.action: ModifyImageAttribute and event.outcome: success
106+
and aws.cloudtrail.request_parameters: *add=*
107+
and not aws.cloudtrail.user_identity.invoked_by: "assets.marketplace.amazonaws.com"
108+
109+
----------------------------------
110+
111+
*Framework*: MITRE ATT&CK^TM^
112+
113+
* Tactic:
114+
** Name: Exfiltration
115+
** ID: TA0010
116+
** Reference URL: https://attack.mitre.org/tactics/TA0010/
117+
* Technique:
118+
** Name: Transfer Data to Cloud Account
119+
** ID: T1537
120+
** Reference URL: https://attack.mitre.org/techniques/T1537/
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
[[prebuilt-rule-8-18-9-aws-ec2-deprecated-ami-discovery]]
2+
=== AWS EC2 Deprecated AMI Discovery
3+
4+
Identifies when a user has queried for deprecated Amazon Machine Images (AMIs) in AWS. This may indicate an adversary looking for outdated AMIs that may be vulnerable to exploitation. While deprecated AMIs are not inherently malicious or indicative of a breach, they may be more susceptible to vulnerabilities and should be investigated for potential security risks.
5+
6+
*Rule type*: query
7+
8+
*Rule indices*:
9+
10+
* filebeat-*
11+
* logs-aws.cloudtrail-*
12+
13+
*Severity*: low
14+
15+
*Risk score*: 21
16+
17+
*Runs every*: 5m
18+
19+
*Searches indices from*: now-6m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
20+
21+
*Maximum alerts per execution*: 100
22+
23+
*References*:
24+
25+
* https://hackingthe.cloud/aws/exploitation/Misconfigured_Resource-Based_Policies/exploting_public_resources_attack_playbook/
26+
27+
*Tags*:
28+
29+
* Domain: Cloud
30+
* Data Source: AWS
31+
* Data Source: AWS EC2
32+
* Resources: Investigation Guide
33+
* Use Case: Threat Detection
34+
* Tactic: Discovery
35+
36+
*Version*: 6
37+
38+
*Rule authors*:
39+
40+
* Elastic
41+
42+
*Rule license*: Elastic License v2
43+
44+
45+
==== Investigation guide
46+
47+
48+
49+
*Triage and analysis*
50+
51+
52+
53+
*Investigating AWS EC2 Deprecated AMI Discovery*
54+
55+
56+
This rule detects when a user queries AWS for deprecated Amazon Machine Images (AMIs). While deprecated AMIs are not inherently malicious, their use can introduce vulnerabilities or misconfigurations. Adversaries may exploit deprecated AMIs in search of outdated or unpatched systems. Investigating these queries can help identify potential risks or misconfigurations.
57+
58+
59+
*Possible Investigation Steps*
60+
61+
62+
1. **Identify the User Performing the Query**:
63+
- Review the `aws.cloudtrail.user_identity.arn` field to determine the AWS user or role making the request.
64+
- Check `aws.cloudtrail.user_identity.type` and `aws.cloudtrail.user_identity.access_key_id` to verify the type of access (e.g., IAM user, role, or federated identity).
65+
66+
2. **Analyze the Source of the Request**:
67+
- Review the `source.ip` field to determine the IP address of the source making the request.
68+
- Check `source.geo` for the geographic location of the IP address.
69+
- Analyze the `user_agent.original` field to determine the client or tool used (e.g., AWS CLI, SDK).
70+
71+
3. **Validate the Query Context**:
72+
- Inspect the `aws.cloudtrail.request_parameters` field
73+
- Determine if the request is part of legitimate activity, such as:
74+
- Security assessments or vulnerability scans.
75+
- Maintenance or testing of legacy systems.
76+
- Check if the query aligns with recent changes in the AWS environment, such as new configurations or services.
77+
78+
4. **Correlate with Other Events**:
79+
- Investigate additional AWS API calls from the same user or IP address for signs of reconnaissance or exploitation.
80+
- Review logs for related actions, such as launching instances from deprecated AMIs (`RunInstances` API call).
81+
82+
5. **Assess Security Risks**:
83+
- Evaluate the use of deprecated AMIs within your environment and their associated vulnerabilities.
84+
- Ensure that deprecated AMIs are not being used in production environments or systems exposed to external threats.
85+
86+
87+
*False Positive Analysis*
88+
89+
90+
- **Legitimate Use**: Users may query for deprecated AMIs for testing or compatibility purposes.
91+
- **Automated Tools**: Security or compliance tools might query deprecated AMIs as part of regular assessments.
92+
- **Misconfigured Services**: Legacy systems may rely on deprecated AMIs for compatibility, leading to legitimate queries.
93+
94+
95+
*Response and Remediation*
96+
97+
98+
1. **Immediate Actions**:
99+
- Verify the intent of the user querying for deprecated AMIs.
100+
- Restrict IAM permissions to prevent unauthorized access to deprecated AMIs.
101+
102+
2. **Mitigation Steps**:
103+
- Identify and replace deprecated AMIs in use with supported and updated AMIs.
104+
- Update AWS IAM policies to minimize permissions for querying or using deprecated AMIs.
105+
106+
3. **Enhance Monitoring**:
107+
- Enable alerts for future queries involving deprecated AMIs or other unusual API activity.
108+
- Monitor CloudTrail logs for additional reconnaissance or suspicious behavior.
109+
110+
4. **Security Audits**:
111+
- Conduct a review of all AMIs in use across your environment to identify outdated or deprecated images.
112+
- Remove any deprecated AMIs from production environments and restrict their usage to isolated testing.
113+
114+
5. **Add Rule Exceptions**:
115+
- Create exceptions for legitimate use cases or automated tools that query for deprecated AMIs.
116+
- Document and communicate the exceptions to relevant teams to avoid future alerts.
117+
118+
119+
*Additional Resources*
120+
121+
122+
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html[AWS Documentation: AMI Lifecycle Management]
123+
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-deprecate.html[AWS Documentation: Deprecated AMIs]
124+
125+
126+
==== Rule query
127+
128+
129+
[source, js]
130+
----------------------------------
131+
event.dataset: "aws.cloudtrail"
132+
and event.provider: "ec2.amazonaws.com"
133+
and event.action: "DescribeImages"
134+
and event.outcome: "success"
135+
and aws.cloudtrail.flattened.request_parameters.includeDeprecated: "true"
136+
137+
----------------------------------
138+
139+
*Framework*: MITRE ATT&CK^TM^
140+
141+
* Tactic:
142+
** Name: Discovery
143+
** ID: TA0007
144+
** Reference URL: https://attack.mitre.org/tactics/TA0007/
145+
* Technique:
146+
** Name: Cloud Infrastructure Discovery
147+
** ID: T1580
148+
** Reference URL: https://attack.mitre.org/techniques/T1580/

0 commit comments

Comments
 (0)