Skip to content

[CONFIG] Docker: snyk disabled. #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 49 additions & 45 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,53 +121,57 @@ jobs:
run --rm ${{ env.IMAGE_NAME }}-test
make test

security:
name: "Snyk Container"
runs-on: ubuntu-24.04
needs: build
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}_prod
path: /tmp/

- name: Load image
run: |
docker load --input /tmp/${{ env.ARTIFACT_NAME }}_prod.tar
docker image ls -a
# yamllint disable rule:line-length
# security:
# name: "Snyk Container"
# runs-on: ubuntu-24.04
# needs: build
# permissions:
# actions: read
# contents: read
# security-events: write
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.ARTIFACT_NAME }}_prod
# path: /tmp/

# - name: Load image
# run: |
# docker load --input /tmp/${{ env.ARTIFACT_NAME }}_prod.tar
# docker image ls -a

# - name: Run Snyk to check Docker image for vulnerabilities
# # Snyk can be used to break the build when it detects vulnerabilities.
# # In this case we want to upload the issues to GitHub Code Scanning
# continue-on-error: true
# uses: snyk/actions/docker@master
# env:
# # yamllint disable rule:line-length
# # In order to use the Snyk Action you will need to have a Snyk API token.
# # See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
# # or you can sign up for free at https://snyk.io/login
# # yamllint enable rule:line-length
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# with:
# image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
# args: --file=Dockerfile
# # yamllint disable rule:line-length
# # https://github.com/github/codeql-action/issues/2187#issuecomment-2043220400
# - name: Replace security-severity undefined for license-related findings
# run: |
# sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
# sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
# # yamllint enable rule:line-length
# - name: Upload result to GitHub Code Scanning
# uses: github/codeql-action/upload-sarif@v3
# with:
# sarif_file: 'snyk.sarif'
# yamllint enable rule:line-length

- name: Run Snyk to check Docker image for vulnerabilities
# Snyk can be used to break the build when it detects vulnerabilities.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/docker@master
env:
# yamllint disable rule:line-length
# In order to use the Snyk Action you will need to have a Snyk API token.
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
# or you can sign up for free at https://snyk.io/login
# yamllint enable rule:line-length
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
args: --file=Dockerfile
# yamllint disable rule:line-length
# https://github.com/github/codeql-action/issues/2187#issuecomment-2043220400
- name: Replace security-severity undefined for license-related findings
run: |
sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif
sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif
# yamllint enable rule:line-length
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'snyk.sarif'
scan:
name: "Trivy"
runs-on: ubuntu-24.04
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*
ADD https://apt.llvm.org/llvm-snapshot.gpg.key llvm-snapshot.gpg.key
RUN apt-key add llvm-snapshot.gpg.key && \
apt-add-repository "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy main" && \
apt-add-repository -y "deb https://apt.llvm.org/noble/ llvm-toolchain-noble-20 main" && \
apt-get -y update && \
apt-get -y install --no-install-recommends --no-install-suggests clang-format && \
rm -rf /var/lib/apt/lists/*
Expand Down