From 5f6b491ed3e1bbd59ef7df270088adba4f6a1de5 Mon Sep 17 00:00:00 2001 From: chemavx Date: Thu, 18 Jun 2026 16:05:59 +0000 Subject: [PATCH] Add Infisical token-reviewer RBAC for Kubernetes Auth Phase 2 Step 2: dedicated SA infisical-token-reviewer bound to system:auth-delegator (TokenReview), explicit long-lived SA token Secret (k8s 1.34 doesn't auto-create). ArgoCD ignores /data so selfHeal won't strip the controller-populated token. Token value never committed. Co-Authored-By: Claude Opus 4.8 --- .../application-infisical-operator-rbac.yaml | 25 +++++++++++++++++++ .../clusterrolebinding-token-reviewer.yaml | 12 +++++++++ .../secret-token-reviewer.yaml | 10 ++++++++ .../serviceaccount-token-reviewer.yaml | 5 ++++ 4 files changed, 52 insertions(+) create mode 100644 argocd/application-infisical-operator-rbac.yaml create mode 100644 infisical-operator-rbac/clusterrolebinding-token-reviewer.yaml create mode 100644 infisical-operator-rbac/secret-token-reviewer.yaml create mode 100644 infisical-operator-rbac/serviceaccount-token-reviewer.yaml diff --git a/argocd/application-infisical-operator-rbac.yaml b/argocd/application-infisical-operator-rbac.yaml new file mode 100644 index 0000000..3fd718b --- /dev/null +++ b/argocd/application-infisical-operator-rbac.yaml @@ -0,0 +1,25 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: infisical-operator-rbac + namespace: argocd +spec: + destination: + namespace: infisical-operator + server: https://kubernetes.default.svc + project: default + source: + path: infisical-operator-rbac + repoURL: https://git.chemavx.xyz/chemavx/k8s-manifests + targetRevision: main + ignoreDifferences: + # token controller injects .data into the Secret; don't let selfHeal wipe it + - group: "" + kind: Secret + name: infisical-token-reviewer + jsonPointers: + - /data + syncPolicy: + automated: + prune: true + selfHeal: true diff --git a/infisical-operator-rbac/clusterrolebinding-token-reviewer.yaml b/infisical-operator-rbac/clusterrolebinding-token-reviewer.yaml new file mode 100644 index 0000000..6f60dba --- /dev/null +++ b/infisical-operator-rbac/clusterrolebinding-token-reviewer.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: infisical-token-reviewer-auth-delegator +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:auth-delegator # grants TokenReview create +subjects: + - kind: ServiceAccount + name: infisical-token-reviewer + namespace: infisical-operator diff --git a/infisical-operator-rbac/secret-token-reviewer.yaml b/infisical-operator-rbac/secret-token-reviewer.yaml new file mode 100644 index 0000000..c86aaae --- /dev/null +++ b/infisical-operator-rbac/secret-token-reviewer.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: infisical-token-reviewer + namespace: infisical-operator + annotations: + kubernetes.io/service-account.name: infisical-token-reviewer +type: kubernetes.io/service-account-token +# .data is populated by the cluster token controller — never committed to git. +# ArgoCD ignores /data on this Secret (see application-infisical-operator-rbac.yaml). diff --git a/infisical-operator-rbac/serviceaccount-token-reviewer.yaml b/infisical-operator-rbac/serviceaccount-token-reviewer.yaml new file mode 100644 index 0000000..84e6bb4 --- /dev/null +++ b/infisical-operator-rbac/serviceaccount-token-reviewer.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: infisical-token-reviewer + namespace: infisical-operator