Skip to content

images/nginx: upgrade nginx 1.27.1 → 1.30.1 (security)#1

Merged
samudm98 merged 11 commits into
mainfrom
feat/upgrade-nginx-1.30.1
May 20, 2026
Merged

images/nginx: upgrade nginx 1.27.1 → 1.30.1 (security)#1
samudm98 merged 11 commits into
mainfrom
feat/upgrade-nginx-1.30.1

Conversation

@samudm98

@samudm98 samudm98 commented May 20, 2026

Copy link
Copy Markdown

Summary

This PR upgrades the nginx base image from nginx/1.27.1 to nginx/1.30.1 to address known security vulnerabilities present in older nginx versions. Since the upstream kubernetes/ingress-nginx project is no longer actively maintained, this fork takes ownership of the upgrade.

The cluster currently runs an ingress-nginx controller that packages nginx/1.21.6, which contains known CVEs. This change targets nginx/1.30.1, the latest stable release (as of May 2026).


Commits

1. images/nginx: bump nginx base image to v2.3.0 (nginx 1.30.1)

Updates images/nginx/rootfs/build.sh and images/nginx/TAG:

Variable Before After Reason
NGINX_VERSION 1.27.1 1.30.1 Security upgrade
nginx tarball SHA256 66dc708... 99765000... Updated checksum
NJS_VERSION 0.9.0 0.9.9 Latest stable (2026-05-19), compatible with nginx 1.30.x
LUA_NGX_VERSION v0.10.28 v0.10.29 Latest stable, nginx 1.30.x compatible
LUA_STREAM_NGX_VERSION v0.0.16 v0.0.17 Latest stable
LUA_RESTY_CORE v0.1.31 v0.1.32 Required by lua-nginx-module v0.10.29
images/nginx/TAG v2.2.9 v2.3.0 New image tag

2. images/nginx: rename and drop patches for nginx 1.30.1

  • Renamed all 34 patches from *nginx-1.27.1**nginx-1.30.1*.
    Patch content is unchanged — all 34 patches were verified with patch --dry-run -p1 against the nginx 1.30.1 source tree and apply cleanly with zero rejected hunks.

  • Deleted 28_nginx-1.27.1-CVE-2025-23419.patch:
    This patch was a backport of the fix for CVE-2025-23419 (insufficient SNI check in TLSv1.3 virtual server handling, allows session reuse across virtual servers to bypass client certificate verification) into nginx 1.27.1. The vulnerability was officially fixed upstream in nginx 1.27.4 and is therefore already present in nginx 1.30.1. Keeping this patch would introduce conflicting code in ngx_http_request.c and ngx_stream_ssl_module.c.

3. build: align with forkline improvements for nginx 1.30.1

Adds retry logic with gzip integrity validation to the get_src() function in build.sh. Downloads are retried up to 3 times if the fetched file fails gzip -t validation (truncated/corrupt download), with an explicit error and non-zero exit on final failure. This improves build reliability in flaky network environments.


Security context

The following CVEs are fixed between nginx 1.21.6 (current cluster version) and nginx 1.30.1:

CVE Fixed in Description
CVE-2025-23419 nginx 1.27.4 SNI/TLSv1.3 session reuse across virtual servers bypasses client cert verification
Multiple nginx 1.23–1.30 Various HTTP/2, proxy, and resolver fixes across the 1.22–1.30 release series

Verification

The nginx 1.30.1 image was built and verified locally:

$ docker run --rm nginx-test:v2.3.0 nginx -v
nginx version: nginx/1.30.1

$ docker run --rm nginx-test:v2.3.0 ls /etc/nginx/modules/
ngx_http_auth_digest_module.so
ngx_http_brotli_filter_module.so
ngx_http_brotli_static_module.so
ngx_http_geoip2_module.so
ngx_http_js_module.so
ngx_http_modsecurity_module.so
ngx_stream_geoip2_module.so
ngx_stream_js_module.so
otel_ngx_module.so

All 9 dynamic modules compiled and present. All compilation flags (HTTP/2, HTTP/3, stream, SSL, Lua, OpenTelemetry) confirmed via nginx -V.

Note on local amd64 build: Building linux/amd64 locally on Apple Silicon (aarch64 Docker host) triggers a GCC internal error (segfault in lj_opt_mem.c) due to QEMU emulation overhead during LuaJIT compilation. This is a known emulation limitation and does not affect CI builds on native x86_64 runners (GitHub Actions). The linux/arm64 build completes successfully on the local host.


Test plan

  • CI image build passes for linux/amd64 on GitHub Actions
  • CI image build passes for linux/arm64 and linux/arm
  • Controller image build (rootfs/Dockerfile) succeeds using the new nginx base image
  • nginx -v in the final controller image reports nginx/1.30.1
  • Existing CI test suite passes (make test_all equivalent in the ingress-nginx CI)
  • Update NGINX_BASE file with the digest of the newly published image

🤖 Generated with Claude Code

Samuel Delgado M and others added 11 commits May 20, 2026 16:02
Upgrade the nginx base image from nginx/1.27.1 to nginx/1.30.1 to
address security vulnerabilities present in older nginx versions
(including CVE-2025-23419 and others fixed in the 1.28–1.30 release
series). The upstream kubernetes/ingress-nginx project is no longer
actively maintained, so this fork takes ownership of the upgrade.

