blob: c2b1f8ffa73e6dbdf3e3a7ece2017c5e2ffa0626 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Provider for MITRE
# https://www.mitre.org/
tmp_mitre=""
init_mitre()
{
tmp_mitre=$(mktemp "${TMPDIR:-/tmp}"/mitre.XXXXXXXXXX) || exit 1
fetch -q -o "${tmp_mitre}" https://cveawg.mitre.org/api/cve/"${CVE_ID}"
}
cleanup_mitre()
{
rm "${tmp_mitre}" 2>/dev/null
}
get_cvename_from_mitre()
{
cvename="${CVE_ID}"
echo "${cvename}"
}
get_cveurl_from_mitre() {
echo https://cveawg.mitre.org/api/cve/"${CVE_ID}"
}
get_details_from_mitre() {
jq -r '.containers?.cna?.descriptions[0]?.value' "${tmp_mitre}" | fmt -p -s
}
get_discovery_date_from_mitre() {
jq -r '.cveMetadata?.datePublished?' "${tmp_mitre}" | cut -f1 -dT
}
get_entry_date_from_mitre() {
echo "${entry_date}"
}
get_product_name_from_mitre() {
jq -r '.containers?.cna?.affected[]?.product' "${tmp_mitre}"
}
get_product_range_from_mitre() {
jq -r '.containers?.cna?.affected[]??.versions[0]?.lessThan' "${tmp_mitre}"
}
get_package_name_from_mitre() {
jq -r '.containers?.cna?.affected[0]?.product' "${tmp_mitre}"
}
get_references_from_mitre() {
jq -r '.containers?.cna?.references[0]?.url' "${tmp_mitre}" | fmt -p -s
}
get_source_from_mitre() {
jq -r '.containers?.cna?.references[0]?.url' "${tmp_mitre}"
}
get_topic_from_mitre() {
jq -r ".containers?.cna?.problemTypes[0]?.descriptions[0]?.description" "${tmp_mitre}"
}
|