Skip to content

Commit 5ed8c04

Browse files
elelayshAlex-Welsh
authored andcommitted
Fix allowed vulnerability list not reset between images
1 parent fa49afc commit 5ed8c04

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tools/scan-images.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ file_prep() {
4646
# Gather image lists
4747
get_images() {
4848
local output_file="$1-scanned-container-images.txt"
49-
49+
5050
docker image ls \
5151
--filter "reference=ark.stackhpc.com/stackhpc-dev/*:$2*" \
5252
--format "{{.Repository}}:{{.Tag}}" \
5353
> "$output_file"
54-
54+
5555
cat "$output_file"
5656
}
5757

@@ -63,7 +63,7 @@ generate_trivy_ignore() {
6363
local image_vulnerabilities
6464
image_vulnerabilities=$(yq ."$imagename"'_allowed_vulnerabilities[]' src/kayobe-config/etc/kayobe/trivy/allowed-vulnerabilities.yml 2> /dev/null)
6565

66-
touch .trivyignore
66+
truncate -s 0 .trivyignore # ensure we start from a clean slate
6767
for vulnerability in $global_vulnerabilities; do
6868
echo "$vulnerability" >> .trivyignore
6969
done

0 commit comments

Comments
 (0)