Check effective NetworkPolicy ingress to the region session port

Rendered policies must keep default-deny in every environment, and no ingress rule
that can select a region pod may admit the session port (no or empty ports, the
session name, 7400 or a spanning range) except the validated route policy. Route
Service and policy validators are shared by source and rendered checks. Self-test
grows to 44 cases, including the reviewer's all-ingress reproduction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-02 19:06:49 -04:00
co-authored by Claude Opus 5.5
parent 8a1e5ef53d
commit cb31893a47
4 changed files with 201 additions and 53 deletions
@@ -16,6 +16,13 @@ and a session port while the check passed.
session/input/listener environment, the single listener argument and container ports;
Service types and the session port; route Service shape; NetworkPolicies admitting the
session port; quotas; Ingresses; and the absence of Secrets. Source-file checks stay.
- NetworkPolicies (review of 8a1e5ef): every rendered environment keeps its default-deny
(all pods, both directions, no rules). Any rendered ingress rule whose selector can
select a region pod (empty or expression selectors count) must not admit the session
port: omitted or empty ports, a TCP entry without a port, the name `session`, 7400 or a
range spanning it all count, whatever the sources. Only the route policy may, with its
full reviewed shape. The route Service and policy use the same validators for source
and rendered objects (VIP, ranges, annotations, selector).
- Kustomizations may use only the keys in use today (resources, components, patches,
images, labels, common labels/annotations, namespace, ConfigMap generators);
generators/transformers plugins, Helm inflation and Secret generators are refused.