-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(terraform): CKV_GCP_74, CKV_GCP_76 incorrectly enforced for REGIONAL and GLOBAL managed proxy networks #7002
base: main
Are you sure you want to change the base?
Conversation
…google_access check
…olicy filename and class name
…urposes' into CKV_GCP_74-handle-purposes
Can I get a review? |
Anyone? Need me to provide anything additional? Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Thanks for the contribution! 🚀
@@ -5,6 +5,8 @@ | |||
from checkov.common.models.enums import CheckCategories, CheckResult | |||
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck | |||
|
|||
# private_ip_google_access is not supported for subnetworks with the following purpose set | |||
PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY"] | |
PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY", "PRIVATE_SERVICE_CONNECT", "PRIVATE_NAT"] |
I believe these should also be excluded
At that point I wonder if we shouldn't flip the logic and apply check only
to PRIVATE
…On Fri, Feb 21, 2025, 5:18 PM Taylor ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
checkov/terraform/checks/resource/gcp/GoogleSubnetworkPrivateGoogleEnabled.py
<#7002 (comment)>
:
> @@ -5,6 +5,8 @@
from checkov.common.models.enums import CheckCategories, CheckResult
from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+# private_ip_google_access is not supported for subnetworks with the following purpose set
+PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY"]
⬇️ Suggested change
-PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY"]
+PURPOSE_EXCEPTIONS = ["INTERNAL_HTTPS_LOAD_BALANCER", "REGIONAL_MANAGED_PROXY", "GLOBAL_MANAGED_PROXY", "PRIVATE_SERVICE_CONNECT", "PRIVATE_NAT"]
I believe these should also be excluded
—
Reply to this email directly, view it on GitHub
<#7002 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF26ZXIKRTRXXMRQI4E4D32Q6X6FAVCNFSM6AAAAABWW7UT7OVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMZUGQ2TSOJSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jbrule that makes sense and works for me. |
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
Simular to log_config REGIONAL_MANAGED_PROXY and GLOBAL_MANAGED_PROXY networks do not support private_ip_google_access
Fixes #5730
Fixed CKV_GCP_74
Fixed CKV_GCP_76 by
Description
It is NOT a violation. That is the point of this fix.
Fix
N/A
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Modifies the GoogleSubnetworkIPV6PrivateGoogleEnabled and GoogleSubnetworkPrivateGoogleEnabled checks to correctly handle REGIONAL_MANAGED_PROXY and GLOBAL_MANAGED_PROXY networks. Updates the corresponding test files to include new test cases for these network types. Renames some classes and variables for consistency.
Modified files (2)
Latest Contributors(2)
Modified files (4)
Latest Contributors(2)