Skip to content

Commit

Permalink
adds policy to check kms on lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Rodriguez committed Oct 7, 2020
1 parent ed26230 commit 7ed87c5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "lambdaNotEncryptedWithKms",
"file": "lambdaNotEncryptedWithKms.rego",
"template_args": {
"prefix": ""
},
"severity": "High",
"description": "Lambda does not have KMS key to protect environment variables.",
"reference_id": "AWS.LambdaFunction.EncryptionandKeyManagement.High.0471",
"category": "Encryption and Key Management",
"version": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package accurics

#{{.prefix}}lambdaNotEncryptedWithKms[retVal] {
#lambda := input.aws_lambda_function[_]
#lambda.config.kms_key_arn == null
#traverse = ""
# retVal := { "Id": lambda.id, "ReplaceType": "edit", "CodeType": "attribute", "Traverse": traverse, "Attribute": "kms_key_arn", "AttributeDataType": "string", "Expected": "<kms_key_arn>", "Actual": null }
#}

lambdaNotEncryptedWithKms[lambda.id] {
lambda := input.aws_lambda_function[_]
not lambda.config.kms_key_arn
}

0 comments on commit 7ed87c5

Please sign in to comment.