Skip to content

Instantly share code, notes, and snippets.

@FnTm
Created December 14, 2018 10:00
Show Gist options
  • Save FnTm/afe56624e41bbbcbd467320660765593 to your computer and use it in GitHub Desktop.
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 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