-
Notifications
You must be signed in to change notification settings - Fork 357
fix(queries): better interpreter for gcp queries #7912
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
cx-andre-pereira
wants to merge
12
commits into
master
Choose a base branch
from
AST-126467-update-metric-log-filter-to-be-more-permissive
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix(queries): better interpreter for gcp queries #7912
cx-andre-pereira
wants to merge
12
commits into
master
from
AST-126467-update-metric-log-filter-to-be-more-permissive
+652
−94
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
…ve' of https://github.com/Checkmarx/kics into AST-126467-update-metric-log-filter-to-be-more-permissive
…26467-update-metric-log-filter-to-be-more-permissive
…26467-update-metric-log-filter-to-be-more-permissive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








Closes #
Reason for Proposed Changes
CIS_Google_Cloud_Platform_Foundation_Benchmark_v4.0.0.Proposed Changes
All the three queries, does the same verifications:
The only thing that changes is the way they analyse the filter:
The query
Beta - Logs And Alerts Missing Custom Role Changeschecks if the resource.type includes the mandatoryiam_role. Also checks through thecontains_methodhelper function if all 4 target methods are included(protoPayload.methodName = ("google.iam.admin.v1.CreateRole", "google.iam.admin.v1.UndeleteRole", "google.iam.admin.v1.UpdateRole", "google.iam.admin.v1.DeleteRole")If the methods are not all defined, there are two valid alternatives:
Also the filter will be considered improper if any contraditory condition is defined.
The query
Beta - Logs And Alerts Missing Project Ownership Assignment And Changesuses a similar approach as above, but checking if the serviceName is defined toprotoPayload.serviceName="cloudresourcemanager.googleapis.com", if it hasProjectOwnership OR projectOwnerInvitee(or vice versa). Also verifies that for the roleroles/ownerit has the actions "REMOVE" and "ADD".The query
Beta - Logs And Alerts Missing Audit Configuration Changesis simpler, it just checks if the methodName is defined toSetIamPolicyand ifprotoPayload.serviceData.policyDelta.auditConfigDeltasis defined to*.I submit this contribution under the Apache-2.0 license.