LoFP LoFP / a policy statement with a wildcard principal that is actually scoped down by a `condition` block (for example `aws:principalorgid`), which is not public despite the wildcard. review the full policy document for a restricting `condition` before treating the match as a true public exposure.

Techniques

Sample rules

AWS Bedrock AgentCore Gateway or Runtime Exposed via Public Resource Policy

Description

Identifies a successful PutResourcePolicy call that attaches a resource-based policy granting any principal or any AWS account access to an Amazon Bedrock AgentCore Gateway or Runtime. A Gateway is the integration point between an agent and external tools, and a Runtime hosts the deployed agent itself, and either can be configured without an authorizer, so a public resource policy on one of them makes every tool or agent the resource exposes invocable by any AWS principal with no authentication, the same exposure class as a public S3 bucket.

Detection logic

from logs-aws.cloudtrail-* metadata _id, _version, _index
| where event.dataset == "aws.cloudtrail" and event.outcome == "success" and
    event.provider == "bedrock-agentcore.amazonaws.com" and
    event.action == "PutResourcePolicy" and
    aws.cloudtrail.request_parameters is not null
| eval Esql.is_gateway_or_runtime = aws.cloudtrail.request_parameters RLIKE """.*resourceArn=[^,]*(gateway|runtime).*"""
| eval Esql.is_public_principal = aws.cloudtrail.request_parameters RLIKE """.*\"Principal\":\s*\"\*\".*""" or
    aws.cloudtrail.request_parameters RLIKE """.*\"Principal\":\s*\{\"AWS\":\s*\"\*\"\}.*"""
| eval Esql.is_allow_effect = aws.cloudtrail.request_parameters RLIKE """.*\"Effect\":\s*\"Allow\".*"""
| where Esql.is_gateway_or_runtime and Esql.is_public_principal and Esql.is_allow_effect
| keep _id, _version, _index, @timestamp, event.action, event.provider, event.outcome,
    aws.cloudtrail.user_identity.arn, aws.cloudtrail.user_identity.type,
    aws.cloudtrail.user_identity.access_key_id, user.name, user_agent.original,
    source.ip, source.geo.country_name, cloud.account.id, cloud.region, data_stream.namespace,
    aws.cloudtrail.request_id, aws.cloudtrail.request_parameters