Skip to main content

More Info:

Bedrock Service should enable model invocation logging

Risk Level

Medium

Address

Security

Compliance 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

Using Console

Below are concise, console-based steps to enable Model Invocation Logging for Amazon Bedrock.

1. Prerequisites

  1. CloudWatch log group (optional – you can create it during setup):
    • Go to CloudWatch → Logs → Log groups → Create log group.
  2. S3 bucket for storing logs:
    • Go to S3 → Create bucket (or pick an existing bucket).
  3. IAM role for Bedrock logging (can also be auto-created):
    • Role will need permissions to:
      • logs:CreateLogStream, logs:PutLogEvents on the log group
      • s3:PutObject on the S3 bucket

2. Open Bedrock Model Invocation Logging

  1. In the AWS Console, go to Amazon Bedrock.
  2. 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

  1. On the Model invocation logging page, choose Enable (or Edit if partially configured).
  2. 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.

4. Select What to Log

  1. Under Request logging, choose if you want to log:
    • Input prompts/parameters
    • Output responses
    • Any specific content types (e.g., text, images), if offered.
  2. Choose All models or Specific models based on your policy.
  3. If available, configure:
    • Redaction / anonymization options for sensitive fields.
    • Truncation limits for large payloads.

5. Configure IAM Role for Logging

  1. 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.
  2. Save or apply the role selection.

6. Save and Verify

  1. Click Save, Apply, or Enable logging (label may vary).
  2. 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.
To enable Bedrock model invocation logging via AWS CLI you:
  1. Decide where to send logs
    Bedrock supports three destinations (you can use one or more):
    • Amazon S3
    • CloudWatch Logs
    • Kinesis Data Firehose
    I’ll show S3 and CloudWatch Logs, which are most common.

1. Create / choose a log destination

Option A – S3 bucket for logs

(If the bucket already exists, skip.)

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 as bedrock-logging-trust.json:
Create the role:
Note the returned Arn, e.g.:arn:aws:iam::123456789012:role/BedrockInvocationLoggingRole

2.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:
Attach the policy to the role:

3. Enable model invocation logging in Bedrock

Use put-model-invocation-logging-configuration.Create bedrock-logging-config.json (S3 + CloudWatch Logs example):
Then call:

4. Verify configuration

You should see your loggingConfig with enabled/delivery flags set to true. Logs will start appearing when you invoke models via Bedrock in that account/region.
To remediate “Bedrock Service Should Enable Model Invocation Logging” using Python, you need to configure Bedrock’s model invocation logging via the PutModelInvocationLoggingConfiguration API (boto3: put_model_invocation_logging_configuration).Below are the step‑by‑step instructions and a minimal Python example.

1. Prerequisites

  1. AWS Permissions The IAM principal running the script needs (at minimum):
  2. 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).
  3. 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/)

2. Python: Enable Bedrock Model Invocation Logging

Install boto3 if needed:
Then use this Python script (adjust ARNs, regions, bucket names):

3. Verify the Configuration

Use:
Confirm:
  • cloudWatchConfig.enabled is True (if used)
  • s3Config.enabled is True (if used)
  • The correct roleArn is set
  • Test a Bedrock model invocation and check:
    • CloudWatch Logs → Log group /aws/bedrock/model-invocations
    • S3 → s3://your-bedrock-logs-bucket/bedrock/invocations/
Enabling this configuration remediates the finding that Bedrock model invocation logging is not enabled.