AWS Shows How to Normalize Bedrock Guardrail Events for SOC Analysis

· Original article ↗

Summary

AWS details a pipeline that converts Amazon Bedrock Guardrails interventions into OCSF Detection Finding records in CloudWatch’s unified data store, enabling Athena correlation with CloudTrail and VPC Flow Logs and real-time queries in Logs Insights.

Key points

  • The reference pipeline filters model invocation logs for guardrail interventions and uses Lambda to create one OCSF Detection Finding (class_uid 2004) per assessment.
  • It assigns High severity to prompt injection interventions and Medium severity to content, topic, and sensitive-information interventions; the records exclude prompt and response content.
  • Because Bedrock Guardrails is not supported by CloudWatch’s native ParseToOCSF processor, the solution uses a custom transform. Custom-source records are stored as OCSF JSON in a managed cwl__message column.
  • Athena queries can correlate guardrail findings with CloudTrail and VPC Flow Logs for identity, network, and historical trend analysis; CloudWatch Logs Insights supports real-time operational queries.
  • The monitoring stack provides a dashboard and alarms for intervention counts, transform errors, dead-letter queue depth, and Lambda duration. Failed records go to an SQS dead-letter queue for analysis and redrive.
  • For multi-account deployments, AWS recommends transforming logs in workload accounts and centralizing the OCSF output, limiting the movement of raw invocation logs that may contain prompt and response content.

Article Details

Defense Focus
Normalize AWS Bedrock Guardrails intervention events into OCSF Detection Findings so security teams can correlate them with identity, network, and other security telemetry.
Detection Methods
  • Filter model invocation logs for guardrail actions marked INTERVENED, then transform each guardrail assessment into a separate OCSF Detection Finding.
  • Use GuardDuty AI Protection findings for direct prompt injection and anomalous model invocation activity as a complementary detection layer.
  • Correlate prompt injection interventions by user account with failed CloudTrail API activity or privilege changes.
  • Correlate prompt injection interventions with source IP addresses in VPC Flow Logs.
  • Trend violations by policy type and compare activity with a 30-day baseline to identify spikes or changes.
Data Sources
  • AWS Bedrock model invocation logs containing guardrail trace data
  • AWS CloudTrail management and Bedrock data events
  • AWS VPC Flow Logs
  • OCSF guardrail Detection Finding records
Rule Types
  • CloudWatch Logs subscription filter pattern matching INTERVENED guardrail events
  • Athena SQL queries using json_extract_scalar to read OCSF JSON fields
  • CloudWatch Logs Insights queries filtering OCSF Detection Finding records
Platforms
  • AWS multi-account environment
Defensive Actions
  • Enable AWS Bedrock model invocation logging with guardrail trace data enabled.
  • Deploy the transform pipeline in each workload account; route processing failures to a dead-letter queue.
  • Associate the destination log group with AWS S3 Tables and grant query principals the required Lake Formation permissions.
  • For multi-account deployments, centralize the sanitized OCSF output rather than raw invocation logs when following the recommended pattern.
  • Monitor intervention counts, transform errors, Lambda duration, and dead-letter queue depth; configure alarms for error rates above 5%, nonzero dead-letter queue depth, and p99 Lambda duration above 10 seconds.

Vendors

Products

Amazon GuardDutyAWS GuardDuty already helps here: its AI Protection feature analyzes CloudTrail data events from AWS Bedrock and produces managed threat findings, including a direct prompt injection finding and anomalous modelAWS Athenaand endpoint data, including AWS CloudTrail and AWS Virtual Private Cloud (AWS VPC) Flow Logs, using AWS Athena or CloudWatch Logs Insights.AWS BedrockAWS Bedrock publishes this telemetry to AWS CloudWatch metrics and model invocation logs for operational monitoring.AWS CloudTrailthreat analysts can query guardrail events alongside identity, network, and endpoint data, including AWS CloudTrail and AWS Virtual Private Cloud (AWS VPC) Flow Logs, using AWS Athena or CloudWatch Logs Insights.AWS CloudWatchAWS Bedrock publishes this telemetry to AWS CloudWatch metrics and model invocation logs for operational monitoring.AWS Lake FormationThe first time you do this in a Region, AWS S3 creates a service role that lets AWS Lake Formation federate access to your tables in the AWS Glue Data Catalog.AWS Lambdafrom AWS Bedrock model invocation logs, transforms them into OCSF Detection Finding records with an AWS Lambda function, and lands them in the CloudWatch unified data store, where SOC analysts query them withAWS S3 TablesThe CloudWatch unified data store provides Apache Iceberg-compatible access through AWS S3 Tables, CloudWatch Logs Insights queries, and, for supported sources, built-in OCSF normalization at ingestion.AWS SNSNotifications are sent through AWS Simple Notification Service (AWS SNS).AWS SQSIf the Lambda function fails to process a record, the message routes to an AWS Simple Queue Service (AWS SQS) dead-letter queue for later analysis and redrive.CloudWatch Logs Insightsincluding AWS CloudTrail and AWS Virtual Private Cloud (AWS VPC) Flow Logs, using AWS Athena or CloudWatch Logs Insights.

Related Articles