LoFP LoFP / a deliberately public demo, prototype, or shared-tooling gateway or runtime created by a known platform or ci/cd principal. validate the caller, the resource's `authorizertype`, and whether public invocation was an explicit, reviewed design decision rather than a misconfiguration.

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