Created
December 14, 2018 10:00
-
-
Save FnTm/afe56624e41bbbcbd467320660765593 to your computer and use it in GitHub Desktop.
This script parses a Scout2 output to produce a summary with findings reduced and grouped based on their level
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
# This script parses a Scout2 output to produce a summary with findings reduced and grouped based on their level | |
tail -n +2 scout2-report/inc-awsconfig/aws_config.js \ Fri Dec 14 11:51:04 2018 | |
| jq '.services[].findings | with_entries( select(.value | has("flagged_items") ) ) | with_entries( select(.value.flagged_items >0 ) ) | select(keys | length >0) | map(select(.flagged_items>0))' \ | |
| jq -s '. | flatten | group_by(.level) |map({"level": .[0].level, value: map(.flagged_items) | add})' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment