- Newest
- Most votes
- Most comments
When configuring AWS Systems Manager Session Manager to send logs to an encrypted CloudWatch Logs log group, you need to ensure the correct principals have permission to use the KMS key.
For CloudWatch Logs encryption, you should grant permissions to the CloudWatch Logs service principal. The correct service principal to include in your KMS key policy is delivery.logs.amazonaws.com, which needs the kms:Decrypt permission to decrypt your logs.
Additionally, both the users who start sessions and the managed nodes they connect to must have permission to use the KMS key. You provide these permissions through IAM policies:
- Users who start sessions need KMS permissions in their IAM policies
- Managed nodes need KMS permissions in their instance profiles or IAM roles
Your current policy includes ssm.amazonaws.com as a service principal, but for CloudWatch Logs encryption specifically, you need to ensure delivery.logs.amazonaws.com has the necessary permissions.
Make sure your KMS key policy grants the appropriate permissions to all required entities to ensure your encrypted session logs can be properly delivered to CloudWatch Logs.
Sources
Strengthening data security in AWS Step Functions with a customer-managed AWS KMS key | AWS Compute Blog
Turn on KMS key encryption of session data (console) - AWS Systems Manager
Update Session Manager preferences (command line) - AWS Systems Manager
answered a year ago
KMS operations are logged by CloudTrail by default, so the simplest way to identify KMS issues is often simply to look for the relevant event names (probably GenerateDataKey in this case) in the CloudTrail event search console in the same region where the key resides. Expose the "Error code" column in the table view to distinguish between successful and failed events at a glance. The KMS log event usually shows the necessary details, such as the calling principal, for constructing the proper key policy statement.
Relevant content
asked a year ago
asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
