Skip to content

feat: build the controller from upstream v1.11.5 - #5

Merged
Andrei Kvapil (kvaps) merged 4 commits into
mainfrom
build-v1.11.5
Aug 13, 2026
Merged

Andrei Kvapil (kvaps) merged 4 commits into
mainfrom
build-v1.11.5

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Moves the controller build onto upstream 1.11.5, keeping the reproducible layout that build-v1.11.2 introduced.

Why

main currently builds the controller by fetching 11843.diff over the network at build time:

RUN wget -O- https://github.com/kubernetes/ingress-nginx/pull/11843.diff | git apply -

That upstream pull request is still open, so its diff can change with no commit in this repository and the resulting image changes with it. The patch is not optional either — it fixes TLS passthrough for a fragmented ClientHello, and cozystack runs the controller with enable-ssl-passthrough.

What changes

  • The controller is built from controller-v1.11.5 with 11843.diff vendored in patches/, applied via git apply *.diff.
  • 13068.diff is dropped. It backported the CVE-2025-1974 fix onto 1.11.2; 1.11.5 carries the fix upstream and the patch no longer applies to the tree.
  • The builder moves to golang:1.24-alpine — 1.11.5 declares go 1.24.1 in go.mod, against go 1.22.6 in 1.11.2.
  • Lua modules move under etc/nginx/, and the patched nginx.tmpl is vendored, matching build-v1.11.2.
  • PROVENANCE.md documents the inputs and how to regenerate the template.

On the vendored template

Regenerating nginx.tmpl from upstream 1.11.5 plus nginx-tmpl.patch, minus the HTTP3 blocks, reproduces the file vendored on build-v1.11.2 byte for byte. That is a check in both directions: the | quote hardening of CertificateAuth.MatchCN, externalAuth.URL and Mirror.Source that had to be hand-carried on 1.11.2 is now inherited from upstream, and the vendored file is confirmed to be exactly upstream-plus-patch with nothing else hiding in it.

The HTTP3 blocks must stay out: buildHTTP3Listener is a deckhouse-only template function, and text/template fails at parse time on an unknown function, so keeping them would break config rendering outright even with UseHTTP3 disabled.

Merge of main

main is merged in rather than replaced. It carries a newer protobuf-exporter (go 1.23, golang:1.24-alpine) and CODEOWNERS. This matters because a tag builds both images: releasing off a branch without the merge would silently regress the exporter to its go 1.16 revision.

Verified

  • 11843.diff applies cleanly to controller-v1.11.5.
  • 13068.diff does not apply to controller-v1.11.5, confirming the fix is already upstream.
  • registry.k8s.io/ingress-nginx/controller:v1.11.5 exists as a base image.
  • The regenerated template matches the vendored one exactly.

Not verified: no image has been built from this branch yet.

Summary by CodeRabbit

  • New Features

    • Added comprehensive NGINX configuration support, including HTTP/stream routing, TLS, compression, authentication, rate limiting, health checks, and observability.
    • Added geolocation encoding and decoding capabilities.
    • Added metrics collection and export for request, response, timing, upstream, cache, and geolocation data.
  • Bug Fixes

    • Improved TLS hostname detection for fragmented ClientHello messages.
  • Documentation

    • Added build provenance and upgrade guidance for the NGINX Ingress controller.

Moves the reproducible build layout introduced on build-v1.11.2 onto
upstream 1.11.5.

The CVE-2025-1974 backport (13068.diff) is dropped: 1.11.5 carries the
fix upstream and the patch no longer applies to this tree. The same goes
for the template hardening — the `| quote` on CertificateAuth.MatchCN,
externalAuth.URL and Mirror.Source had to be hand-carried on 1.11.2 and
is now inherited from upstream, so the vendored template is upstream's
1.11.5 file with only the deckhouse patch applied on top.

11843.diff stays vendored rather than fetched over the network during
the build. Its upstream pull request is still open, so wget-ing the diff
lets the build change with no commit here, and the patch matters: it
fixes TLS passthrough for a fragmented ClientHello, and the controller
runs with enable-ssl-passthrough.

The builder moves to golang:1.24-alpine because 1.11.5 declares
go 1.24.1 in go.mod, against go 1.22.6 in 1.11.2.

Assisted-By: Claude
Signed-off-by: Andrei Kvapil <[email protected]>
Brings in the newer protobuf-exporter (go 1.23, golang:1.24-alpine
builder) and CODEOWNERS. The exporter matters here because a tag builds
both images, so releasing off a branch without this merge would quietly
regress the exporter to its go 1.16 revision.

Keeps the reproducible controller layout from build-v1.11.2 (vendored
patches and vendored etc/nginx) and restores patches/nginx-tmpl.patch,
which make update refreshes and the template regeneration needs.

