File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1212jobs :
1313 build_and_publish :
1414 name : Build and Publish Docker images
15+ permissions :
16+ contents : read
17+ security-events : write
1518 runs-on : ubuntu-latest
1619 strategy :
1720 matrix :
@@ -108,3 +111,21 @@ jobs:
108111 tags : ${{ steps.docker_meta_runtime_gem.outputs.tags }}
109112 labels : ${{ steps.docker_meta_runtime_gem.outputs.labels }}
110113 secrets : GIT_AUTH_TOKEN=${{ secrets.DOCKER_REGISTRY_TOKEN }}
114+
115+ # Scan for vulnerabilities
116+ - name : Run Trivy vulnerability scanner
117+ uses : aquasecurity/trivy-action@master
118+ if : ${{ github.event_name != 'pull_request' }}
119+ with :
120+ image-ref : ghcr.io/${{ github.repository_owner }}/gs64:${{ github.ref_name }}
121+ format : ' sarif'
122+ output : ' trivy-results.sarif'
123+ severity : ' CRITICAL,HIGH'
124+ limit-severities-for-sarif : true
125+ ignore-unfixed : true
126+
127+ - name : Upload Trivy scan results to GitHub Security tab
128+ uses : github/codeql-action/upload-sarif@v3
129+ if : ${{ github.event_name != 'pull_request' }}
130+ with :
131+ sarif_file : ' trivy-results.sarif'
Original file line number Diff line number Diff line change 1+ name : Scheduled vulnerability scanning
2+ on :
3+ schedule :
4+ - cron : ' 35 6 * * 2'
5+ workflow_dispatch :
6+ jobs :
7+ vulnerability-scan :
8+ permissions :
9+ contents : read
10+ security-events : write
11+ name : Scheduled scan for vulnerabilities
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Run Trivy vulnerability scanner
15+ uses : aquasecurity/trivy-action@master
16+ with :
17+ image-ref : ghcr.io/${{ github.repository_owner }}/gs64:latest
18+ format : ' sarif'
19+ output : ' trivy-results.sarif'
20+ severity : ' CRITICAL,HIGH'
21+ limit-severities-for-sarif : true
22+ ignore-unfixed : true
23+
24+ - name : Upload Trivy scan results to GitHub Security tab
25+ uses : github/codeql-action/upload-sarif@v3
26+ with :
27+ sarif_file : ' trivy-results.sarif'
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ ENV GS_UID=1001
1515ENV GS_GID=100
1616
1717RUN apt-get update \
18+ && apt-get upgrade -y \
1819 && apt-get install --assume-yes --no-install-recommends \
1920 ca-certificates \
2021 gosu \
You can’t perform that action at this time.
0 commit comments