Skip to content

custom cofig rules DYNAMODB_TABLE_ENCRYPTED_KMS and SQS_ENCRYPTED_KMS #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sandeep7568
Copy link

@sandeep7568 sandeep7568 commented Mar 4, 2020

I confirm these files are made available under CC0 1.0 Universal (https://creativecommons.org/publicdomain/zero/1.0/legalcode)

Issue #, if available:

Description of changes:
custom cofig rule to check the dynamodb table is encrypted with KMS

@sandeep7568 sandeep7568 changed the title custom cofig rule to check the dynamodb table is encrpted or not custom cofig rule to check the dynamodb table is encrypted with KMS Mar 4, 2020
@sandeep7568 sandeep7568 reopened this Mar 10, 2020
@sandeep7568 sandeep7568 changed the title custom cofig rule to check the dynamodb table is encrypted with KMS custom cofig rules DYNAMODB_TABLE_ENCRYPTED_KMS and SQS_ENCRYPTED_KMS Apr 13, 2020
Scenario: 7
Given: Amazon DynamoDB table is active
And: KmsKeyArns Rule Parameter provided
And: Amazon DynamoDB table is not encrypted with with provided KmsKeyArns Rule Parameter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one "with"

Then: Return NON_COMPLIANT
Scenario: 6
Given: Amazon DynamoDB table is active
And: KmsKeyArns Rule Parameter provided

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make "Rule Parameter" to lower case

Scenario: 6
Given: Amazon DynamoDB table is active
And: KmsKeyArns Rule Parameter provided
And: Amazon DynamoDB table is encrypted with provided KmsKeyArns Rule Parameter

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Then: Return COMPLIANT
Scenario: 7
Given: Amazon DynamoDB table is active
And: KmsKeyArns Rule Parameter provided

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

if kms_key:
if not kms_arn_list or kms_key in kms_arn_list:
return [Evaluation(ComplianceType.COMPLIANT)]
return [Evaluation(ComplianceType.NON_COMPLIANT, annotation="AWS KMS key '{}' used to encrypt the Amazon SQS Queue is not in rule_paramter 'KmsKeyArns'".format(kms_key))]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation length has limit make sure it should not exceed 255 characters as kms_key is dynamic value

And: Any key in "KmsKeyArns" is invalid
Then: Return ERROR
Scenario: 2
Given: Rules parameter is provided

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is returning Success valid scenario ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants