forked from stackrox/stackrox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch-stackrox-data.sh
More file actions
executable file
·24 lines (19 loc) · 1005 Bytes
/
fetch-stackrox-data.sh
File metadata and controls
executable file
·24 lines (19 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
# Fetches data used by the stackrox:main image
set -euo pipefail
fetch_stackrox_data() {
mkdir -p /stackrox-data/cve/istio
wget -O /stackrox-data/cve/istio/checksum "https://definitions.stackrox.io/cve/istio/checksum"
wget -O /stackrox-data/cve/istio/cve-list.json "https://definitions.stackrox.io/cve/istio/cve-list.json"
mkdir -p /tmp/external-networks
local latest_prefix
latest_prefix="$(wget -q https://definitions.stackrox.io/external-networks/latest_prefix -O -)"
wget -O /tmp/external-networks/checksum "https://definitions.stackrox.io/${latest_prefix}/checksum"
wget -O /tmp/external-networks/networks "https://definitions.stackrox.io/${latest_prefix}/networks"
test -s /tmp/external-networks/checksum
test -s /tmp/external-networks/networks
mkdir /stackrox-data/external-networks
zip -jr /stackrox-data/external-networks/external-networks.zip /tmp/external-networks
rm -rf /tmp/external-networks
}
fetch_stackrox_data