Troubleshooting and Optimization
An application logs complete HTTP request headers to CloudWatch Logs, including bearer tokens. Developers need request context for troubleshooting without storing credentials. What should they do?
Show the answer
Correct answerA. Allowlist safe header fields and omit tokens before logging
AWhy this is right: Selecting safe fields before emission preserves troubleshooting context without recording bearer tokens.
BWhy not this: Short retention reduces storage duration but still records credentials during that period.
CWhy not this: Encryption protects data at rest but does not prevent credentials from being stored in logs.
DWhy not this: Access restrictions reduce exposure but still leave credentials stored in the logs.
Allowlisting safe fields prevents credentials from entering logs while preserving useful request context. Encryption protects stored logs but still stores the bearer tokens.