Skip to content
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
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ jobs:
REQUIRE_HTTP3: '1'
run: tests/smoke.sh nginx:ci

# Fails on HIGH or CRITICAL vulnerabilities in the image's Alpine
# packages when a fixed package exists. The packages are the same on
# Fails on any vulnerability in the image's Alpine packages that has a
# fixed package, whatever its severity: the build upgrades every
# package, so a fixable finding means the image is not current.
# Severities differ between scanners (Trivy and Docker Scout rate some
# CVEs differently), so filtering by severity would let some through. The packages are the same on
# both architectures, so one scan is enough.
- name: Scan image for known vulnerabilities
if: matrix.arch == 'amd64'
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: nginx:ci
scanners: vuln
severity: HIGH,CRITICAL
ignore-unfixed: true
exit-code: '1'
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ jobs:
with:
image-ref: nginx:release-test
scanners: vuln
severity: HIGH,CRITICAL
ignore-unfixed: true
exit-code: '1'

Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ ENV NGINX_VERSION=${NGINX_VERSION}

# UID/GID 101 matches the official nginx images, so existing volume
# ownership keeps working.
RUN addgroup -g 101 -S nginx \
#
# "apk upgrade" matters: the Alpine base image is only rebuilt for Alpine
# point releases, so the packages it ships (musl, zlib, ...) can be behind
# the repository's security fixes. "apk add" alone would keep them.
RUN apk upgrade --no-cache \
&& addgroup -g 101 -S nginx \
&& adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx \
&& apk add --no-cache \
ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ The smoke test starts the image read-only with all capabilities dropped and chec

- **Lint**: hadolint for the Dockerfile, ShellCheck for the scripts, actionlint for the workflows.
- **Build and smoke test** on `amd64` and `arm64`, both on native runners.
- **Vulnerability scan** with Trivy: fails on HIGH or CRITICAL findings in the image's Alpine packages that have a fix available. nginx itself and the two modules are compiled from source, so they are not covered by the scan; keep them current through the pinned versions above.
- **Vulnerability scan** with Trivy: fails on any finding in the image's Alpine packages that has a fix available, whatever its severity. The build runs `apk upgrade`, so every fixed package Alpine has published is in the image. nginx itself and the two modules are compiled from source, so they are not covered by the scan; keep them current through the pinned versions above.

[Dependabot](.github/dependabot.yml) opens weekly pull requests for new versions of the GitHub Actions, the Alpine base image and the test dependencies.

Expand Down