More Info:
Bedrock Service should enable model invocation loggingRisk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- ISO/IEC 27018
- ISO/IEC 27701
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- StateRAMP
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are concise, console-based steps to enable Model Invocation Logging for Amazon Bedrock.
Enabling this at the account/Regional level via the Model invocation logging settings ensures the misconfiguration (“Bedrock Service Should Enable Model Invocation Logging”) is remediated for that Region. Repeat for other Regions if required by your policy.
1. Prerequisites
- CloudWatch log group (optional – you can create it during setup):
- Go to CloudWatch → Logs → Log groups → Create log group.
- S3 bucket for storing logs:
- Go to S3 → Create bucket (or pick an existing bucket).
- IAM role for Bedrock logging (can also be auto-created):
- Role will need permissions to:
logs:CreateLogStream,logs:PutLogEventson the log groups3:PutObjecton the S3 bucket
- Role will need permissions to:
2. Open Bedrock Model Invocation Logging
- In the AWS Console, go to Amazon Bedrock.
- In the left navigation pane, select Model invocation logging (sometimes under Settings or Data and governance, depending on the UI).
3. Enable Model Invocation Logging
- On the Model invocation logging page, choose Enable (or Edit if partially configured).
- Under Logging destinations, configure:
- CloudWatch Logs:
- Select Enable CloudWatch Logs.
- Choose an existing Log group or create a new one.
- Amazon S3:
- Select Enable S3 logging.
- Choose the S3 bucket and an optional prefix/folder for logs.
- CloudWatch Logs:
4. Select What to Log
- Under Request logging, choose if you want to log:
- Input prompts/parameters
- Output responses
- Any specific content types (e.g., text, images), if offered.
- Choose All models or Specific models based on your policy.
- If available, configure:
- Redaction / anonymization options for sensitive fields.
- Truncation limits for large payloads.
5. Configure IAM Role for Logging
- Under IAM role or Execution role, choose:
- Create new role: let Bedrock create one with the necessary permissions; or
- Use existing role: select an IAM role that has:
- Access to the specified CloudWatch log group.
- Access to write logs to the S3 bucket.
- Save or apply the role selection.
6. Save and Verify
- Click Save, Apply, or Enable logging (label may vary).
- Test:
- Invoke a model via the Bedrock console playground or your application.
- Check:
- CloudWatch → Logs → Log groups → your log group → latest log stream for entries.
- S3 → your bucket → prefix for new log objects.
Enabling this at the account/Regional level via the Model invocation logging settings ensures the misconfiguration (“Bedrock Service Should Enable Model Invocation Logging”) is remediated for that Region. Repeat for other Regions if required by your policy.
Using CLI
Using CLI
To enable Bedrock model invocation logging via AWS CLI you:
(If the bucket already exists, skip.)
Create the role:Note the returned
Adjust bucket name, region, and log group ARN.Save asAttach the policy to the role:
Then call:
You should see your
-
Decide where to send logs
Bedrock supports three destinations (you can use one or more):- Amazon S3
- CloudWatch Logs
- Kinesis Data Firehose
1. Create / choose a log destination
Option A – S3 bucket for logs
Option B – CloudWatch Logs log group
2. Create IAM role for Bedrock logging
Bedrock needs an IAM role it can assume to write logs.2.1 Trust policy
Save asbedrock-logging-trust.json:Arn, e.g.:arn:aws:iam::123456789012:role/BedrockInvocationLoggingRole2.2 Permissions policy for S3 and/or CloudWatch Logs
Example policy for both S3 and CloudWatch Logs.Adjust bucket name, region, and log group ARN.Save as
bedrock-logging-permissions.json:3. Enable model invocation logging in Bedrock
Useput-model-invocation-logging-configuration.Create bedrock-logging-config.json (S3 + CloudWatch Logs example):4. Verify configuration
loggingConfig with enabled/delivery flags set to true. Logs will start appearing when you invoke models via Bedrock in that account/region.Using Python
Using Python
To remediate “Bedrock Service Should Enable Model Invocation Logging” using Python, you need to configure Bedrock’s model invocation logging via the
Then use this Python script (adjust ARNs, regions, bucket names):
Confirm:
PutModelInvocationLoggingConfiguration API (boto3: put_model_invocation_logging_configuration).Below are the step‑by‑step instructions and a minimal Python example.1. Prerequisites
-
AWS Permissions
The IAM principal running the script needs (at minimum):
-
Create an IAM role for logging (if you don’t have one)
This role is assumed by the Bedrock service to write logs to CloudWatch and S3.
Trust policy (trust relationship):
Permissions policy attached to that role (adjust ARNs as needed):Note the role ARN (e.g.
arn:aws:iam::123456789012:role/bedrock-logging-role). -
Create destinations
- CloudWatch Log Group (optional but recommended):
e.g./aws/bedrock/model-invocations - S3 bucket for logs:
e.g.your-bedrock-logs-bucket(and optional prefix, e.g.bedrock/invocations/)
- CloudWatch Log Group (optional but recommended):
2. Python: Enable Bedrock Model Invocation Logging
Install boto3 if needed:3. Verify the Configuration
Use:cloudWatchConfig.enabledisTrue(if used)s3Config.enabledisTrue(if used)- The correct
roleArnis set - Test a Bedrock model invocation and check:
- CloudWatch Logs → Log group
/aws/bedrock/model-invocations - S3 →
s3://your-bedrock-logs-bucket/bedrock/invocations/
- CloudWatch Logs → Log group

