AWS Bedrock Invocations without Guardrails Detected by a Single User Over a Session
Identifies multiple AWS Bedrock executions in a one minute time window without guardrails by the same user in the same account over a session. Multiple consecutive executions implies that a user may be intentionally attempting to bypass security controls, by not routing the requests with the desired guardrail configuration in order to access sensitive information, or possibly exploit a vulnerability in the system.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/11/25"
3maturity = "production"
4updated_date = "2024/11/25"
5min_stack_comments = "ES|QL rule type is still in technical preview as of 8.13, however this rule was tested successfully; integration in tech preview"
6min_stack_version = "8.13.0"
7
8[rule]
9author = ["Elastic"]
10description = """
11Identifies multiple AWS Bedrock executions in a one minute time window without guardrails by the same user in the same account over a session. Multiple
12consecutive executions implies that a user may be intentionally attempting to bypass security controls, by not routing the requests with the desired guardrail configuration
13in order to access sensitive information, or possibly exploit a vulnerability in the system.
14"""
15false_positives = ["Users testing new model deployments or updated compliance policies without Amazon Bedrock guardrails."]
16from = "now-60m"
17interval = "10m"
18language = "esql"
19license = "Elastic License v2"
20name = "AWS Bedrock Invocations without Guardrails Detected by a Single User Over a Session"
21references = [
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]
27risk_score = 47
28rule_id = "f2c653b7-7daf-4774-86f2-34cdbd1fc528"
29note = """## Triage and analysis
30
31### Investigating Amazon Bedrock Invocations without Guardrails Detected by a Single User Over a Session.
32
33Using Amazon Bedrock Guardrails during model invocation is critical for ensuring the safe, reliable, and ethical use of AI models.
34Guardrails help manage risks associated with AI usage and ensure the output aligns with desired policies and standards.
35
36#### Possible investigation steps
37
38- Identify the user account that caused multiple model violations over a session without desired guardrail configuration and whether it should perform this kind of action.
39- Investigate the user activity that might indicate a potential brute force attack.
40- Investigate other alerts associated with the user account during the past 48 hours.
41- 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?
42- Examine the account's prompts and responses in the last 24 hours.
43- 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.
44
45### False positive analysis
46
47- Verify the user account that caused multiple policy violations by a single user over session, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
48
49### Response and remediation
50
51- Initiate the incident response process based on the outcome of the triage.
52- Disable or limit the account during the investigation and response.
53- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
54 - Identify the account role in the cloud environment.
55 - Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
56 - Identify any regulatory or legal ramifications related to this activity.
57- 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.
58- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
59- 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).
60"""
61setup = """## Setup
62
63This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:
64
65https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
66"""
67severity = "medium"
68tags = [
69 "Domain: LLM",
70 "Data Source: AWS Bedrock",
71 "Data Source: AWS S3",
72 "Resources: Investigation Guide",
73 "Use Case: Policy Violation",
74 "Mitre Atlas: T0051",
75 "Mitre Atlas: T0054",
76]
77timestamp_override = "event.ingested"
78type = "esql"
79
80query = '''
81from logs-aws_bedrock.invocation-*
82// create time window buckets of 1 minute
83| eval time_window = date_trunc(1 minute, @timestamp)
84| where gen_ai.guardrail_id is NULL
85| KEEP @timestamp, time_window, gen_ai.guardrail_id , user.id
86| stats model_invocation_without_guardrails = count() by user.id
87| where model_invocation_without_guardrails > 5
88| sort model_invocation_without_guardrails desc
89'''
Triage and analysis
Investigating Amazon Bedrock Invocations without Guardrails Detected by a Single User Over a Session.
Using Amazon Bedrock Guardrails during model invocation is critical for ensuring the safe, reliable, and ethical use of AI models. Guardrails help manage risks associated with AI usage and ensure the output aligns with desired policies and standards.
Possible investigation steps
- Identify the user account that caused multiple model violations over a session without desired guardrail configuration and whether it should perform this kind of action.
- Investigate the user activity that might indicate a potential brute force attack.
- Investigate other alerts associated with the user account during the past 48 hours.
- 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?
- Examine the account's prompts and responses in the last 24 hours.
- 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.
False positive analysis
- Verify the user account that caused multiple policy violations by a single user over session, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
- Identify the account role in the cloud environment.
- Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
- Identify any regulatory or legal ramifications related to this activity.
- 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.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- 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).
References
Related rules
- AWS Bedrock Guardrails Detected Multiple Policy Violations Within a Single Blocked Request
- AWS Bedrock Guardrails Detected Multiple Violations by a Single User Over a Session
- Unusual High Confidence Content Filter Blocks Detected
- Unusual High Denied Sensitive Information Policy Blocks Detected
- Unusual High Denied Topic Blocks Detected