Signed-off-by: Andrei Kvapil <[email protected]>
@kvaps
Andrei Kvapil (kvaps) merged commit be39005 into main Aug 13, 2026
0 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ea335016-ca7e-42d9-ad78-cf7b2b70e165

📥 Commits

Reviewing files that changed from the base of the PR and between a95bab6 and c81be1e.

📒 Files selected for processing (7)
  • .gitignore
  • images/controller/Dockerfile
  • images/controller/PROVENANCE.md
  • images/controller/etc/nginx/lua/geohash.lua
  • images/controller/etc/nginx/lua/pbmetrics.lua
  • images/controller/etc/nginx/template/nginx.tmpl
  • images/controller/patches/11843.diff

📝 Walkthrough

Walkthrough

The image now uses vendored NGINX configuration, Lua geohash and protobuf metrics modules, and a local TLS parsing patch. The Docker build applies local patches and documents provenance.

Changes

Controller runtime

Layer / File(s) Summary
Image vendoring and provenance
.gitignore, images/controller/Dockerfile, images/controller/PROVENANCE.md, images/controller/patches/11843.diff
The image applies local patches, packages the vendored NGINX tree, adds an OCI source label, and documents build provenance. The TLS proxy patch reads complete bounded ClientHello messages.
NGINX runtime template
images/controller/etc/nginx/template/nginx.tmpl
The template defines HTTP and stream configuration, routing, authentication, observability, rate limits, health checks, status endpoints, and reusable server templates.
GeoHash encoding and decoding
images/controller/etc/nginx/lua/geohash.lua
The Lua module encodes coordinates, decodes hashes, derives precision, supports explicit precision, and returns nil, nil for invalid hashes.
Protobuf metrics collection
images/controller/etc/nginx/lua/pbmetrics.lua
The module aggregates request and upstream metrics, adds optional GeoIP geohash data, serializes protobuf payloads, and sends them to 127.0.0.1:9090.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant NGINX
  participant pbmetrics.lua
  participant LocalTCPExporter
  NGINX->>pbmetrics.lua: call() collects request metrics
  pbmetrics.lua->>pbmetrics.lua: Serialize buffered metrics as protobuf
  pbmetrics.lua->>LocalTCPExporter: Send metrics over TCP
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build-v1.11.5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Andrei Kvapil (kvaps) added a commit to cozystack/cozystack that referenced this pull request Aug 27, 2026
#3798)

## What this PR does

Bumps ingress-nginx to chart 4.11.5 / controller v1.11.5, and closes the
admission webhook to everything except the API server.

### Version bump

The shipped `v1.11.2` controller is a cozystack rebuild that **already
carries a backport** of the CVE-2025-1974 fix (v0.28.2, March 2025), so
this is not a fix for a live vulnerability. The problem is that it
reports itself as a plain `v1.11.2 build git-d3bb2b4`: the binary is
built from the upstream 1.11.2 tag with the patch applied on top, which
does not change the version ldflags, and the image labels are inherited
from the `registry.k8s.io` base layer. A patched build is therefore
indistinguishable from an unpatched one by anything except its digest,
and anything scanning by version string flags it. This bump removes that
ambiguity.

`packages/system/ingress-nginx` feeds three consumers — the platform
ingress, tenant Ingress applications (`extra/ingress`), and the ingress
addon of tenant Kubernetes clusters — so one bump covers all three. The
protobuf-exporter sidecar moves in lockstep, since its tag tracks the
upstream controller version.

`CHART_VERSION` is now pinned in the package Makefile. `helm pull`
carried no `--version`, so `make update` would have fetched whatever is
latest upstream (4.13.9 today) against a controller image that only
exists for selected versions.

### Admission webhook policy

The webhook is only ever called by the API server, but it was reachable
from every pod in the cluster, in any namespace — avoidable attack
surface independent of any specific CVE.

The new `CiliumNetworkPolicy` is deny-only and disables default-deny. A
Cilium rule carrying an ingress section otherwise puts the selected
endpoints behind a default-deny, which here would mean enumerating every
port the controller serves (80, 443, metrics, the exporter, tcp/udp
services) and breaking traffic on the first one missed. Subtracting one
port is the safer construction.

Two callers are deliberately not denied:

* **host-network sources**, which are not Cilium endpoints — this covers
a management cluster, where the API server runs on the host network;
* **the konnectivity agent**, which is not optional. On a Kamaji-hosted
tenant cluster the API server lives outside the cluster and reaches
in-cluster webhooks through the konnectivity tunnel (Kamaji defines only
the `cluster` egress selection), so the call arrives from the agent pod
in `kube-system`, not from the API server address. A `fromEntities:
[kube-apiserver]` allow would not match it, and every Ingress
create/update in every tenant cluster would start failing.

