From 9759187ff08973e443ca19e83293c38c21a3bb16 Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 2 Dec 2021 10:12:33 +0800 Subject: [PATCH 1/2] Using trivy to scan container image --- .github/workflows/pull-request.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 6f6c4e3..f05ffb6 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -37,16 +37,16 @@ jobs: sudo ./release/http-downloader_linux_amd64/hd install ks ks version - - name: Upload Artifact for darwin - uses: actions/upload-artifact@v2 + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master with: - name: hd-darwin-amd64 - path: release/hd-darwin-amd64.tar.gz - - name: Upload Artifact for linux - uses: actions/upload-artifact@v2 - with: - name: hd-linux-amd64 - path: release/hd-linux-amd64.tar.gz + image-ref: 'surenpi/hd:latest' + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + GoLint: name: Lint runs-on: ubuntu-20.04 From acbec852f3082639107dd85f7285fc77e1e0442b Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Fri, 3 Dec 2021 23:29:54 +0800 Subject: [PATCH 2/2] Fix bump apk-tools to 2.10.7-r0 due to the security issues --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 827614e..603580c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM alpine:3.10 +RUN apk add --upgrade apk-tools@2.10.7-r0 COPY hd /usr/local/bin/hd RUN hd fetch