Skip to content

Commit a742418

Browse files
Update latest docs (#7110)
1 parent 5c40e70 commit a742418

File tree

182 files changed

+10709
-559
lines changed

Some content is hidden

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

182 files changed

+10709
-559
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[[prebuilt-rule-8-19-10-agent-spoofing-mismatched-agent-id]]
2+
=== Agent Spoofing - Mismatched Agent ID
3+
4+
Detects events that have a mismatch on the expected event agent ID. The status "agent_id_mismatch/mismatch" occurs when the expected agent ID associated with the API key does not match the actual agent ID in an event. This could indicate attempts to spoof events in order to masquerade actual activity to evade detection.
5+
6+
*Rule type*: query
7+
8+
*Rule indices*:
9+
10+
* logs-*
11+
* metrics-*
12+
* traces-*
13+
14+
*Severity*: high
15+
16+
*Risk score*: 73
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+
* Use Case: Threat Detection
29+
* Tactic: Defense Evasion
30+
* Resources: Investigation Guide
31+
32+
*Version*: 104
33+
34+
*Rule authors*:
35+
36+
* Elastic
37+
38+
*Rule license*: Elastic License v2
39+
40+
41+
==== Investigation guide
42+
43+
44+
45+
*Triage and analysis*
46+
47+
48+
> **Disclaimer**:
49+
> 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.
50+
51+
52+
*Investigating Agent Spoofing - Mismatched Agent ID*
53+
54+
55+
In security environments, agent IDs uniquely identify software agents that report events. Adversaries may spoof these IDs to disguise unauthorized activities, evading detection systems. The detection rule identifies discrepancies between expected and actual agent IDs, flagging potential spoofing attempts. By monitoring for mismatches, it helps uncover efforts to masquerade malicious actions as legitimate.
56+
57+
58+
*Possible investigation steps*
59+
60+
61+
- Review the event logs to identify the specific events where the agent_id_status is marked as "agent_id_mismatch" or "mismatch" to understand the scope and frequency of the issue.
62+
- Correlate the mismatched agent IDs with the associated API keys to determine if there are any patterns or commonalities that could indicate a targeted spoofing attempt.
63+
- Investigate the source IP addresses and user accounts associated with the mismatched events to identify any unauthorized access or suspicious activity.
64+
- Check for any recent changes or anomalies in the configuration or deployment of agents that could explain the mismatches, such as updates or reassignments.
65+
- Analyze historical data to determine if similar mismatches have occurred in the past and whether they were resolved or linked to known issues or threats.
66+
- Consult with the IT or security team to verify if there are any legitimate reasons for the agent ID discrepancies, such as testing or maintenance activities.
67+
68+
69+
*False positive analysis*
70+
71+
72+
- Legitimate software updates or patches may temporarily cause agent ID mismatches. Users should verify if the mismatches coincide with scheduled updates and consider excluding these events if confirmed.
73+
- Network configuration changes, such as IP address reassignments, can lead to mismatches. Ensure that network changes are documented and correlate with the mismatched events before excluding them.
74+
- Virtual machine snapshots or clones might result in duplicate agent IDs. Users should track virtual machine activities and exclude events from known snapshot or cloning operations.
75+
- Load balancing or failover processes in high-availability environments can cause agent ID discrepancies. Review the infrastructure setup and exclude events that align with these processes.
76+
- Testing environments often simulate various agent activities, leading to mismatches. Clearly separate test environments from production in monitoring systems and exclude test-related events.
77+
78+
79+
*Response and remediation*
80+
81+
82+
- Immediately isolate the affected systems to prevent further unauthorized access or data exfiltration. This can be done by disconnecting the system from the network or using network segmentation techniques.
83+
- Conduct a thorough review of the logs and events associated with the mismatched agent ID to identify any unauthorized changes or activities. Focus on the specific events flagged by the detection rule.
84+
- Revoke and reissue API keys associated with the compromised agent ID to prevent further misuse. Ensure that new keys are distributed securely and only to authorized personnel.
85+
- Implement additional monitoring on the affected systems and related network segments to detect any further attempts at agent ID spoofing or other suspicious activities.
86+
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if the threat actor has compromised other parts of the network.
87+
- Review and update access controls and authentication mechanisms to ensure that only legitimate agents can report events. Consider implementing multi-factor authentication for added security.
88+
- Document the incident, including all actions taken, and conduct a post-incident review to identify any gaps in detection or response. Use this information to enhance future threat detection and response capabilities.
89+
90+
==== Rule query
91+
92+
93+
[source, js]
94+
----------------------------------
95+
event.agent_id_status:(agent_id_mismatch or mismatch) and not host.name:agentless-*
96+
97+
----------------------------------
98+
99+
*Framework*: MITRE ATT&CK^TM^
100+
101+
* Tactic:
102+
** Name: Defense Evasion
103+
** ID: TA0005
104+
** Reference URL: https://attack.mitre.org/tactics/TA0005/
105+
* Technique:
106+
** Name: Masquerading
107+
** ID: T1036
108+
** Reference URL: https://attack.mitre.org/techniques/T1036/
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
[[prebuilt-rule-8-19-10-aws-bedrock-guardrails-detected-multiple-policy-violations-within-a-single-blocked-request]]
2+
=== AWS Bedrock Guardrails Detected Multiple Policy Violations Within a Single Blocked Request
3+
4+
Identifies multiple violations of AWS Bedrock guardrails within a single request, resulting in a block action, increasing the likelihood of malicious intent. Multiple violations implies that a user may be intentionally attempting to cirvumvent security controls, access sensitive information, or possibly exploit a vulnerability in the system.
5+
6+
*Rule type*: esql
7+
8+
*Rule indices*: None
9+
10+
*Severity*: low
11+
12+
*Risk score*: 21
13+
14+
*Runs every*: 10m
15+
16+
*Searches indices from*: now-60m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
17+
18+
*Maximum alerts per execution*: 100
19+
20+
*References*:
21+
22+
* https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-components.html
23+
* https://atlas.mitre.org/techniques/AML.T0051
24+
* https://atlas.mitre.org/techniques/AML.T0054
25+
* https://www.elastic.co/security-labs/elastic-advances-llm-security
26+
27+
*Tags*:
28+
29+
* Domain: LLM
30+
* Data Source: AWS Bedrock
31+
* Data Source: AWS S3
32+
* Resources: Investigation Guide
33+
* Use Case: Policy Violation
34+
* Mitre Atlas: T0051
35+
* Mitre Atlas: T0054
36+
37+
*Version*: 7
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 Bedrock Guardrails Detected Multiple Policy Violations Within a Single Blocked Request*
55+
56+
57+
Amazon Bedrock Guardrail is a set of features within Amazon Bedrock designed to help businesses apply robust safety and privacy controls to their generative AI applications.
58+
59+
It enables users to set guidelines and filters that manage content quality, relevancy, and adherence to responsible AI practices.
60+
61+
Through Guardrail, organizations can define "denied topics" to prevent the model from generating content on specific, undesired subjects,
62+
and they can establish thresholds for harmful content categories, including hate speech, violence, or offensive language.
63+
64+
65+
*Possible investigation steps*
66+
67+
68+
- Identify the user account and the user request that caused multiple policy violations and whether it should perform this kind of action.
69+
- Investigate the user activity that might indicate a potential brute force attack.
70+
- Investigate other alerts associated with the user account during the past 48 hours.
71+
- Consider the time of day. If the user is a human (not a program or script), did the activity take place during a normal time of day?
72+
- Examine the account's prompts and responses in the last 24 hours.
73+
- If you suspect the account has been compromised, scope potentially compromised assets by tracking Amazon Bedrock model access, prompts generated, and responses to the prompts by the account in the last 24 hours.
74+
75+
76+
*False positive analysis*
77+
78+
79+
- Verify the user account that caused multiple policy violations, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
80+
81+
82+
*Response and remediation*
83+
84+
85+
- Initiate the incident response process based on the outcome of the triage.
86+
- Disable or limit the account during the investigation and response.
87+
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
88+
- Identify the account role in the cloud environment.
89+
- Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
90+
- Identify any regulatory or legal ramifications related to this activity.
91+
- Review the permissions assigned to the implicated user group or role behind these requests to ensure they are authorized and expected to access bedrock and ensure that the least privilege principle is being followed.
92+
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
93+
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
94+
95+
96+
==== Setup
97+
98+
99+
100+
*Setup*
101+
102+
103+
This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:
104+
105+
https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
106+
107+
108+
==== Rule query
109+
110+
111+
[source, js]
112+
----------------------------------
113+
from logs-aws_bedrock.invocation-*
114+
115+
// Expand multi-value policy action field
116+
| mv_expand gen_ai.policy.action
117+
118+
// Filter for policy-blocked requests
119+
| where gen_ai.policy.action == "BLOCKED"
120+
121+
// count number of policy matches per request (multi-valued)
122+
| eval Esql.ml_policy_violations_mv_count = mv_count(gen_ai.policy.name)
123+
124+
// Filter for requests with more than one policy match
125+
| where Esql.ml_policy_violations_mv_count > 1
126+
127+
// keep relevant fields
128+
| keep
129+
gen_ai.policy.action,
130+
Esql.ml_policy_violations_mv_count,
131+
user.id,
132+
gen_ai.request.model.id,
133+
cloud.account.id
134+
135+
// Aggregate requests with multiple violations
136+
| stats
137+
Esql.ml_policy_violations_total_unique_requests_count = count(*)
138+
by
139+
Esql.ml_policy_violations_mv_count,
140+
user.id,
141+
gen_ai.request.model.id,
142+
cloud.account.id
143+
144+
// sort by number of unique requests
145+
| sort Esql.ml_policy_violations_total_unique_requests_count desc
146+
147+
----------------------------------
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
[[prebuilt-rule-8-19-10-aws-cli-command-with-custom-endpoint-url]]
2+
=== AWS CLI Command with Custom Endpoint URL
3+
4+
Detects the use of the AWS CLI with the `--endpoint-url` argument, which allows users to specify a custom endpoint URL for AWS services. This can be leveraged by adversaries to redirect API requests to non-standard or malicious endpoints, potentially bypassing typical security controls and logging mechanisms. This behavior may indicate an attempt to interact with unauthorized or compromised infrastructure, exfiltrate data, or perform other malicious activities under the guise of legitimate AWS operations.
5+
6+
*Rule type*: new_terms
7+
8+
*Rule indices*:
9+
10+
* logs-endpoint.events.process-*
11+
* logs-crowdstrike.fdr*
12+
13+
*Severity*: medium
14+
15+
*Risk score*: 47
16+
17+
*Runs every*: 5m
18+
19+
*Searches indices from*: now-9m ({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://sysdig.com/blog/scarleteel-2-0/
26+
27+
*Tags*:
28+
29+
* Data Source: Elastic Defend
30+
* Domain: Endpoint
31+
* OS: Linux
32+
* Use Case: Threat Detection
33+
* Tactic: Command and Control
34+
* Resources: Investigation Guide
35+
* Data Source: Crowdstrike
36+
37+
*Version*: 5
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 AWS CLI Command with Custom Endpoint URL*
58+
59+
60+
The AWS CLI allows users to interact with AWS services via command-line, offering flexibility in managing cloud resources. The `--endpoint-url` option lets users specify alternative endpoints, which can be exploited by adversaries to reroute requests to malicious servers, bypassing security controls. The detection rule identifies such misuse by monitoring for the `--endpoint-url` argument in process logs, flagging potential unauthorized activities.
61+
62+
63+
*Possible investigation steps*
64+
65+
66+
- Review the process logs to identify the specific command line that triggered the alert, focusing on the presence of the --endpoint-url argument.
67+
- Investigate the custom endpoint URL specified in the command to determine if it is a known malicious or unauthorized domain.
68+
- Check the user account associated with the process to assess if it has a history of suspicious activity or if it has been compromised.
69+
- Analyze network logs to trace any outbound connections to the custom endpoint URL and evaluate the data being transmitted.
70+
- Correlate the event with other security alerts or logs to identify any patterns or additional indicators of compromise related to the same user or endpoint.
71+
- Verify if the AWS credentials used in the command have been exposed or misused in other contexts, potentially indicating credential theft or abuse.
72+
73+
74+
*False positive analysis*
75+
76+
77+
- Internal testing environments may use custom endpoint URLs for development purposes. To manage this, create exceptions for known internal IP addresses or domain names associated with these environments.
78+
- Organizations using AWS CLI with custom endpoints for legitimate third-party integrations might trigger this rule. Identify and whitelist these specific integrations by their endpoint URLs to prevent false positives.
79+
- Automated scripts or tools that interact with AWS services through custom endpoints for monitoring or backup purposes can be flagged. Review and document these scripts, then exclude them from detection by process name or specific endpoint URL.
80+
- Some organizations may use proxy servers that require custom endpoint URLs for AWS CLI operations. Verify these configurations and exclude the associated endpoint URLs from the detection rule.
81+
82+
83+
*Response and remediation*
84+
85+
86+
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
87+
- Review process logs and network traffic to identify any data that may have been redirected to unauthorized endpoints and assess the extent of potential data exposure.
88+
- Revoke any AWS credentials or access keys used on the affected system to prevent further misuse and rotate them with new credentials.
89+
- Conduct a thorough investigation to determine if any other systems have been compromised or if similar unauthorized endpoint usage has occurred elsewhere in the network.
90+
- Escalate the incident to the security operations center (SOC) or incident response team for further analysis and to determine if additional containment or remediation actions are necessary.
91+
- Implement network-level controls to block known malicious endpoints and enhance monitoring for unusual AWS CLI usage patterns across the environment.
92+
- Update security policies and endpoint protection configurations to detect and alert on the use of custom endpoint URLs in AWS CLI commands, ensuring rapid response to future incidents.
93+
94+
==== Rule query
95+
96+
97+
[source, js]
98+
----------------------------------
99+
host.os.type: "linux" and event.category: "process" and process.name: "aws" and process.args: "--endpoint-url"
100+
101+
----------------------------------
102+
103+
*Framework*: MITRE ATT&CK^TM^
104+
105+
* Tactic:
106+
** Name: Command and Control
107+
** ID: TA0011
108+
** Reference URL: https://attack.mitre.org/tactics/TA0011/
109+
* Technique:
110+
** Name: Web Service
111+
** ID: T1102
112+
** Reference URL: https://attack.mitre.org/techniques/T1102/

0 commit comments

Comments
 (0)