fix(terraform): CKV_GCP_32 (GoogleComputeBlockProjectSSH) Add other common enabling values #6663
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
New/Edited policies (Delete if not relevant)
Description
We have a well established doctrine for this setting and that was to use the following hcl. Unfortunately policy CKV_GCP_32 will fail this (in terraform mode, it detects properly in terraform_json) even though the result is Google enables the setting upon apply.
Checklist:
Generated description
Dear maintainer, below is a concise technical summary of the changes proposed in this PR:
Enhance the
GoogleComputeBlockProjectSSH
class to correctly handle various truthy values for theblock-project-ssh-keys
metadata key in Google Compute resources. This change ensures that the policy CKV_GCP_32 does not fail when these values are used in Terraform configurations. Theget_expected_values
method now returns a list of acceptable truthy values, includingTrue
, "true", "True", and "TRUE". Additionally, the test suite for this policy has been refactored to consolidate test cases and improve coverage, ensuring that both passing and failing scenarios are accurately captured.GoogleComputeBlockProjectSSH
to ensure comprehensive coverage of both passing and failing scenarios.Modified files (4)
Latest Contributors(2)
GoogleComputeBlockProjectSSH
class to handle multiple truthy values for theblock-project-ssh-keys
metadata key.Modified files (1)
Latest Contributors(2)