The policy is namespaced rather than clusterwide on purpose: the same
package is installed into several namespaces of one cluster, so a
cluster-scoped object with a fixed name would collide between releases.
It can be disabled with `admissionWebhookPolicy.enabled`.

### Verification

Tested on a live Kamaji tenant cluster (k8s 1.35.6, Cilium 1.19), with
the addon enabled for the test and disabled afterwards:

| | probe from a pod in `default` | Ingress create |
|---|---|---|
| without policy | `open` | works |
| with policy | `Connection timed out` | works |

Also confirmed on the management cluster that `kube-apiserver` runs as
static pods on the host network, so the host-network carve-out holds
there.

The package previously ran no unit tests at all; a `test` target is
added with 7 assertions covering the policy. It is scoped with
`--with-subchart=false` because the vendored chart carries upstream's
own suites, which assert upstream defaults and fail under our values.
The full `hack/helm-unit-tests.sh` sweep is green.

The controller and exporter images are rebuilt by
cozystack/ingress-nginx-with-protobuf-exporter#5, which vendors the
`11843.diff` patch instead of fetching it from a still-open upstream PR
at build time.

### Screenshots

Not applicable — no UI changes.

### Downstream repositories

Walked the trigger map in `docs/agents/contributing.md` against the
diff, which touches `packages/system/ingress-nginx/` and one comment
line in `hack/promote-retag.sh`:

* **website** — no package added, renamed or removed under
`apps/`/`extra/`; no platform component added or removed; no change to
`packages/core/platform/values.yaml`, variants, bundles or release
assets. The `package Makefiles` trigger was considered because of
`CHART_VERSION` and the new `test` target: `CHART_VERSION` does not
change the documented contract of `make update`, and `test: helm
unittest` is an existing pattern in the repo
(`packages/system/cilium-networkpolicy/Makefile`), not new tooling.
* **terraform-provider-cozystack** — every trigger is about
`packages/apps/`, `values.schema.json`, version enums or
`ApplicationDefinition`; none apply to a system package.
* **ansible-cozystack** — no change to installer values, platform keys
the role sets, variants, waited-on objects or node prerequisites.
* **ccp** — `hack/package.mk` and `hack/common-envs.mk` untouched;
nothing under `hack/` moved or renamed, and the edit to
`hack/promote-retag.sh` is a comment with no behaviour change; layout
and namespaces unchanged.
* **external-apps-example**, **talm**, **cozyhr**, **cozy-proxy**,
**cozystack-telemetry-server**, **examples** — no trigger matches.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:

### Release note

