Use resourcetype params for AWS resource enumeration - #65
Open
bencehezso wants to merge 1 commit into
Open
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.
Summary
The AWS scanner derived each boto3 call by splitting
resourcetype.codeon.and requiring exactly four parts:AWS.<service>.<operation>.<resultKey>. That format cannot express a nested result path or extra API arguments, so any catalogue row needing either was silently skipped. The master data now carries aparamsJSON column holding the call spec explicitly, and the scanner prefers it.{ "service": "cloudfront", "operation": "list_distributions", "result_path": ["DistributionList", "Items"], "kwargs": {"OwnerIds": ["self"]} }What changes
resolve_aws_call_spec()takes params when it carries bothserviceandoperation, otherwise derives from the code. Unknown params keys are ignored, since master data ships ahead of app releases, and rows for the other cloud carry unrelated params, so usability is detected by probing for the keys rather than testing for a non-empty object.>= 4, so both paths agree on what a valid code is. This alone fixes CloudFront and Pinpoint even without params.AWS.iam,AWS.cleanrooms, 46 rows) log at DEBUG. Anything that parses as neither is catalogue corruption and logs a WARNING; this is the previously commented-out warning, restored with the corrected condition.