Skip to content

Commit

Permalink
Merge pull request #56 from getwilds/security-action
Browse files Browse the repository at this point in the history
Adding Docker Scout Security Action
  • Loading branch information
tefirman authored Oct 21, 2024
2 parents 90c46d6 + 81b6e25 commit 4f02f8d
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 10 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docker-scout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker Scout

on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"

env:
GH_TOKEN: ${{ github.token }}

jobs:
scout:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PW }}
- name: Install Docker Scout
run: |
curl -fsSL https://raw.githubusercontent.com/docker/scout-cli/main/install.sh -o install-scout.sh
sh install-scout.sh
- name: Docker Scout
run: |
GH_ISSUES=$(gh issue list)
for image in *; do
if [ -d "$image" ] && [ "$image" != ".github" ] && [ $GH_ISSUES != *"$image Vulnerability Analysis"* ]; then
CONTAINER="getwilds/$image:latest"
docker scout cves $CONTAINER --only-fixed --format sarif --output cve_check.json
NUM_VUL=$(jq '.runs[0].tool.driver.rules | length' cve_check.json)
if [[ $NUM_VUL -ge 1 ]]; then
docker scout cves $CONTAINER --only-fixed --format markdown --output cve_check.html
if [[ $(wc -c cve_check.html) -le 65536 ]]; then
gh issue create --repo getwilds/wilds-docker-library --title "$image Vulnerability Analysis" --body-file cve_check.html
else
echo "Significant issues present in bwa, see quickview and recommendations below, but run CVE analysis locally." > qv.txt
echo "\`\`\`" >> qv.txt
docker scout quickview $CONTAINER >> qv.txt
docker scout recommendations $CONTAINER >> qv.txt
echo "\`\`\`" >> qv.txt
gh issue create --repo getwilds/wilds-docker-library --title "$image Vulnerability Analysis" --body-file qv.txt
fi
fi
docker system prune -af
fi
done
10 changes: 5 additions & 5 deletions bwa/Dockerfile_0.7.17
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Using the Ubuntu base image
FROM ubuntu:noble-20240114
FROM ubuntu:noble-20241011

# Adding labels for the GitHub Container Registry
LABEL org.opencontainers.image.title="bwa"
Expand All @@ -14,10 +14,10 @@ LABEL org.opencontainers.image.licenses=MIT

# Installing prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential=12.10ubuntu1 wget=1.21.4-1ubuntu4 \
zlib1g-dev=1:1.3.dfsg-3.1ubuntu2 autoconf=2.71-3 automake=1:1.16.5-1.3ubuntu1 \
libncurses-dev=6.4+20240113-1ubuntu2 libbz2-dev=1.0.8-5.1 liblzma-dev=5.6.1+really5.4.5-1 \
libssl-dev=3.0.13-0ubuntu3.1 libcurl4-gnutls-dev=8.5.0-2ubuntu10.1 \
&& apt-get install -y --no-install-recommends build-essential=12.10ubuntu1 wget=1.21.4-1ubuntu4.1 \
zlib1g-dev=1:1.3.dfsg-3.1ubuntu2.1 autoconf=2.71-3 automake=1:1.16.5-1.3ubuntu1 \
libncurses-dev=6.4+20240113-1ubuntu2 libbz2-dev=1.0.8-5.1build0.1 liblzma-dev=5.6.1+really5.4.5-1build0.1 \
libssl-dev=3.0.13-0ubuntu3.4 libcurl4-gnutls-dev=8.5.0-2ubuntu10.4 gnutls-bin=3.8.3-1.1ubuntu3.2 \
&& rm -rf /var/lib/apt/lists/*

# Pulling and extracting bwa source code
Expand Down
10 changes: 5 additions & 5 deletions bwa/Dockerfile_latest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Using the Ubuntu base image
FROM ubuntu:noble-20240114
FROM ubuntu:noble-20241011

# Adding labels for the GitHub Container Registry
LABEL org.opencontainers.image.title="bwa"
Expand All @@ -14,10 +14,10 @@ LABEL org.opencontainers.image.licenses=MIT

# Installing prerequisites
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential=12.10ubuntu1 wget=1.21.4-1ubuntu4 \
zlib1g-dev=1:1.3.dfsg-3.1ubuntu2 autoconf=2.71-3 automake=1:1.16.5-1.3ubuntu1 \
libncurses-dev=6.4+20240113-1ubuntu2 libbz2-dev=1.0.8-5.1 liblzma-dev=5.6.1+really5.4.5-1 \
libssl-dev=3.0.13-0ubuntu3.1 libcurl4-gnutls-dev=8.5.0-2ubuntu10.1 \
&& apt-get install -y --no-install-recommends build-essential=12.10ubuntu1 wget=1.21.4-1ubuntu4.1 \
zlib1g-dev=1:1.3.dfsg-3.1ubuntu2.1 autoconf=2.71-3 automake=1:1.16.5-1.3ubuntu1 \
libncurses-dev=6.4+20240113-1ubuntu2 libbz2-dev=1.0.8-5.1build0.1 liblzma-dev=5.6.1+really5.4.5-1build0.1 \
libssl-dev=3.0.13-0ubuntu3.4 libcurl4-gnutls-dev=8.5.0-2ubuntu10.4 gnutls-bin=3.8.3-1.1ubuntu3.2 \
&& rm -rf /var/lib/apt/lists/*

# Pulling and extracting bwa source code
Expand Down

0 comments on commit 4f02f8d

Please sign in to comment.