AWS Bedrock Guardrails Detected Multiple Policy Violations Within a Single Blocked Request
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.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2024/05/02"
3maturity = "production"
4updated_date = "2024/11/05"
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 violations of AWS Bedrock guardrails within a single request, resulting in a block action,
12increasing the likelihood of malicious intent. Multiple violations implies that a user may be intentionally attempting
13to cirvumvent security controls, access sensitive information, or possibly exploit a vulnerability in the system.
14"""
15false_positives = ["Legitimate misunderstanding by users or overly strict policies"]
16from = "now-60m"
17interval = "10m"
18language = "esql"
19license = "Elastic License v2"
20name = "AWS Bedrock Guardrails Detected Multiple Policy Violations Within a Single Blocked Request"
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 = 21
28rule_id = "f4c2515a-18bb-47ce-a768-1dc4e7b0fe6c"
29note = """## Triage and analysis
30
31### Investigating Amazon Bedrock Guardrail Multiple Policy Violations Within a Single Blocked Request.
32
33Amazon 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.
34
35It enables users to set guidelines and filters that manage content quality, relevancy, and adherence to responsible AI practices.
36
37Through Guardrail, organizations can define "denied topics" to prevent the model from generating content on specific, undesired subjects,
38and they can establish thresholds for harmful content categories, including hate speech, violence, or offensive language.
39
40#### Possible investigation steps
41
42- Identify the user account and the user request that caused multiple policy violations and whether it should perform this kind of action.
43- Investigate the user activity that might indicate a potential brute force attack.
44- Investigate other alerts associated with the user account during the past 48 hours.
45- 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?
46- Examine the account's prompts and responses in the last 24 hours.
47- 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.
48
49### False positive analysis
50
51- Verify the user account that caused multiple policy violations, is not testing any new model deployments or updated compliance policies in Amazon Bedrock guardrails.
52
53### Response and remediation
54
55- Initiate the incident response process based on the outcome of the triage.
56- Disable or limit the account during the investigation and response.
57- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
58 - Identify the account role in the cloud environment.
59 - Identify if the attacker is moving laterally and compromising other Amazon Bedrock Services.
60 - Identify any regulatory or legal ramifications related to this activity.
61- 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.
62- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
63- 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).
64"""
65setup = """## Setup
66
67This rule requires that guardrails are configured in AWS Bedrock. For more information, see the AWS Bedrock documentation:
68
69https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-create.html
70"""
71severity = "low"
72tags = [
73 "Domain: LLM",
74 "Data Source: AWS Bedrock",
75 "Data Source: AWS S3",
76 "Resources: Investigation Guide",
77 "Use Case: Policy Violation",
78 "Mitre Atlas: T0051",
79 "Mitre Atlas: T0054",
80]
81timestamp_override = "event.ingested"
82type = "esql"
83
84query = '''
85from logs-aws_bedrock.invocation-*
86| where gen_ai.policy.action == "BLOCKED"
87| eval policy_violations = mv_count(gen_ai.policy.name)
88| where policy_violations > 1
89| keep gen_ai.policy.action, policy_violations, user.id, gen_ai.request.model.id, cloud.account.id, user.id
90| stats total_unique_request_violations = count(*) by policy_violations, user.id, gen_ai.request.model.id, cloud.account.id
91| sort total_unique_request_violations desc
92'''
Triage and analysis
Investigating Amazon Bedrock Guardrail Multiple Policy Violations Within a Single Blocked Request.
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.
It enables users to set guidelines and filters that manage content quality, relevancy, and adherence to responsible AI practices.
Through Guardrail, organizations can define "denied topics" to prevent the model from generating content on specific, undesired subjects, and they can establish thresholds for harmful content categories, including hate speech, violence, or offensive language.
Possible investigation steps
- Identify the user account and the user request that caused multiple policy violations 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, 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 Violations by a Single User Over a Session
- Unusual High Confidence Misconduct Blocks Detected
- Potential Abuse of Resources by High Token Count and Large Response Sizes
- AWS S3 Bucket Replicated to Another Account
- AWS SSM `SendCommand` Execution by Rare User