Skill 2.3.5

Implement application-level data masking and sanitization

Key Concepts

Applications can mask data in code before logging, displaying or sharing it. Powertools for AWS Lambda includes a data masking utility that can erase fields or encrypt them with KMS so only authorised consumers can decrypt them.

CloudWatch Logs data protection policies detect sensitive data such as email addresses, credentials and card numbers in log events and mask them automatically; only principals with the logs:Unmask permission can view the original values. Amazon SNS message data protection policies can similarly audit, mask or block sensitive data in published messages, although the feature closed to new customers on 30 April 2026, so new applications mask sensitive fields in code before publishing.