Skip to content
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

feat(terraform): Add check - ensure AWS CodeGuru resource contains CMK #6851

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

talazuri
Copy link
Contributor

@talazuri talazuri commented Nov 18, 2024

User description

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

feat(terraform): Add CKV_AWS_381 to ensure that AWS CloudGuru has CMK

Fixes # (issue)

New/Edited policies (Delete if not relevant)

CKV_AWS_381

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

Generated description

Below is a concise technical summary of the changes proposed in this PR:

Introduce a new Terraform check CKV_AWS_381 to ensure that aws_codegurureviewer_repository_association resources are configured with a Customer Managed Key (CMK) for encryption. The check, implemented in AWSCodeGuruHasCMK, verifies the presence of kms_key_details with encryption_option set to CUSTOMER_MANAGED_CMK. Accompanying tests in test_AWSCodeGuruHasCMK.py validate the check's effectiveness by simulating various scenarios, including passing and failing configurations.

TopicDetails
Unit Testing Validate the new check with unit tests to ensure it correctly identifies compliant and non-compliant resources.
Modified files (2)
  • tests/terraform/checks/resource/aws/test_AWSCodeGuruHasCMK.py
  • tests/terraform/checks/resource/aws/example_AWSCodeGuruHasCMK/AWSCodeGuruHasCMK.tf
Latest Contributors(0)
UserCommitDate
CMK Encryption Check Implement a new Terraform check AWSCodeGuruHasCMK to ensure AWS CodeGuru resources use CMK for encryption.
Modified files (1)
  • checkov/terraform/checks/resource/aws/AWSCodeGuruHasCMK.py
Latest Contributors(0)
UserCommitDate
This pull request is reviewed by Baz. Join @talazuri and the rest of your team on (Baz).

Sorry, something went wrong.

Copy link
Contributor

@SteveVaknin SteveVaknin left a comment

Choose a reason for hiding this comment

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

Nice 👌

@OfekShimko
Copy link
Contributor

Good job!

@talazuri talazuri merged commit 3be287a into main Nov 18, 2024
42 checks passed
@talazuri talazuri deleted the codeguru-cmk-check branch November 18, 2024 15:59
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.

None yet

4 participants