Skip to content

Commit 5ef1ea9

Browse files
Update latest docs (#6794)
1 parent 92b04c1 commit 5ef1ea9

File tree

125 files changed

+7400
-255
lines changed

Some content is hidden

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

125 files changed

+7400
-255
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
[[prebuilt-rule-8-16-11-active-directory-group-modification-by-system]]
2+
=== Active Directory Group Modification by SYSTEM
3+
4+
Identifies a user being added to an active directory group by the SYSTEM (S-1-5-18) user. This behavior can indicate that the attacker has achieved SYSTEM privileges in a domain controller, which attackers can obtain by exploiting vulnerabilities or abusing default group privileges (e.g., Server Operators), and is attempting to pivot to a domain account.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-system.security*
11+
* logs-windows.forwarded*
12+
* winlogbeat-*
13+
14+
*Severity*: medium
15+
16+
*Risk score*: 47
17+
18+
*Runs every*: 5m
19+
20+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
21+
22+
*Maximum alerts per execution*: 100
23+
24+
*References*: None
25+
26+
*Tags*:
27+
28+
* Domain: Endpoint
29+
* OS: Windows
30+
* Use Case: Threat Detection
31+
* Tactic: Persistence
32+
* Use Case: Active Directory Monitoring
33+
* Data Source: Active Directory
34+
* Data Source: Windows Security Event Logs
35+
* Resources: Investigation Guide
36+
37+
*Version*: 107
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
50+
*Triage and analysis*
51+
52+
53+
> **Disclaimer**:
54+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
55+
56+
57+
*Investigating Active Directory Group Modification by SYSTEM*
58+
59+
60+
Active Directory (AD) is a critical component in Windows environments, managing user and group permissions. SYSTEM, a high-privilege account, can modify AD groups, which attackers exploit to gain unauthorized access. By monitoring specific event logs for SYSTEM-initiated group changes, the detection rule identifies potential privilege escalation, signaling an attacker may have compromised a domain controller.
61+
62+
63+
*Possible investigation steps*
64+
65+
66+
- Review the event log entry with event code 4728 to confirm the SYSTEM account (S-1-5-18) initiated the group modification.
67+
- Identify the specific Active Directory group that was modified and determine if it is a sensitive or high-privilege group.
68+
- Check for any recent changes or anomalies in the domain controller's security logs that might indicate SYSTEM privilege escalation.
69+
- Investigate the timeline of events leading up to the group modification to identify any suspicious activities or patterns.
70+
- Correlate this event with other security alerts or logs to assess if there is a broader attack pattern or campaign.
71+
- Verify if there are any known vulnerabilities or misconfigurations in the domain controller that could have been exploited to gain SYSTEM privileges.
72+
73+
74+
*False positive analysis*
75+
76+
77+
- Routine administrative tasks performed by automated scripts or scheduled tasks may trigger this rule. Review and document these tasks, then create exceptions for known benign scripts to prevent unnecessary alerts.
78+
- System maintenance activities, such as software updates or system reconfigurations, might involve legitimate group modifications by SYSTEM. Coordinate with IT teams to identify and whitelist these activities.
79+
- Certain security tools or monitoring solutions may perform group modifications as part of their normal operation. Verify these tools' actions and exclude them from triggering alerts if they are confirmed to be safe.
80+
- In environments with custom applications that require SYSTEM-level access for group management, ensure these applications are documented and their actions are excluded from detection to avoid false positives.
81+
- Regularly review and update the list of exceptions to ensure they remain relevant and do not inadvertently allow malicious activities to go undetected.
82+
83+
84+
*Response and remediation*
85+
86+
87+
- Immediately isolate the affected domain controller from the network to prevent further unauthorized access or lateral movement by the attacker.
88+
- Revoke any unauthorized group memberships added by the SYSTEM account to prevent privilege escalation and unauthorized access.
89+
- Conduct a thorough review of recent changes in Active Directory, focusing on group modifications and user account activities, to identify any other potential unauthorized changes.
90+
- Reset passwords for all accounts that were added to groups by the SYSTEM account to mitigate the risk of compromised credentials being used.
91+
- Apply security patches and updates to the domain controller to address any vulnerabilities that may have been exploited to gain SYSTEM privileges.
92+
- Monitor for any further suspicious activities or attempts to modify Active Directory groups, using enhanced logging and alerting mechanisms.
93+
- Escalate the incident to the security operations center (SOC) or incident response team for a comprehensive investigation and to determine the full scope of the breach.
94+
95+
==== Rule query
96+
97+
98+
[source, js]
99+
----------------------------------
100+
iam where host.os.type == "windows" and event.code == "4728" and
101+
winlog.event_data.SubjectUserSid : "S-1-5-18" and
102+
103+
/* DOMAIN_USERS and local groups */
104+
not group.id : "S-1-5-21-*-513"
105+
106+
----------------------------------
107+
108+
*Framework*: MITRE ATT&CK^TM^
109+
110+
* Tactic:
111+
** Name: Persistence
112+
** ID: TA0003
113+
** Reference URL: https://attack.mitre.org/tactics/TA0003/
114+
* Technique:
115+
** Name: Account Manipulation
116+
** ID: T1098
117+
** Reference URL: https://attack.mitre.org/techniques/T1098/
118+
* Tactic:
119+
** Name: Privilege Escalation
120+
** ID: TA0004
121+
** Reference URL: https://attack.mitre.org/tactics/TA0004/
122+
* Technique:
123+
** Name: Account Manipulation
124+
** ID: T1098
125+
** Reference URL: https://attack.mitre.org/techniques/T1098/
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
[[prebuilt-rule-8-16-11-aws-cli-with-kali-linux-fingerprint-identified]]
2+
=== AWS CLI with Kali Linux Fingerprint Identified
3+
4+
Identifies the usage of the AWS CLI with a user agent string containing `distrib#kali`, which suggests the request was made from a Kali Linux distribution. This may indicate offensive security tooling or unauthorized use of the AWS CLI from a potentially adversarial environment.
5+
6+
*Rule type*: query
7+
8+
*Rule indices*:
9+
10+
* logs-aws.cloudtrail-*
11+
12+
*Severity*: medium
13+
14+
*Risk score*: 47
15+
16+
*Runs every*: 5m
17+
18+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
19+
20+
*Maximum alerts per execution*: 100
21+
22+
*References*:
23+
24+
* https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html
25+
* https://www.sygnia.co/blog/sygnia-investigation-bybit-hack/
26+
27+
*Tags*:
28+
29+
* Domain: Cloud
30+
* Data Source: AWS
31+
* Data Source: Amazon Web Services
32+
* Data Source: AWS CloudTrail
33+
* Tactic: Initial Access
34+
* Use Case: Cloud Threat Detection
35+
* Resources: Investigation Guide
36+
37+
*Version*: 2
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
50+
*Triage and Analysis*
51+
52+
53+
54+
*Investigating AWS CLI with Kali Linux Fingerprint Identified*
55+
56+
57+
The `user_agent.original` field in AWS CloudTrail logs reveals the operating system and toolchain used to make API calls. The substring `distrib#kali` strongly implies the use of Kali Linux, a common OS used by offensive security professionals and adversaries.
58+
59+
60+
*Possible Investigation Steps*
61+
62+
63+
- Identify the User: Check `user.name`, `user.arn`, and `aws.cloudtrail.user_identity.*` to determine which IAM identity was used.
64+
- Review Access Pattern: Correlate API calls from this user agent with sensitive actions such as `PutObject`, `CreateUser`, `AttachUserPolicy`, etc.
65+
- Investigate Source IP: Examine whether the request originated from an expected network or a suspicious VPN or cloud provider address.
66+
- Check for Initial Access: Look for session tokens being issued (e.g., `GetSessionToken`) or reused (`AssumeRole`) prior to this event.
67+
68+
69+
*False Positive Analysis*
70+
71+
72+
- Rare but possible in security assessments or internal red teaming. Validate the action context (user, IP, time of day, etc).
73+
74+
75+
*Response and Remediation*
76+
77+
78+
- Revoke Credentials: If unauthorized, revoke keys or sessions immediately.
79+
- Harden IAM Policies: Restrict sensitive IAM privileges, especially if used by CI/CD or automation roles.
80+
- Alert on Repeat Usage: Add recurring monitoring for suspicious user agents including `kali`, `curl`, or known toolkits.
81+
82+
83+
==== Rule query
84+
85+
86+
[source, js]
87+
----------------------------------
88+
event.dataset: "aws.cloudtrail" and user_agent.original: (aws-cli*distrib#kali* or Boto3*distrib#kali*)
89+
90+
----------------------------------
91+
92+
*Framework*: MITRE ATT&CK^TM^
93+
94+
* Tactic:
95+
** Name: Initial Access
96+
** ID: TA0001
97+
** Reference URL: https://attack.mitre.org/tactics/TA0001/
98+
* Technique:
99+
** Name: Valid Accounts
100+
** ID: T1078
101+
** Reference URL: https://attack.mitre.org/techniques/T1078/
102+
* Sub-technique:
103+
** Name: Cloud Accounts
104+
** ID: T1078.004
105+
** Reference URL: https://attack.mitre.org/techniques/T1078/004/
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
[[prebuilt-rule-8-16-11-aws-credentials-searched-for-inside-a-container]]
2+
=== AWS Credentials Searched For Inside A Container
3+
4+
This rule detects the use of system search utilities like grep and find to search for AWS credentials inside a container. Unauthorized access to these sensitive files could lead to further compromise of the container environment or facilitate a container breakout to the underlying cloud environment.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* logs-endpoint.events.process*
11+
12+
*Severity*: medium
13+
14+
*Risk score*: 47
15+
16+
*Runs every*: 5m
17+
18+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
19+
20+
*Maximum alerts per execution*: 100
21+
22+
*References*:
23+
24+
* https://sysdig.com/blog/threat-detection-aws-cloud-containers/
25+
26+
*Tags*:
27+
28+
* Domain: Container
29+
* OS: Linux
30+
* Use Case: Threat Detection
31+
* Tactic: Credential Access
32+
* Data Source: Elastic Defend
33+
* Resources: Investigation Guide
34+
35+
*Version*: 2
36+
37+
*Rule authors*:
38+
39+
* Elastic
40+
41+
*Rule license*: Elastic License v2
42+
43+
44+
==== Investigation guide
45+
46+
47+
48+
*Triage and analysis*
49+
50+
51+
> **Disclaimer**:
52+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
53+
54+
55+
*Investigating AWS Credentials Searched For Inside A Container*
56+
57+
58+
Containers often house applications that interact with AWS services, necessitating the storage of AWS credentials. Adversaries may exploit this by using search utilities to locate these credentials, potentially leading to unauthorized access. The detection rule identifies suspicious use of search tools within containers, flagging attempts to locate AWS credentials by monitoring specific process names and arguments, thus helping to prevent credential theft and subsequent attacks.
59+
60+
61+
*Possible investigation steps*
62+
63+
64+
- Review the process details to identify the specific search utility used (e.g., grep, find) and the arguments passed, focusing on those related to AWS credentials such as aws_access_key_id or aws_secret_access_key.
65+
- Check the user context under which the suspicious process was executed to assess whether it aligns with expected behavior for that user or role within the container.
66+
- Investigate the source of the container image to ensure it is from a trusted repository and has not been tampered with, which could indicate a supply chain compromise.
67+
- Analyze recent activity logs for the container to identify any other suspicious behavior or anomalies that might correlate with the search for AWS credentials, such as unexpected network connections or file modifications.
68+
- Review access logs for AWS services to detect any unauthorized or unusual access patterns that might suggest the use of compromised credentials.
69+
70+
71+
*False positive analysis*
72+
73+
74+
- Routine maintenance scripts or automated processes may use search utilities to verify the presence of AWS credentials for legitimate configuration checks. To handle this, identify and whitelist these specific scripts or processes by their unique identifiers or execution paths.
75+
- Developers or system administrators might manually search for AWS credentials during debugging or configuration tasks. Implement a policy to log and review these activities, and consider excluding known user accounts or roles from triggering alerts during specific time windows or in designated environments.
76+
- Security audits or compliance checks often involve searching for sensitive information, including AWS credentials, to ensure proper security measures are in place. Coordinate with audit teams to schedule these activities and temporarily suppress alerts during these periods, or exclude specific audit tools from detection.
77+
- Continuous integration and deployment (CI/CD) pipelines might include steps that search for AWS credentials to validate environment configurations. Identify these pipelines and exclude their associated processes or container environments from triggering alerts, ensuring that only authorized CI/CD tools are used.
78+
79+
80+
*Response and remediation*
81+
82+
83+
- Immediately isolate the affected container to prevent further unauthorized access or data exfiltration. This can be done by stopping the container or disconnecting it from the network.
84+
- Revoke any AWS credentials that were potentially exposed or accessed. This includes rotating keys and updating any services or applications that rely on these credentials.
85+
- Conduct a thorough review of the container's file system to identify any unauthorized changes or additional malicious files that may have been introduced.
86+
- Implement stricter access controls and monitoring on AWS credentials within containers, ensuring they are stored securely and accessed only by authorized processes.
87+
- Escalate the incident to the cloud security team to assess the potential impact on the broader cloud environment and determine if further investigation or response is needed.
88+
- Enhance logging and monitoring for similar activities across other containers and cloud environments to detect and respond to future attempts promptly.
89+
- Review and update container security policies to include best practices for credential management and access control, reducing the risk of similar incidents.
90+
91+
==== Setup
92+
93+
94+
95+
*Setup*
96+
97+
98+
This rule requires data coming in from Elastic Defend.
99+
100+
101+
*Elastic Defend Integration Setup*
102+
103+
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
104+
105+
106+
*Prerequisite Requirements:*
107+
108+
- Fleet is required for Elastic Defend.
109+
- To configure Fleet Server refer to the https://www.elastic.co/guide/en/fleet/current/fleet-server.html[documentation].
110+
111+
112+
*The following steps should be executed in order to add the Elastic Defend integration on a Linux System:*
113+
114+
- Go to the Kibana home page and click "Add integrations".
115+
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
116+
- Click "Add Elastic Defend".
117+
- Configure the integration name and optionally add a description.
118+
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
119+
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html[Helper guide].
120+
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
121+
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
122+
123+
For more details on Elastic Agent configuration settings, refer to the https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html[helper guide].
124+
- Click "Save and Continue".
125+
- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
126+
For more details on Elastic Defend refer to the https://www.elastic.co/guide/en/security/current/install-endpoint.html[helper guide].
127+
128+
129+
==== Rule query
130+
131+
132+
[source, js]
133+
----------------------------------
134+
process where host.os.type == "linux" and event.type == "start" and event.action == "exec" and
135+
process.entry_leader.entry_meta.type == "container" and
136+
process.name in ("grep", "egrep", "fgrep", "find", "locate", "mlocate") and
137+
process.command_line like~ (
138+
"*aws_access_key_id*", "*aws_secret_access_key*", "*aws_session_token*", "*accesskeyid*", "*secretaccesskey*",
139+
"*access_key*", "*.aws/credentials*"
140+
)
141+
142+
----------------------------------
143+
144+
*Framework*: MITRE ATT&CK^TM^
145+
146+
* Tactic:
147+
** Name: Credential Access
148+
** ID: TA0006
149+
** Reference URL: https://attack.mitre.org/tactics/TA0006/
150+
* Technique:
151+
** Name: Unsecured Credentials
152+
** ID: T1552
153+
** Reference URL: https://attack.mitre.org/techniques/T1552/
154+
* Sub-technique:
155+
** Name: Credentials In Files
156+
** ID: T1552.001
157+
** Reference URL: https://attack.mitre.org/techniques/T1552/001/

0 commit comments

Comments
 (0)