Changes in images/nginx/rootfs/build.sh:
- NGINX_VERSION: 1.27.1 → 1.30.1
- SHA256 checksum for nginx tarball updated
- NJS_VERSION: 0.9.0 → 0.9.9 (latest stable, 2026-05-19)
- LUA_NGX_VERSION: v0.10.28 → v0.10.29 (latest stable, nginx 1.30.x compatible)
- LUA_STREAM_NGX_VERSION: v0.0.16 → v0.0.17 (latest stable)
- LUA_RESTY_CORE: v0.1.31 → v0.1.32 (required by lua-nginx-module v0.10.29)

Changes in images/nginx/TAG:
- v2.2.9 → v2.3.0

Verified: docker buildx build for linux/arm64 completes successfully.
All 9 dynamic modules present in the built image:
auth_digest, brotli (x2), geoip2 (x2), modsecurity, njs (x2), otel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename all 34 custom patches from nginx-1.27.1 to nginx-1.30.1.
All patches were verified with `patch --dry-run -p1` against the
nginx 1.30.1 source tree — every patch applies cleanly with no
context mismatches or rejected hunks.

Remove 28_nginx-1.27.1-CVE-2025-23419.patch: this patch backported
the fix for CVE-2025-23419 (insufficient SNI check in TLSv1.3 virtual
server handling) into nginx 1.27.1. The vulnerability was officially
fixed upstream in nginx 1.27.4 and is therefore already included in
nginx 1.30.1. Applying the patch on top of the upstream fix would
introduce duplicate or conflicting code in ngx_http_request.c and
ngx_stream_ssl_module.c.

Patch content was not modified. The nginx-1.27.1 prefix in diff
headers is cosmetic only — `patch -p1` strips the leading directory
component, so patches apply correctly regardless of the version string
in the header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump Alpine base image 3.23.3 → 3.23.4 in nginx Dockerfile
- Add retry logic (3 attempts + gzip validation) to get_src() in build.sh
- Upgrade Go 1.26.1 → 1.26.3, grpc v1.79.3 → v1.81.1, helm v4.1.3 → v4.2.0
- Add .github/workflows/build-nginx.yaml: multi-platform (amd64+arm64)
  nginx image build/push to eu.gcr.io/prod-mercadona via GCP Auth,
  following existing CD workflow patterns (monline-generic runner,
  concurrency group, google-github-actions/auth@v2)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add fork header clarifying this is a Mercadona SRE fork of the retired
  upstream kubernetes/ingress-nginx project
- Add "Fork changes" table tracking divergence from upstream, starting
  with the nginx 1.27.1 → 1.30.1 security upgrade (PR #1)
- Reframe the upstream retirement notice as historical context rather than
  the primary heading
- Add in-progress row to the Supported Versions table for the next release
  targeting nginx 1.30.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
go.mod requires go >= 1.26.3 but GOLANG_VERSION was pinned to 1.26.1.
With GOTOOLCHAIN=local the toolchain does not auto-upgrade, causing all
three Go CI jobs to fail immediately with:

  go: go.mod requires go >= 1.26.3 (running go 1.26.1; GOTOOLCHAIN=local)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The test-go job runs `make test` which delegates to build/run-in-docker.sh.
Without DOCKER_IN_DOCKER_ENABLED=true, the script spins up the
e2e-test-runner:v2.2.9 container to run the unit tests. That image ships
a Go toolchain older than 1.26.3, causing `go list k8s.io/ingress-nginx/...`
to fail silently (error goes to stderr, subshell captures empty stdout),
and `go test -v` is invoked with no packages, defaulting to `.` where
there are no .go files:

  no Go files in /go/src/k8s.io/ingress-nginx
  FAIL . [setup failed]

Setting DOCKER_IN_DOCKER_ENABLED=true makes run-in-docker.sh skip the
Docker container and run the tests directly on the Actions runner, which
already has Go 1.26.3 installed by setup-go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ubuntu-latest with monline-generic-large across all CI jobs
to use Mercadona's self-hosted runner fleet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This fork's CI scope is limited to building and publishing the nginx
base image. Remove all upstream workflows that are no longer relevant:
chart, ci, depreview, docs, golangci-lint, images, junit-reports,
perftest, plugin, project, scorecards, vulnerability-scans, and the
zz-tmpl-* templates.

build-nginx.yaml is retained as the sole workflow, running on
monline-generic to build and push the nginx base image on
Mercadona's self-hosted runner fleet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The nginx image build requires Docker Buildx with multi-platform
support (linux/amd64, linux/arm, linux/arm64). ubuntu-latest provides
the necessary Docker environment and QEMU setup actions out of the box.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pinned commit hash for docker/setup-qemu-action did not exist in the
upstream repository, causing GitHub Actions to fail during job setup before
any step ran. Switch to the explicit version tag v3.6.0 to resolve the action.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…peline

Replace the previous GCP-centric build workflow with a complete release
pipeline that publishes to GitHub Container Registry (ghcr.io). The new
workflow handles nginx base image, controller images, and kube-webhook-certgen
on push to main and on version tags, with GoReleaser integration and
automatic changelog extraction for GitHub Releases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@samudm98 samudm98 merged commit 8553f09 into main May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant