Created
June 7, 2022 16:46
-
-
Save cromwellryan/eceadda350e9945ca39052df50fe7b2c to your computer and use it in GitHub Desktop.
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
# Generate an audit report of High & Critical advisories | |
yarn audit --json --level high > audit.lines | |
# Transform from JSON-lines to JSON format | |
jq -s '.' audit.lines > audit.json | |
# Extract advisories | |
jq -r '.[] | | |
select(.type == "auditAdvisory") | | |
{ severity: .data.advisory.severity, path: .data.resolution.path, cves: (.data.advisory.cves | @csv), module_name: .data.advisory.module_name } | | |
select(.severity == "critical" or .severity == "high") | | |
[.severity, .module_name, .path, .cves] | | |
@csv' \ | |
audit.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment