Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs(k8s-operator): explain cluster-wide vs namespace-scoped security models
varonix99b5bd8a6ccf
diff --git a/docs/snippets/kubernetes-operator-install.mdx b/docs/snippets/kubernetes-operator-install.mdxindex cd609aea64..0af9511274 100644--- a/docs/snippets/kubernetes-operator-install.mdx+++ b/docs/snippets/kubernetes-operator-install.mdx@@ -1,3 +1,27 @@+### Choosing cluster-wide or namespace-scoped++The installation mode decides whether a resource in one namespace can use credentials from another namespace:++| Mode | Trust boundary | Cross-namespace references | Use when |+| --- | --- | --- | --- |+| Cluster-wide (default) | The cluster | Allowed. A resource can reference a service account, `InfisicalAuth`, or secret in any namespace. | You trust everyone who can create operator resources to read secrets in every namespace, such as a platform team that manages authentication from one central namespace. |+| Namespace-scoped | The namespace | Blocked. The operator only has a Role in the namespace it watches, so the Kubernetes API server rejects the operator's requests for secrets and service account tokens in any other namespace. | Several teams share a cluster and each team owns a namespace. |++To keep teams apart on a shared cluster, install a separate namespace-scoped operator in each team's namespace.++<Accordion title="Blocking cross-namespace references in a cluster-wide installation">+ If you keep a cluster-wide installation and still want to keep namespaces apart, use an admission policy, such as a [ValidatingAdmissionPolicy](https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/), to reject resources that set one of these fields to a namespace other than their own:++ | Resource | Fields |+ | --- | --- |+ | `InfisicalAuth` | `spec.kubernetes.serviceAccountRef.namespace`, and the `namespace` of each credential reference: `clientIdRef` and `clientSecretRef` under `spec.universal`, `usernameRef` and `passwordRef` under `spec.ldap`, and `identityIdRef` under every auth method |+ | `InfisicalStaticSecret` | `spec.infisicalAuthRef.namespace` and `spec.targets[].namespace` |+ | `InfisicalSecret`, `InfisicalDynamicSecret`, and `InfisicalPushSecret` | `spec.authentication.kubernetesAuth.serviceAccountRef.namespace` |+ | `InfisicalPushSecret` | `spec.push.secret.secretNamespace` |++ Other fields can also name another namespace, such as `infisicalConnectionRef.namespace`, TLS CA certificate references, and the managed secret references on v1alpha1 resources. These fields don't give access to another namespace's credentials, but add them to the policy if you need full isolation.+</Accordion>+<Steps><Step title="Add the Helm repository">```bash@@ -7,8 +31,7 @@</Step><Step title="Install the chart">- The operator can be installed either cluster-wide or restricted to specific namespaces.- If you require stronger isolation and stricter access controls, a namespace-scoped installation may make more sense.+ Install the operator cluster-wide or namespace-scoped. To pick a mode, see [Choosing cluster-wide or namespace-scoped](#choosing-cluster-wide-or-namespace-scoped).<Tabs><Tab title="Cluster-wide (default)">@@ -22,9 +45,10 @@<Tab title="Namespace-scoped">Limit the operator's permissions to only specific namespaces instead of cluster-wide access. Useful for multi-tenant clusters or environments requiring strict resource isolation.- <Note>- For multiple namespace-scoped installations, only the first installation should install CRDs. Subsequent installations should set `installCRDs: false` to avoid conflicts as CRDs are cluster-wide resources.- </Note>+ Before you install, check these settings:++ - Set `scopedRBAC=true` (if you set only `scopedNamespaces`, the operator still gets a ClusterRole and watches every namespace)+ - Set `installCRDs=true` only on the first install (CRDs are cluster-wide resources, so later installs must set `installCRDs=false`)**Single namespace:**```bash@@ -61,7 +85,7 @@```yaml values-operator1.yamlscopedNamespaces: ns1scopedRBAC: true- installCRDs: false+ installCRDs: true``````yaml values-operator2.yaml@@ -72,6 +96,9 @@</Accordion>**Multiple namespaces (single operator):**++ With one operator for several namespaces, a resource in any of those namespaces can reference a service account, `InfisicalAuth`, or secret in the others. Use separate operators if those namespaces belong to different teams.+```bashhelm install operator infisical-helm-charts/secrets-operator \--namespace operator-namespace \