```release-note
feat(ingress-nginx): update to chart 4.11.5 with controller v1.11.5, and restrict the admission webhook so it is reachable only by the API server. The previously shipped v1.11.2 image already contained a backport of the CVE-2025-1974 fix; it reported itself as a stock v1.11.2 build, which this update makes unambiguous.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added optional network protection for the admission webhook with
restricted access rules.
* Added PrometheusRule support and improved ServiceMonitor
configuration.
  * Webhook service ports are now configurable.

* **Updates**
  * Upgraded ingress-nginx and controller images to version 4.11.5.
  * Improved default-backend availability and topology-spread settings.
* Added Pod Security Admission guidance and refreshed configuration
documentation.

* **Bug Fixes**
* Corrected webhook service rendering and default-backend disruption
budget behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Andrei Kvapil (kvaps) added a commit to cozystack/cozystack that referenced this pull request Sep 7, 2026
#3798)

## What this PR does

Bumps ingress-nginx to chart 4.11.5 / controller v1.11.5, and closes the
admission webhook to everything except the API server.

### Version bump

The shipped `v1.11.2` controller is a cozystack rebuild that **already
carries a backport** of the CVE-2025-1974 fix (v0.28.2, March 2025), so
this is not a fix for a live vulnerability. The problem is that it
reports itself as a plain `v1.11.2 build git-d3bb2b4`: the binary is
built from the upstream 1.11.2 tag with the patch applied on top, which
does not change the version ldflags, and the image labels are inherited
from the `registry.k8s.io` base layer. A patched build is therefore
indistinguishable from an unpatched one by anything except its digest,
and anything scanning by version string flags it. This bump removes that
ambiguity.

`packages/system/ingress-nginx` feeds three consumers — the platform
ingress, tenant Ingress applications (`extra/ingress`), and the ingress
addon of tenant Kubernetes clusters — so one bump covers all three. The
protobuf-exporter sidecar moves in lockstep, since its tag tracks the
upstream controller version.

`CHART_VERSION` is now pinned in the package Makefile. `helm pull`
carried no `--version`, so `make update` would have fetched whatever is
latest upstream (4.13.9 today) against a controller image that only
exists for selected versions.

### Admission webhook policy

The webhook is only ever called by the API server, but it was reachable
from every pod in the cluster, in any namespace — avoidable attack
surface independent of any specific CVE.

The new `CiliumNetworkPolicy` is deny-only and disables default-deny. A
Cilium rule carrying an ingress section otherwise puts the selected
endpoints behind a default-deny, which here would mean enumerating every
port the controller serves (80, 443, metrics, the exporter, tcp/udp
services) and breaking traffic on the first one missed. Subtracting one
port is the safer construction.

Two callers are deliberately not denied:

* **host-network sources**, which are not Cilium endpoints — this covers
a management cluster, where the API server runs on the host network;
* **the konnectivity agent**, which is not optional. On a Kamaji-hosted
tenant cluster the API server lives outside the cluster and reaches
in-cluster webhooks through the konnectivity tunnel (Kamaji defines only
the `cluster` egress selection), so the call arrives from the agent pod
in `kube-system`, not from the API server address. A `fromEntities:
[kube-apiserver]` allow would not match it, and every Ingress
create/update in every tenant cluster would start failing.

The policy is namespaced rather than clusterwide on purpose: the same
package is installed into several namespaces of one cluster, so a
cluster-scoped object with a fixed name would collide between releases.
It can be disabled with `admissionWebhookPolicy.enabled`.

### Verification

Tested on a live Kamaji tenant cluster (k8s 1.35.6, Cilium 1.19), with
the addon enabled for the test and disabled afterwards:

| | probe from a pod in `default` | Ingress create |
|---|---|---|
| without policy | `open` | works |
| with policy | `Connection timed out` | works |

Also confirmed on the management cluster that `kube-apiserver` runs as
static pods on the host network, so the host-network carve-out holds
there.

The package previously ran no unit tests at all; a `test` target is
added with 7 assertions covering the policy. It is scoped with
`--with-subchart=false` because the vendored chart carries upstream's
own suites, which assert upstream defaults and fail under our values.
The full `hack/helm-unit-tests.sh` sweep is green.

The controller and exporter images are rebuilt by
cozystack/ingress-nginx-with-protobuf-exporter#5, which vendors the
`11843.diff` patch instead of fetching it from a still-open upstream PR
at build time.

### Screenshots

Not applicable — no UI changes.

### Downstream repositories

Walked the trigger map in `docs/agents/contributing.md` against the
diff, which touches `packages/system/ingress-nginx/` and one comment
line in `hack/promote-retag.sh`:

* **website** — no package added, renamed or removed under
`apps/`/`extra/`; no platform component added or removed; no change to
`packages/core/platform/values.yaml`, variants, bundles or release
assets. The `package Makefiles` trigger was considered because of
`CHART_VERSION` and the new `test` target: `CHART_VERSION` does not
change the documented contract of `make update`, and `test: helm
unittest` is an existing pattern in the repo
(`packages/system/cilium-networkpolicy/Makefile`), not new tooling.
* **terraform-provider-cozystack** — every trigger is about
`packages/apps/`, `values.schema.json`, version enums or
`ApplicationDefinition`; none apply to a system package.
* **ansible-cozystack** — no change to installer values, platform keys
the role sets, variants, waited-on objects or node prerequisites.
* **ccp** — `hack/package.mk` and `hack/common-envs.mk` untouched;
nothing under `hack/` moved or renamed, and the edit to
`hack/promote-retag.sh` is a comment with no behaviour change; layout
and namespaces unchanged.
* **external-apps-example**, **talm**, **cozyhr**, **cozy-proxy**,
**cozystack-telemetry-server**, **examples** — no trigger matches.

- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:

### Release note

```release-note
feat(ingress-nginx): update to chart 4.11.5 with controller v1.11.5, and restrict the admission webhook so it is reachable only by the API server. The previously shipped v1.11.2 image already contained a backport of the CVE-2025-1974 fix; it reported itself as a stock v1.11.2 build, which this update makes unambiguous.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added optional network protection for the admission webhook with
restricted access rules.
* Added PrometheusRule support and improved ServiceMonitor
configuration.
  * Webhook service ports are now configurable.

* **Updates**
  * Upgraded ingress-nginx and controller images to version 4.11.5.
  * Improved default-backend availability and topology-spread settings.
* Added Pod Security Admission guidance and refreshed configuration
documentation.

* **Bug Fixes**
* Corrected webhook service rendering and default-backend disruption
budget behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

2 participants