Repository navigation
✨ feat(netguard): production --allow-private-sinks opt-in (NET-01) - #146
Merged
Merged
Conversation
DR-FIND-05 Option A. Adds an explicit, secure-by-default-OFF, cluster-admin-only opt-in so sink endpoints may resolve to RFC1918 / IPv6-ULA (in-cluster ClusterIP) addresses on published production images — for exporting to in-cluster Postgres/MinIO/NATS, which netguard's deny-by-default blocked on v0.10.0. One manager flag --allow-private-sinks (default false) drives BOTH layers so they never diverge: - dial-time: netguard.SetAllowPrivateSinks narrows validateAddress to permit IsPrivate() (RFC1918/ULA) only; loopback, link-local (incl. metadata 169.254.169.254), unspecified, multicast, CGNAT, and benchmark stay denied. Strictly narrower than the integration build tag's full allowPrivate skip. - admission: validation.SetAllowPrivateSinks makes isDeniedIP conditionally permit IsPrivate() while every other deny-list entry (incl. the locked denyCIDRs) stays enforced. atomic.Bool for race-free concurrent reads. Helm value allowPrivateSinks (default false) renders the flag only when true; NOT a CRD/tenant field, so sink authors cannot widen the deny-list. Docs flipped planned -> shipped with the residual-SSRF-risk callout. Tests (TDD, race-clean): dialer + admission matrices incl. the discriminators (metadata/link-local/loopback stay denied under the opt-in; ULA allowed; DNS->RFC1918 allowed on / denied off; mixed private+metadata answer fails closed; default-closed when the setter is never called); startup-flag parse; helm-unittest arg present only when true. sonar_ko_07 SAFE-comment guard intact.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
konih
added a commit
that referenced
this pull request
Jul 31, 2026
Bump chart version/appVersion 0.10.0 -> 0.11.0 for the next minor. Unreleased since v0.10.0: feat(netguard) NET-01 --allow-private-sinks opt-in (#146) + fix(controller) inventory store source Start non-blocking / DR-FIND-01 (#143), plus DR-FIND-03 lab-bootstrap docs (#148), UI-TEST-01 (#147), SEC-04j CI-hardening (#150).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



NET-01 — production
--allow-private-sinksopt-in (DR-FIND-05 Option A)Implements the operator's Option A decision (2026-07-31): an explicit, secure-by-default-OFF, cluster-admin-only opt-in so sink endpoints may resolve to RFC1918 / IPv6-ULA (in-cluster ClusterIP) addresses on published production images — for exporting to in-cluster Postgres/MinIO/NATS, which netguard's deny-by-default blocked on v0.10.0 (DR lab
dr-20260731-80aef1Wave 2b). Companion to the operator's planning PR #144.Design
One manager flag
--allow-private-sinks(default false) drives both enforcement layers so they never diverge (cmd/main.gowires both setters from onecfg):netguard):validateAddress(addr, allowPrivate)permitsIsPrivate()(RFC1918/ULA) only; loopback, link-local (incl. cloud-metadata 169.254.169.254), unspecified, multicast, CGNAT, benchmark stay denied. Strictly narrower than theintegrationbuild tag's full skip.validation):isDeniedIPconditionally permitsIsPrivate()while every other deny-list entry — including the lockeddenyCIDRs— stays enforced.atomic.Boolfor race-free reads.Helm
allowPrivateSinks(default false) renders the arg only when true. Not a CRD/tenant field — sink-CR authors cannot widen the deny-list.Security review — APPROVE
Independent reviewer verified: fails closed by default / when the setter is never invoked; narrow allow keeps all non-private denials at both layers even when ON; admission↔dial parity with confirmed end-to-end dial-path reach (all sink backends funnel through
DefaultDialer); not tenant-controllable; SAFE-comment/denyCIDRs verbatim (guard test green); race-clean; strong discriminator tests. 2 P3 non-blocking notes only.Gates
build ✅ · netguard+validation+cmd
-race✅ · helm-unittest 24/24 ✅ ·sonar_ko_07SAFE-comment guard ✅ ·make lint0 issues ✅ ·verify:headers✅. Docs flipped planned→shipped (Helm value shipped top-levelallowPrivateSinksper chart convention; see agent-context decisions).Residual SSRF risk (documented)
When enabled, a principal who can create/edit sink CRs can aim connection-tests/exports at RFC1918/VPC peers reachable from the manager pod. Enable only in private clusters with trusted CR authors. Default remains deny.