What to turn on
Add one data event selector to a trail that logs the gateway’s account. This can be an organization trail, which only its management account can change. The selector haseventCategory set to Data and resources.type set to AWS::BedrockAgentCore::Gateway.
A trail logs data events only in the regions it covers. Use a multi-region trail, or one trail in each region that has a gateway.
AWS charges $0.10 for every 100,000 data events the trail delivers. A gateway produces one event for each request it receives, which includes requests that list tools as well as tool calls. See AWS CloudTrail pricing.
Add the selector to a trail
- AWS console
- AWS CLI
- CloudFormation
- In the CloudTrail console, choose Trails and open the trail.
- In Data events, choose Edit.
- If the trail logs no data events yet, select the Data events check box. If it does, choose Add data event type.
- For Resource type, choose Bedrock-AgentCore Gateway.
- For the log selector template, choose Log all events.
- Choose Save changes.
Check that it worked
After the next scan, [PLERION-AWS-1239] “CloudTrail does not log data events for AgentCore gateways” passes for each gateway the trail covers.What Plerion reads
Once the trail logs these events, Plerion receives them through the Cloud Detection and Response (CDR) integration, which forwards events from the regions its stack is deployed in. Deploy it in each region that has a gateway. From each event it reads:- The IAM role and session that made the request, with the source IP address and user agent
- The tool that was called, and on which gateway
- Whether the call succeeded, or the error it returned. A call the gateway’s policy denies is logged with HTTP status 200 and the JSON-RPC error code
-32002.
REDACTED in the event.
Plerion reads the caller for gateways that use IAM authorization. For a gateway that authorizes its callers with a JSON Web Token (JWT), AWS documents that the event carries claims from the token in place of an IAM identity.