Check ID:
Provider: AWS
Service:
Severity: MEDIUM
Categories:
Resource type:
awslambda_function_env_vars_not_encrypted_with_cmkProvider: AWS
Service:
awslambdaSeverity: MEDIUM
Categories:
encryptionResource type:
AwsLambdaFunctionWhat 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 aKMSKeyArn 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
- CLI
- Terraform
- Native IaC
- Dashboard steps
aws lambda update-function-configuration —function-name <function-name> —kms-key-arn <cmk-arn>
References
- https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption
- https://docs.aws.amazon.com/securityhub/latest/userguide/lambda-controls.html
- https://docs.aws.amazon.com/kms/latest/developerguide/services-lambda.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck 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