Created
September 11, 2025 00:50
-
-
Save blacknon/1c5d850fab2fd164a868e05e6e2fcc3f to your computer and use it in GitHub Desktop.
NVDからCVE-IDの情報を聞いて必要データだけTSVにするjqコマンド
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
#!/bin/bash | |
curl -s 'https://services.nvd.nist.gov/rest/json/cves/2.0?cveId='$CVEID \ | |
| jq -r ' | |
.vulnerabilities[].cve as $cve | |
| ($cve.references[0].url // ("https://nvd.nist.gov/vuln/detail/" + $cve.id)) as $url | |
| [ | |
( | |
($cve.metrics.cvssMetricV31 // []) | |
| max_by(.cvssData.baseScore) | |
| [$cve.id, .source, .cvssData.version, .cvssData.baseSeverity, (.cvssData.baseScore|tostring), $cve.published, $url] | |
) | |
] | |
| (["CVE-ID","CVSS付与機関","CVSSのバージョン","脅威度スコア","ベーススコア","情報公開日","URL"] | @tsv), | |
(.[] | @tsv) | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment