Check ID: awslambda_function_env_vars_not_encrypted_with_cmk
Provider: AWS
Service: awslambda
Severity: MEDIUM
Categories: encryption
Resource type: AwsLambdaFunction

What this check verifies

AWS Lambda function environment variables are encrypted at rest using a customer-managed KMS key (CMK) rather than the default AWS-managed Lambda service key. The presence of a KMSKeyArn on the function configuration indicates CMK-based encryption is active.

Risk

Without a CMK, environment variables are encrypted with an AWS-managed key, removing customer control over rotation, auditing, and revocation. If variables contain secrets or connection strings, loss of key control weakens confidentiality and can fail compliance requirements (PCI-DSS, HIPAA, FedRAMP) that mandate customer-controlled encryption.

Recommendation

Encrypt Lambda environment variables with a customer-managed KMS key to maintain full control over key lifecycle and access.
  • Create a dedicated KMS key per application or per function for blast-radius isolation
  • Enable automatic key rotation (EnableKeyRotation: true)
  • Grant only the Lambda execution role decrypt access via a key policy condition on kms:ViaService
  • Prefer AWS Secrets Manager or SSM Parameter Store (SecureString) for secrets — environment variables should hold non-secret configuration only

Remediation

aws lambda update-function-configuration —function-name <function-name> —kms-key-arn <cmk-arn>

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = awslambda_function_env_vars_not_encrypted_with_cmk. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks