From bda0ddac6a766af7002fdfccd8886757a0407335 Mon Sep 17 00:00:00 2001 From: Mattia Eleuteri Date: Sun, 8 Nov 2026 19:34:09 +0100 Subject: [PATCH] docs(securitygroups): record the port-range and FQDN validation in the design The design still listed FQDN matchName/matchPattern syntax as deferred and passed through to Cilium. Create and update now reject a malformed selector, a selector setting both fields and a port range on the SecurityGroup path, so the deferred list keeps only cross-rule consistency. Assisted-by: LLM Signed-off-by: Mattia Eleuteri (cherry picked from commit 293503e04880a5cac2160446a72de4d5d6d110a7) Signed-off-by: Myasnikov Daniil --- pkg/apis/sdn/DESIGN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apis/sdn/DESIGN.md b/pkg/apis/sdn/DESIGN.md index 017da9d9a..f7c10609f 100644 --- a/pkg/apis/sdn/DESIGN.md +++ b/pkg/apis/sdn/DESIGN.md @@ -184,4 +184,4 @@ The aggregated-API + controller model is intentionally minimal. The following ca - **Cluster-scope** SecurityGroups projecting to CiliumClusterwideNetworkPolicy. - Reusable **CIDR/FQDN groups**, and exposing more of the CiliumNetworkPolicy rule surface (ICMP, `toServices`, CIDR-set exceptions) as demand appears. - An optional **existence/authorization check** on attachments and SG peers (SubjectAccessReview) to fail fast on a typo instead of silently matching zero pods. -- **Richer spec validation.** Create and update already validate the highest-risk fields synchronously — CIDR syntax, port range, the protocol enum, attachment/peer label validity, reserved-entity names — and reject a bad value with `Invalid` instead of writing a policy Cilium would silently discard. Still deferred: FQDN `matchName`/`matchPattern` syntax and cross-rule consistency, which pass through to Cilium. +- **Richer spec validation.** Create and update already validate the highest-risk fields synchronously — CIDR syntax, port number bounds (a `first-last` port range is rejected, since a port entry carries a single port and Cilium's `endPort` is not exposed), the protocol enum, attachment/peer label validity, reserved-entity names, and FQDN selectors against the CiliumNetworkPolicy CRD's own rules (exactly one of `matchName`/`matchPattern`, the CRD's patterns, at most 255 characters) — and reject a bad value with a field error on the SecurityGroup path instead of writing a policy that Cilium would silently discard or that the CiliumNetworkPolicy schema would refuse on the backing write. Still deferred: cross-rule consistency, which passes through to Cilium.