-
-
Save neatshell/f2212038aebcc5c1150708b07004df62 to your computer and use it in GitHub Desktop.
This file contains 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
level=${1-critical} | |
# Generate an audit report of Level or Critical advisories | |
yarn audit --json --level "${level}" > 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