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>
49 lines
3.0 KiB
Markdown
49 lines
3.0 KiB
Markdown
# ADR-0088: Rendered deployment-policy checks with pinned kustomize
|
|
|
|
## Status
|
|
Accepted 2026-10-02 (M9.8f review correction). Extends ADR-0069's offline policy check.
|
|
|
|
## Context
|
|
`tools/ci/deploy-policy-check.py` validated manifest files one by one. Kustomize
|
|
inline strategic-merge or JSON patches, components and namespace transformations
|
|
change the effective objects without appearing as checkable files; the M9.8f review
|
|
reproduced inline patches enabling the session listener, sessions, synthetic inputs
|
|
and a session port while the check passed.
|
|
|
|
## Decision
|
|
- The check renders every non-component kustomization under `deploy/` with a pinned
|
|
kustomize and validates the effective output: overlay namespaces; evo-region's
|
|
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.
|
|
- Dependency: kustomize **v5.8.1** (kubernetes-sigs, Apache-2.0), official Linux amd64
|
|
release archive, SHA-256
|
|
029a7f0f4e1932c52a0476cf02a0fd855c0bb85694b82c338fc648dcb53a819d, matching the
|
|
release's checksums.txt. Maintenance evidence (GitHub releases, 2026-10-02): v5.8.0
|
|
2025-11-09, v5.8.1 2026-02-09, v5.8.2 2026-09-30. v5.8.1 is pinned rather than the
|
|
two-day-old v5.8.2; updates change the version and checksum together.
|
|
- Acquisition is explicit: `tools/ci/prepare-kustomize.sh [dir]` downloads, verifies and
|
|
installs it (default `.cache/tools/kustomize-v5.8.1`); the CI deploy image runs it.
|
|
The check uses `$KUSTOMIZE`, that cache path or `kustomize` on PATH, and fails unless
|
|
the binary reports exactly the pinned version. No build step downloads it implicitly.
|
|
|
|
## Alternatives considered
|
|
- `kubectl kustomize`: its embedded kustomize version follows kubectl releases.
|
|
- Parsing patches in Python: re-implements kustomize semantics incompletely.
|
|
- kubeconform/schema validation: complements but does not evaluate policy.
|
|
|
|
## Consequences
|
|
Running the policy check locally needs the pinned binary (Linux x86_64 is pinned).
|
|
Rendering adds seconds to the deploy suite. The self-test covers inline and JSON patches,
|
|
namespace changes and unsupported features.
|