fix(query): fixs for a lot of cli query warnings when scanning 'assets' folder #8012
Draft
cx-andre-pereira wants to merge 2 commits intoCheckmarx:masterfrom
Draft
fix(query): fixs for a lot of cli query warnings when scanning 'assets' folder #8012cx-andre-pereira wants to merge 2 commits intoCheckmarx:masterfrom
cx-andre-pereira wants to merge 2 commits intoCheckmarx:masterfrom
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
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.
Reason for Proposed Changes
searchKey" values that are not functional :searchLine" value to determine the line the query should flag, but both "search" values should be valid regardless of this.Proposed Changes
Major rework to the
ansible/azure/azure_instance_using_basic_authenticationquery, the current implementation does not seem to align with the metadata's descriptionSSH Key instead of basic authentication", and yet we are checking that "disable_password_authentication" isfalserather than checking if it istrue.For most other queries were only the "searchKey" value suffered changes a common issue was the use of square brackets to select fields inside a given object from the payload, turns out something like "
resources[%s].properties" and similar references often does not work, i suspect this is due to the use of the dot right after the brackets, regardless changing these to exclusively use dot notation fixed the issues: ("resources.%s.properties").With these changes a little over half the warnings are gone, the ones still in place are almost all terraform queries where the warning will not show itself when scanning the test samples associated with each query only. This is likely due to issues searching the target resource in the (large) resulting payload from the full assets scan. (a scan on
assets/queries/terrafomwill have a similar effect)TODO : research more details on remaining warnings and whether they can also be fixed relatively easily
TODO : details on changes to crossplane/aws/rds_db_instance_publicly_accessible
I submit this contribution under the Apache-2.0 license.