You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7d843b3
Browse filesBrowse the repository at this point in the historyBrowse files
feat(helm)!: confine gateway workspace permissions with an admission policy
Install a ValidatingAdmissionPolicy, on by default in managed and
operator workspace modes, that matches only the gateway ServiceAccount.
It admits Secret, Pod, Sandbox, Service, ServiceAccount, and
NetworkPolicy writes only in namespaces labeled as owned by this
gateway and namespaces matching the operator selector. Secret writes are
also admitted in the credential namespace when the Kubernetes Secrets
credential driver is enabled. Namespace writes are admitted only for
namespaces owned by this gateway, judged by their existing labels.
- Skip rendering the policy when rbac.create or rbac.clusterScoped.create
is false; a cluster-admin applies it with the other cluster-scoped
objects.
- Require Kubernetes 1.30.
- Fail rendering with operatorNamespaceFile or set-based operator
selectors, which the policy cannot evaluate. admissionPolicy.enabled
set to false opts out.
- Add e2e checks in managed and operator modes that send server-side
dry-run requests as the gateway ServiceAccount outside its namespaces,
including Pod creation in the sandbox and credential namespace, and
assert the policy rejects them.
- Document the policy and opt-out, raise the minimum Kubernetes version
in the docs and support matrix, and add policy denials to the cluster
debugging skill.
Signed-off-by: Kris Hicks <[email protected]>
The objects then survive the upgrade that sets the flags, and the cluster-admin
120
138
owns them from that point on. Fresh installs need no such step.
121
139
122
140
`rbac.clusterScoped.create` is independent of
@@ -309,6 +327,7 @@ discovery endpoint or its TLS CA.
309
327
310
328
| Key | Type | Default | Description |
311
329
|-----|------|---------|-------------|
330
+
| admissionPolicy.enabled | bool |`true`| Install a ValidatingAdmissionPolicy that rejects gateway requests to create, update, or delete Secrets, Pods, Sandboxes, Services, ServiceAccounts, NetworkPolicies, and Namespaces outside gateway-owned managed namespaces and operator-selected namespaces. Secret writes are also admitted in the credential namespace. |
312
331
| affinity | object |`{}`| Affinity rules for the gateway pod. |
313
332
| agentSandbox.preflight.enabled | bool |`true`| Check the live cluster for a supported Agent Sandbox API before rendering gateway resources. Disable only for offline rendering and linting. |
314
333
| certManager.caSecretName | string |`"openshell-ca-tls"`| Secret created for the intermediate CA (Certificate with isCA: true). |
{{- fail "admissionPolicy cannot enforce server.drivers.kubernetes.operatorNamespaceFile; use operatorNamespaceLabel or set admissionPolicy.enabled=false" }}
23
+
{{- end }}
24
+
{{- $terms := list }}
25
+
{{- range splitList "," $kubernetes.operatorNamespaceLabel }}
26
+
{{- $term := trim . }}
27
+
{{- if not (regexMatch "^([a-z0-9]([-a-z0-9.]*[a-z0-9])?/)?[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?=([A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?)?$" $term) }}
28
+
{{- fail (printf "admissionPolicy supports only key=value terms in server.drivers.kubernetes.operatorNamespaceLabel, got %q; set admissionPolicy.enabled=false to use other selectors" $term) }}
0 commit comments