AWS Bedrock AgentCore Resource Credential Retrieved by New Principal

edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

AWS Bedrock AgentCore Resource Credential Retrieved by New Principal

edit

Identifies the first time a given user, in a given account, successfully calls GetResourceApiKey or GetResourceOauth2Token against Amazon Bedrock AgentCore’s Token Vault. These calls take only a workload-identity token and a credential-provider name, and the API does not bind a credential provider to the specific workload identity that created it, so any workload’s token can retrieve any other workload’s stored API key or OAuth token in the same account. Because there is no ownership check to alert on directly, this rule instead surfaces new or unusual callers of this sensitive retrieval API for analyst review.

Rule type: new_terms

Rule indices:

  • logs-aws.cloudtrail-*

Severity: medium

Risk score: 47

Runs every: 5m

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Domain: Cloud
  • Domain: GenAI
  • Data Source: AWS
  • Data Source: AWS CloudTrail
  • Data Source: Amazon Web Services
  • Use Case: Identity and Access Audit
  • Resources: Investigation Guide
  • Tactic: Credential Access
  • Rule Type: New Terms
  • Platform: AWS
  • Service: AWS Bedrock
  • Mitre Atlas: AML.T0012

Version: 1

Rule authors:

  • Elastic

Rule license: Elastic License v2

Investigation guide

edit

Triage and analysis

Investigating AWS Bedrock AgentCore Resource Credential Retrieved by New Principal

This rule fires the first time (per the 7-day history window) a principal calls GetResourceApiKey or GetResourceOauth2Token. Both APIs take only (workloadIdentityToken, resourceCredentialProviderName); AgentCore does not check that the calling workload identity is the one that created or was associated with the credential provider, so any workload in the account can retrieve any other workload’s stored secret. Because CloudTrail does not log the decoded workload identity inside the token (it is redacted as HIDDEN_DUE_TO_SECURITY_REASONS), this rule cannot directly test for a cross-workload mismatch and instead flags any new caller of this sensitive retrieval path.

Possible investigation steps

  • Review aws.cloudtrail.user_identity.arn, user_agent.original, and source.ip for the caller.
  • Extract resourceCredentialProviderName from aws.cloudtrail.request_parameters and confirm which credential provider was accessed.
  • Look for a preceding GetWorkloadAccessToken/GetWorkloadAccessTokenForUserId call from the same principal in the same window; its workloadName shows which workload identity’s token was used.
  • Confirm with the team that owns the credential provider’s underlying secret (GetApiKeyCredentialProvider/Secrets Manager) whether this caller/workload should have access.

False positive analysis

  • A legitimately new agent, workload, or automation identity retrieving its own credential provider’s secret for the first time. Confirm the workload/provider pairing is expected and add the identity to known automation if so.

Response and remediation

  • If unauthorized, rotate the credential provider’s underlying secret immediately (it has no workload-level isolation once retrieved).
  • Restrict which workloads are deployed with access to sensitive credential providers; avoid sharing one account-wide Token Vault across unrelated agents where possible.
  • Review all recent GetResourceApiKey/GetResourceOauth2Token calls for the affected credential provider for other unexpected callers.

Rule query

edit
data_stream.dataset: "aws.cloudtrail" and
    event.provider: "bedrock-agentcore.amazonaws.com" and
    event.action: ("GetResourceApiKey" or "GetResourceOauth2Token") and
    event.outcome: "success"

Framework: MITRE ATT&CKTM