AWS Bedrock Third-Party or External Knowledge Base Associated to Agent
Detects when an Amazon Bedrock agent is associated with, or updated to use, a knowledge base via the AssociateAgentKnowledgeBase, or UpdateAgentKnowledgeBase API actions. Bedrock agents consume knowledge base (RAG) content as trusted context for the model. By wiring an agent to an externally controlled or third-party knowledge base, or by swapping in an attacker-controlled knowledge base, an adversary can redraw the agent's trust boundary toward an untrusted source. This is a software-supply-chain compromise and an indirect prompt-injection delivery vector: poisoned or adversarial content served from the associated knowledge base is treated as authoritative by the agent. Validate that the associated knowledge base, and any underlying data source, is owned and controlled by your organization.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/06/04"
3integration = ["aws"]
4maturity = "production"
5updated_date = "2026/06/04"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects when an Amazon Bedrock agent is associated with, or updated to use, a knowledge base via the AssociateAgentKnowledgeBase,
11or UpdateAgentKnowledgeBase API actions. Bedrock agents consume knowledge base (RAG) content as trusted context for the model.
12By wiring an agent to an externally controlled or third-party knowledge base, or by swapping in an attacker-controlled knowledge base,
13an adversary can redraw the agent's trust boundary toward an untrusted source. This is a software-supply-chain compromise and an indirect
14prompt-injection delivery vector: poisoned or adversarial content served from the associated knowledge base is treated as authoritative
15by the agent. Validate that the associated knowledge base, and any underlying data source, is owned and controlled by your organization.
16"""
17false_positives = [
18 """
19 Legitimate platform, ML, or application teams may associate or update knowledge bases on Bedrock agents as part of
20 normal development, onboarding, or RAG pipeline changes. Verify that the actor identity, user agent, and source IP
21 correspond to expected automation or authorized engineers, and that the associated knowledge base is an approved,
22 organization-owned resource. If known behavior is causing false positives, it can be exempted from the rule.
23 """,
24]
25from = "now-6m"
26index = ["logs-aws.cloudtrail-*"]
27language = "kuery"
28license = "Elastic License v2"
29name = "AWS Bedrock Third-Party or External Knowledge Base Associated to Agent"
30note = """## Triage and analysis
31
32### Investigating AWS Bedrock Third-Party or External Knowledge Base Associated to Agent
33
34Amazon Bedrock agents use knowledge bases to retrieve content that is injected into the model's context as
35trusted, authoritative information (Retrieval-Augmented Generation). The `AssociateAgentKnowledgeBase`, and
36`UpdateAgentKnowledgeBase` actions change which knowledge base an agent trusts. Because the model consumes this
37content as ground truth, redirecting an agent toward an externally controlled or attacker-supplied knowledge base
38is a supply-chain and indirect prompt-injection delivery vector — distinct from poisoning the content of a knowledge
39base the agent already trusts.
40
41#### Possible investigation steps
42
43- **Identify the actor and context**
44 - Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, `user_agent.original`, and `source.ip`.
45 - Confirm a related change request exists (RAG pipeline change, agent onboarding, model improvement work).
46- **Validate the association**
47 - In `aws.cloudtrail.flattened.request_parameters`, identify the `agentId`, `knowledgeBaseId`, and any third-party
48 or external endpoint/configuration referenced.
49 - Confirm the knowledge base and its underlying data source are owned by your organization and not an external account.
50- **Assess blast radius**
51 - Determine which applications or users invoke the affected agent and what sensitivity of decisions it drives.
52 - Check `aws.cloudtrail.flattened.response_elements` for the resulting association state.
53- **Correlate activity**
54 - Look for preceding enumeration (`ListAgents`, `ListKnowledgeBases`, `GetAgent`) or creation of new knowledge
55 bases and data sources from the same identity.
56
57### False positive analysis
58
59- **Planned RAG changes**: ML/platform teams routinely associate or update knowledge bases. Validate via ticket
60 and confirm the resource is an approved, organization-owned knowledge base.
61- **Automation**: IaC or CI/CD pipelines may manage agent–knowledge base associations during deployment.
62
63### Response and remediation
64
65- If unauthorized, dissociate the knowledge base from the agent and restore the approved configuration.
66- Review the associated knowledge base and its data source for attacker-controlled or external content; quarantine if suspect.
67- Audit the actor's recent Bedrock and IAM activity and rotate credentials if compromise is suspected.
68- Restrict `bedrock:AssociateAgentKnowledgeBase`, `bedrock:UpdateAgentKnowledgeBase`, and third-party association
69 permissions to a small set of trusted roles.
70"""
71references = [
72 "https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html",
73 "https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html"
74]
75risk_score = 47
76rule_id = "168b5538-4d54-4269-b4f5-786fa49dd850"
77severity = "medium"
78tags = [
79 "Domain: Cloud",
80 "Domain: LLM",
81 "Data Source: Amazon Web Services",
82 "Data Source: AWS",
83 "Data Source: AWS CloudTrail",
84 "Use Case: Threat Detection",
85 "Resources: Investigation Guide",
86 "Tactic: Persistence",
87]
88timestamp_override = "event.ingested"
89type = "new_terms"
90
91query = '''
92data_stream.dataset: "aws.cloudtrail"
93 and event.provider: "bedrock.amazonaws.com"
94 and event.action: (
95 "AssociateAgentKnowledgeBase" or
96 "UpdateAgentKnowledgeBase"
97 )
98 and event.outcome: "success"
99'''
100
101
102[[rule.threat]]
103framework = "MITRE ATT&CK"
104
105[[rule.threat.technique]]
106id = "T1505"
107name = "Server Software Component"
108reference = "https://attack.mitre.org/techniques/T1505/"
109
110[rule.threat.tactic]
111id = "TA0003"
112name = "Persistence"
113reference = "https://attack.mitre.org/tactics/TA0003/"
114
115[rule.investigation_fields]
116field_names = [
117 "@timestamp",
118 "user.name",
119 "user_agent.original",
120 "source.ip",
121 "aws.cloudtrail.user_identity.arn",
122 "aws.cloudtrail.user_identity.type",
123 "aws.cloudtrail.user_identity.access_key_id",
124 "event.action",
125 "event.provider",
126 "event.outcome",
127 "cloud.account.id",
128 "cloud.region",
129 "aws.cloudtrail.flattened.request_parameters",
130 "aws.cloudtrail.flattened.response_elements",
131]
132
133[rule.new_terms]
134field = "new_terms_fields"
135value = ["aws.cloudtrail.user_identity.arn"]
136
137[[rule.new_terms.history_window_start]]
138field = "history_window_start"
139value = "now-7d"
Triage and analysis
Investigating AWS Bedrock Third-Party or External Knowledge Base Associated to Agent
Amazon Bedrock agents use knowledge bases to retrieve content that is injected into the model's context as
trusted, authoritative information (Retrieval-Augmented Generation). The AssociateAgentKnowledgeBase, and
UpdateAgentKnowledgeBase actions change which knowledge base an agent trusts. Because the model consumes this
content as ground truth, redirecting an agent toward an externally controlled or attacker-supplied knowledge base
is a supply-chain and indirect prompt-injection delivery vector — distinct from poisoning the content of a knowledge
base the agent already trusts.
Possible investigation steps
- Identify the actor and context
- Review
aws.cloudtrail.user_identity.arn,aws.cloudtrail.user_identity.type,user_agent.original, andsource.ip. - Confirm a related change request exists (RAG pipeline change, agent onboarding, model improvement work).
- Review
- Validate the association
- In
aws.cloudtrail.flattened.request_parameters, identify theagentId,knowledgeBaseId, and any third-party or external endpoint/configuration referenced. - Confirm the knowledge base and its underlying data source are owned by your organization and not an external account.
- In
- Assess blast radius
- Determine which applications or users invoke the affected agent and what sensitivity of decisions it drives.
- Check
aws.cloudtrail.flattened.response_elementsfor the resulting association state.
- Correlate activity
- Look for preceding enumeration (
ListAgents,ListKnowledgeBases,GetAgent) or creation of new knowledge bases and data sources from the same identity.
- Look for preceding enumeration (
False positive analysis
- Planned RAG changes: ML/platform teams routinely associate or update knowledge bases. Validate via ticket and confirm the resource is an approved, organization-owned knowledge base.
- Automation: IaC or CI/CD pipelines may manage agent–knowledge base associations during deployment.
Response and remediation
- If unauthorized, dissociate the knowledge base from the agent and restore the approved configuration.
- Review the associated knowledge base and its data source for attacker-controlled or external content; quarantine if suspect.
- Audit the actor's recent Bedrock and IAM activity and rotate credentials if compromise is suspected.
- Restrict
bedrock:AssociateAgentKnowledgeBase,bedrock:UpdateAgentKnowledgeBase, and third-party association permissions to a small set of trusted roles.
References
Related rules
- AWS Bedrock Agent Created by IAM User or Root
- AWS Bedrock Foundation Model Access Enabled or Entitlement Granted
- AWS Bedrock Unauthorized Foundation Model Access Attempt
- AWS Bedrock Agent or Action Group Manipulation
- AWS Bedrock Untrusted Model Imported or Marketplace Endpoint Registered