Argo CD Hour 5: Security and Secrets Management

Harden Argo CD, manage repository credentials, and let Secrets enter Git only encrypted or as references, then safely turn them into Kubernetes Secrets in the cluster
Argo CD v3.6.1argo-cd chart 10.18.0Sealed Secrets v0.41.2ESO v2.15.0SOPS v3.13.3 · age v1.3.2Verified against official docs · 2026-11-17
Overall learning goals
  • Draw Argo CD's trust boundaries and attack surface (API Server, Repo Server, Application Controller, Redis, Dex), and complete production hardening: after SSO, disable admin, TLS, NetworkPolicy (created by default since chart 10.0), isolate repo-server, tighten the controller's cluster RBAC, and be able to check against the 2025–2026 security advisories whether your version is affected.
  • Use repository / repo-creds two kinds of Secret to declaratively manage private repository credentials, covering HTTPS tokens, SSH private keys,GitHub App three methods, and understand the credential template “longest prefix match” and project-level credentials.
  • Explain why neither plaintext nor base64 can go into Git, and compare from the angles of where decryption happens, who holds the key, and whether Argo CD can see plaintext Sealed Secrets, External Secrets Operator and SOPS.
  • Complete the full Sealed Secrets workflow: kubeseal encryption, three scopes, 30-day key renewal,controller private key backup and restore,--re-encrypt.
  • Use ESO's SecretStore / ClusterSecretStore / ExternalSecret to sync secrets in a zero-cost environment (fake and kubernetes providers), and write production configuration for Azure Key Vault (Workload Identity) and AWS Secrets Manager (IRSA).
  • Use SOPS + age to encrypt manifests, and decrypt them in repo-server via Config Management Plugin sidecar (or KSOPS), and state the security cost of this approach (plaintext ends up in the Redis cache).
  • Use the Source Integrity (spec.sourceIntegrity which replaces the deprecated signatureKeys) require GPG-signed commits, understand head / strict modes and seal commit, and complete one security review.

One-hour time allocation

#TimeModuleCore contentAnimation / interactionLab (kind cluster)
0Before classPrep: secrets and signing examplesCheck Argo CD, AppProject and the gitops-lab repo; create apps/secrets-demo/ directories and namespacesSelf-assessment of current security (10 items)Baseline check
100–06Security model and hardeningComponents and trust boundaries, authentication (JWT, SSO, project tokens), disabling admin, TLS, NetworkPolicy, repo-server isolation, controller RBAC, recent security advisoriesAttack scenario × hardening measure simulatorDisable admin, verify NetworkPolicy
206–13Repository credentials and credential templatesrepository / repo-creds Secret, HTTPS tokens, SSH and known_hosts, GitHub App, project-level credentials, longest prefix matchCredential matching and GitHub App token exchangeConnect private repos with credential templates
313–21Choosing a secrets approachbase64 is not encryption, Git history cannot be retracted, three modes (in-cluster decryption / external reference / decryption at render time), official recommendationCore animation: path of a secret from encrypted form to in-cluster Secret (three-way comparison)Reproduce the “base64 leak” and scan with gitleaks
421–28Sealed SecretsRSA-OAEP + AES-256-GCM, strict / namespace-wide / cluster-wide, 30-day renewal, private key backup, re-encryptkubeseal encryption process and scope validationDeploy SealedSecret via Argo CD
528–35External Secrets OperatorSecretStore / ClusterSecretStore / ExternalSecret, refreshInterval, creationPolicy, Azure Key Vault, AWS Secrets ManagerESO reconciliation loop simulator (change value, disconnect, refresh)fake + kubernetes provider zero-cost lab
635–42SOPS and CMPSOPS file format, age,.sops.yaml CMP sidecar, KSOPS, security trade-offsCMP rendering path and where plaintext landsDeploy with sops-kustomize plugin decryption
742–50Commit signature verification and supply chainSource Integrity (3.5+), GPG keyring, head / strict / seal commit, image signing and SBOM extensionCommit history signature verification simulatorSigned commit → sync; unsigned → rejected
850–60Security review and common vulnerabilitiesReview checklist, advisory grading and escalation policy, audit logs, troubleshooting treeVersion × security advisory checker + troubleshooting treeReview this lesson's environment
—After classCheat sheet · Comprehensive labApply hardening + three secrets approaches + signature verification to team-a's applicationFinal quiz (12 questions)Comprehensive lab

Knowledge Coverage Matrix

Target skillM1M2M3M4M5M6M7M8Key commands / configurationLab
Identify Argo CD attack surface and harden it✓····✓·✓admin.enabled, NetworkPolicyM1 lab
Declaratively manage repository credentials·✓·✓···✓argocd repocreds add,secret-type Labelscredential templates
Choose a secrets management approach··✓✓✓✓·✓decision tablegitleaks scan
Sealed Secrets encryption, rotation and backup···✓···✓kubeseal,--re-encryptM4 lab
ESO syncs external secrets····✓··✓ExternalSecret,ClusterSecretStoreM5 lab
SOPS decryption plugin✓····✓·✓sops -e,plugin.yamlM6 lab
Commit signing and supply chain verification······✓✓argocd gpg add,sourceIntegrityM7 lab
Vulnerability response and security review✓······✓security advisories,argocd versionreview checklist

Content excluded from this lesson (and where to learn it)

TopicWhy it is not in this lessonWhere to learn it
SSO (OIDC / Dex) integration, RBAC policy writing, AppProject roles and JWTCovered systematically in the previous lesson; this lesson only references its conclusion (disable admin after SSO)Hour 4
Kubernetes Secret encryption at rest (KMS v2), Pod Security, ServiceAccount tokensBelongs to cluster security, unrelated to GitOps toolingKubernetes 8 hours Security lesson
Creating and authorizing Azure Key Vault and Workload IdentityRequires a cloud subscription; this lesson only gives the ESO-side configurationAKS 8 hours(Workload Identity)
argocd-vault-plugin (AVP)Officially not recommended to “inject secrets at render time”; this lesson explains the same mechanism and risks via the SOPS CMPArgo CD Secret Management
Full deployment of image-signing admission (Kyverno / Sigstore policy-controller)Belongs to cluster admission control; this lesson only covers its division of labor with Argo CD in module 7Sigstore docs
Argo Rollouts, progressive deliveryNext lesson topicHour 6

How to use this courseware

10 pages per module
Principles · diagrams · animations · commands · labs · production cases · troubleshooting · quiz · voice · video. It is suggested to first watch the core animation in module 3 to build an intuition for “where plaintext appears”, then move on to the labs for the three approaches.
Learning progress
A quiz score ≥ 70% or clicking “Mark this module complete” counts toward progress, saved in this browser (if local storage is blocked, it is cleared on refresh).
Chinese voice
The “Voice” page reads the lecture script aloud with the browser's built-in Web Speech API (en-US); without a Chinese voice pack, the script can still be read or passed to a TTS tool.
Version notes This lesson uses the versions verified on 2026-11-17 as its baseline: Argo CD v3.6.1 (2026-11-04, argo-cd chart 10.18.0); Sealed Secrets controller v0.41.2 (chart 2.22.0); External Secrets Operator v2.15.0 (API group external-secrets.io/v1); SOPS v3.13.3; age v1.3.2; KSOPS v4.5.1; kind v0.33.0. v3.3 reached end of support on 2026-11-03; supported branches are 3.4 / 3.5 / 3.6. GPG's signatureKeys is deprecated, and from 3.5 onward is replaced by sourceIntegrity.
Lab safety note All “secrets” in this lesson are demo values (such as s3cr3t-demo). Do not commit real passwords, tokens or private keys to the lab repo; the age private key and the Sealed Secrets controller private key are root keys that can decrypt everything, so delete them after the lab following the “Cleanup” steps.

Module 0 · Prep: secrets and signing examples (complete before class)

Confirm that the Argo CD, AppProject and gitops-lab repo from the previous lesson are available, and set up this lesson's directory structure and namespace
Before class ≈ 10 minkind v0.33.0 · Argo CD v3.6.1
Prerequisites
  • CompletedHour 4: kind cluster lab (context kind-lab) with Argo CD (namespace argocd, Helm release argocd), AppProject platform,team-a,team-b; second cluster lab2 Not needed for this lesson; you can stop it for now.
  • local clone ~/gitops-lab (your own GitHub repository https://github.com/<you>/gitops-lab.git, default branch main), Argo CD values file is ~/gitops-lab/bootstrap/argocd-values.yaml.
  • Tools: kubectl, helm (v3.x or v4), argocd CLI 3.6, git ≥ 2.34, gpg 2.x; this lesson adds kubeseal,sops,age (see the install commands below).
  • All labs are run in a local kind cluster,zero cloud cost; the Azure / AWS parts of module 5 are read-only and do not require a subscription.

Step 1: Check Argo CD and projects

kubectl config use-context kind-lab
kubectl -n argocd get deploy,sts -o wide
helm -n argocd list
kubectl -n argocd get appprojects
NAME                                               READY   UP-TO-DATE   AVAILABLE
deployment.apps/argocd-applicationset-controller   1/1     1            1
deployment.apps/argocd-dex-server                  1/1     1            1
deployment.apps/argocd-notifications-controller    1/1     1            1
deployment.apps/argocd-redis                       1/1     1            1
deployment.apps/argocd-repo-server                 1/1     1            1
deployment.apps/argocd-server                      1/1     1            1
NAME                                             READY
statefulset.apps/argocd-application-controller   1/1

NAME     NAMESPACE  REVISION  STATUS    CHART           APP VERSION
argocd   argocd     7         deployed  argo-cd-10.18.0 v3.6.1

NAME       AGE
default    5d
platform   2d
team-a     2d
team-b     2d

Step 2 (only if you have no results from the previous lesson): minimal starting point

If the cluster has been deleted, use the commands below to restore the minimal environment this lesson needs within 5 minutes: one kind cluster, Argo CD, and two AppProjects. The SSO and RBAC from the previous lesson do not affect this lesson's labs (module 1 explains how to safely demonstrate disabling admin without SSO).

kind create cluster --name lab
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
mkdir -p ~/gitops-lab/bootstrap
[ -f ~/gitops-lab/bootstrap/argocd-values.yaml ] || cat > ~/gitops-lab/bootstrap/argocd-values.yaml <<'EOF'
configs:
  params:
    server.insecure: false
EOF
helm upgrade --install argocd argo/argo-cd --version 10.18.0 \
  -n argocd --create-namespace -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd port-forward svc/argocd-server 8080:443 >/dev/null 2>&1 &
argocd login localhost:8080 --insecure --username admin \
  --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)"
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: platform
  namespace: argocd
spec:
  description: platform components (controllers, Operators)
  sourceRepos: ["*"]
  destinations:
  - server: https://kubernetes.default.svc
    namespace: "*"
  clusterResourceWhitelist:
  - group: "*"
    kind: "*"
---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: team-a
  namespace: argocd
spec:
  description: business team A
  sourceRepos: ["https://github.com/<you>/gitops-lab.git"]
  destinations:
  - server: https://kubernetes.default.svc
    namespace: "secrets-demo"
  - server: https://kubernetes.default.svc
    namespace: "podinfo-*"
  namespaceResourceWhitelist:
  - group: ""
    kind: "*"
  - group: "apps"
    kind: "*"
  - group: "bitnami.com"
    kind: SealedSecret
  - group: "external-secrets.io"
    kind: ExternalSecret
kubectl apply -f ~/gitops-lab/argocd/projects/platform-team-a.yaml
Noteteam-a 's allowlist only allows ExternalSecret, and does not allow the team to create SecretStore: the connection method for the secrets backend (and the identity it uses) is set up by the platform team through ClusterSecretStore a unified mechanism. This is an important design point of module 5.

Step 3: Install this lesson's CLI tools (Linux / WSL / macOS)

# kubeseal (same version as the controller)
KUBESEAL_VERSION=0.41.2
curl -fsSLO "https://github.com/bitnami-labs/sealed-secrets/releases/download/v${KUBESEAL_VERSION}/kubeseal-${KUBESEAL_VERSION}-linux-amd64.tar.gz"
tar -xzf kubeseal-${KUBESEAL_VERSION}-linux-amd64.tar.gz kubeseal && sudo install -m 755 kubeseal /usr/local/bin/kubeseal

# sops
curl -fsSLo sops https://github.com/getsops/sops/releases/download/v3.13.3/sops-v3.13.3.linux.amd64
sudo install -m 755 sops /usr/local/bin/sops

# age (includes age and age-keygen)
curl -fsSLO https://github.com/FiloSottile/age/releases/download/v1.3.2/age-v1.3.2-linux-amd64.tar.gz
tar -xzf age-v1.3.2-linux-amd64.tar.gz && sudo install -m 755 age/age age/age-keygen /usr/local/bin/

kubeseal --version; sops --version; age --version
kubeseal version: 0.41.2
sops 3.13.3 (latest)
v1.3.2

available on macOS brew install kubeseal sops age. For production, verify the checksums file and signatures provided on the release page (SOPS provides cosign signatures and an SBOM); this is itself the supply-chain habit covered in module 7.

Step 4: Set up this lesson's directories and namespaces

cd ~/gitops-lab
mkdir -p apps/secrets-demo/{sealed,eso,sops} argocd/apps platform/{sealed-secrets,external-secrets}
kubectl create namespace secrets-demo --dry-run=client -o yaml | kubectl apply -f -
tree -d -L 2 apps/secrets-demo platform
apps/secrets-demo
├── eso
├── sealed
└── sops
platform
├── external-secrets
└── sealed-secrets

Convention: platform/ holds platform components (deployed by the platform project),apps/secrets-demo/ holds business secrets (deployed by the team-a project). Application manifests go in argocd/apps/.

Warm-up: answer from memory (30 seconds)

Which Argo CD component runs helm template / kustomize build?

argocd-repo-server. It clones the repository, renders manifests, and caches the result in Redis. It does not have Kubernetes write permissions — this point drives many of the security conclusions in modules 1 and 6.

Is the data field of a Kubernetes Secret encrypted?

No, it is only base64-encoded. echo czNjcjN0 | base64 -d It can be reversed. Whether it is encrypted in etcd depends on whether the cluster has static encryption (KMS) configured, and has nothing to do with Git.

Security self-assessment (10 items)

Check the items for your Argo CD environment Already implemented: items (results are saved in this browser). Come back and check again after completing this lesson and the comprehensive lab.

Environment self-check list

Module 1 · Argo CD security model and hardening

00:00 – 06:00 · Argo CD holds the “keys that can change the cluster” and executes rendering tools from the repository, so first understand the trust boundaries, then harden layer by layer
6 minArgo CD v3.6.1NetworkPolicy created by default from chart 10.0★★★★★
Learning goals
  • Name the sensitive data each of the five components holds: argocd-server (sessions, OIDC client secret), repo-server (cloned repositories, rendering tools, possibly plugin secrets), application-controller (cluster credentials, write permissions), Redis (render result cache), and Dex (IdP connector secrets).
  • Complete the four hardening measures (“disable admin after SSO”, TLS, NetworkPolicy, and tightening the controller ClusterRole) and verify that each one actually takes effect.
  • Read Argo CD security advisories: affected versions, fixed versions, and exploitation prerequisites (for example, “only requires Application get permission”), and use these to decide upgrade priority.
Prerequisites: lesson 1 component architecture; lesson 4 SSO, RBAC and AppProject. Importance:★★★★★ (once Argo CD is compromised, every managed cluster is compromised)

What: Argo CD's trust boundaries

Argo CD is a high-privilege reconciler: application-controller is bound by default to a cluster-admin -level ClusterRole (with all verbs on */* ), and stores credentials for all external clusters; repo-server executes helm template,kustomize build, Jsonnet or plugin commands based on Git content. There are therefore two main attack paths:

  • From the API / UI: account takeover, overly broad RBAC configuration, or exploiting API vulnerabilities to read credentials or secrets (for example, 2025-09 CVE-2025-55190: a project-level API token could read repository credentials).
  • From Git: someone with repository write access commits a malicious manifest or malicious rendering input, causing Argo CD to deploy it on their behalf (“unauthorized deployment”), or causing repo-server to execute commands or read files during rendering (in 2026-10 several Critical advisories of this kind were published at once).
ComponentSensitive data / capabilityWhat must be preventedKey hardening
argocd-serverExternal API / UI; issues local account JWTs; reads and writes Argo CD configurationweak passwords, shared admin, exposure to the public internet, XSS (link annotations)SSO + disable admin, TLS, least-privilege RBAC, expose only via Ingress / gateway
argocd-repo-servercloned repositories; Helm / Kustomize / Jsonnet / plugin execution; repository credentials passed in by the caller when requests arrivemalicious kustomization / jsonnet / chart reads files or executes commandsallow only server, controller, appset and notifications to connect (NetworkPolicy); grant no Kubernetes permissions; disable unused tools; patch promptly
application-controllerall cluster credentials, write permission to target clustersinduced to deploy resources beyond its scope (e.g., a PreDelete hook bypassing AppProject, GHSA-fmxq-cgp8-87wp)tighten ClusterRole; AppProject allowlist; restrict who can delete Applications
Rediscached rendered manifests (if secrets were injected at render time, they are plaintext here)other Pods in the same cluster connect directly to 6379NetworkPolicy; keep Redis authentication enabled (the chart's default is a password generated by a redisSecretInit Job argocd-redis and stored in the Secret); TLS where needed
Dex / OIDCIdP connector secretsecret written into Gitsecret placed in argocd-secret, use $key reference; manage with Sealed Secrets / ESO

Why: why hardening must be done separately

Argo CD's default installation aims to “just work”: the initial admin password is stored in argocd-initial-admin-secret, the controller has cluster-admin privileges, and between repo-server and server, by default repo-server uses a self-signed certificate and does not verify. In a lab environment this is all reasonable; in production, it means a leaked admin password can modify any cluster.

How: authentication, authorization and transport

  • All authentication is JWT-based: local users (including admin) have tokens issued by argocd-server using server.secretkey , which expire after 24 hours; changing a password immediately revokes old tokens; tokens for SSO users are issued by the IdP (or Dex); project role tokens (lesson 4) are scoped within the project, can have an expiry set, and can be revoked by ID.
  • Authorization: the groups and argocd-rbac-cm policies in the JWT are compared; any matching allow rule grants access. In v3 the default policy.default is empty, so an unmatched request is denied.
  • Transport: components communicate over gRPC over TLS. argocd-server defaults to a minimum of TLS 1.2 (--tlsminversion); repo-server by default generates a non-persistent self-signed certificate at startup, and callers connect to it using TLS that “does not verify”. Verification requires creating a persistent argocd-repo-server-tls certificate and configuring callers to use --repo-server-ca-cert-path (recommended) or the deprecated --repo-server-strict-tls.
  • Network isolation: the argo-cd chart, starting from 10.0.0 , changed the default of global.networkPolicy.create from false to true, and creates a NetworkPolicy per component that allows only the necessary sources (for example, repo-server only accepts connections from server, controller, notifications and applicationset; the metrics port is excepted). Prerequisite: the cluster CNI enforces NetworkPolicy: kind has built-in kube-network-policies from v0.24; AKS requires Azure NPM / Cilium / Calico.
  • Operate as the target ServiceAccount (impersonation, lesson 4): when enabled, sync runs as the identity specified by the AppProject destinationServiceAccounts , and from v3.5 resource operations initiated by the API Server also use that identity. This means the controller's high privileges are no longer the only permission boundary, and it is the recommended path for tightening RBAC.
  • repo-server isolation: repo-server itself needs no Kubernetes permissions and does not persist Git credentials long-term (credentials are stored in Secrets and passed in by server / controller at request time). It is the component that “executes untrusted input”, so: give it its own Pod security context (non-root, read-only root filesystem; already set by default in the chart), disable unneeded tools (such as jsonnet.enable: "false"), place CMP plugins in a sidecar with a separate /tmp.

When: harden in priority order

PriorityMeasureVerification
P0 (required before go-live)upgrade to the latest patch on a supported branch; after SSO, disable admin, delete argocd-initial-admin-secret; argocd-server uses a trusted certificateargocd version; logging in as admin should fail
P1NetworkPolicy takes effect; tighten the controller ClusterRole or use AppProject allowlists; restrict who can create repositories / delete Applicationscross-namespace connections to Redis / repo-server time out; argocd admin settings rbac can
P2repo-server certificate verification / mTLS; disable unused configuration tools; ship audit logs and Kubernetes Events externallyno TLS warnings in component logs; sync events can be found in the SIEM

Comparison with similar tools

Argo CDFlux CDCI push-based (kubectl apply in pipeline)
Where cluster credentials are keptmanaged within the cluster (controller + cluster Secret)within each cluster (controller ServiceAccount)CI system (pipeline variables)
External exposureAPI Server + UI (requires authentication and RBAC)no UI (Weave GitOps optional)CI platform
Multi-tenant isolationAppProject + RBACKubernetes RBAC + tenant ServiceAccount impersonationdepends on pipeline permissions
Commit signature verificationSource Integrity (GPG)GitRepository .spec.verify (GPG / cosign)must be implemented yourself
Common misconceptions① “Argo CD is inside the cluster, so TLS and network policies are not needed” — any Pod in the same cluster can connect to Redis and repo-server, and the cache may contain plaintext secrets. ② “With AppProject, there is no need to tighten the controller's RBAC” — AppProject is Argo CD's own check; once a bypass appears (such as the PreDelete/PostDelete hook bypass published in 2026-10), only Kubernetes RBAC serves as the fallback. ③ “Only people who can write to Git can exploit rendering vulnerabilities” — several 2026-10 advisories have a second path: only needing get permission on a given Application, one can go through the manifestsWithFiles API to upload malicious input.

Architecture diagram: trust boundaries and where sensitive data lives

User / CIbrowser, argocd CLI Git / Helm / OCIWhoever has write access = can deploy argocd namespace (NetworkPolicy boundary) argocd-serverJWT · RBAC · UITLS 1.2+ · SSO argocd-repo-serverruns helm / kustomizejsonnet / CMP sidecar⚠ processes untrusted input application-controllerCluster credentials · write permissionsdefault */* ClusterRole Redismanifest cache (may contain plaintext) Secret: argocd-secretrepository / repo-credscluster Secret Target clusterlab / lab2kube-apiserverCompromised = everything lost HTTPS gRPC TLS clone apply
Figure 1-1: the red parts are those “holding write permissions / cluster credentials”, the yellow parts are those “processing untrusted input / where plaintext may appear”; NetworkPolicy should allow only the arrows shown in the diagram

Flow diagram: two attack paths and corresponding defenses

Path A: APIaccount theft / privilege escalation / API vulnerability SSO + MFADisable admin RBAC least privilegepolicy.default is empty upgrade promptlysubscribe to security advisories audit logs Path B: Gitmalicious manifest / rendering input branch protection + signingSource Integrity AppProject allowlistsource / destination / resource kinds repo-server isolationdisable tools · patch controller RBAClast line of defense Defense in depth: when any one layer is bypassed, the layers behind it should still be able to block or limit the damage
Figure 1-2: the defenses on the API path and on the Git path respectively; the controller's Kubernetes RBAC is the fallback when Argo CD's own checks fail

Interactive simulator: attack scenario × hardening measure

First tick the hardening measures you have already enabled on the left, then select an attack scenario and click “Play”. The simulator shows step by step which components the request passes through, and at which step it is blocked by which measure (or why it is not blocked). The scenarios are drawn from the official Argo CD security documentation and real security advisories from 2025–2026.

Enabled hardening measures
Attack scenario
Please select a scenario.
Ready.
$ # Select a scenario to start

Core commands and parameters

CommandPurposeKey parameters / notes
argocd versionShow both CLI and server versionsCompare against security advisories to determine whether affected
argocd account list / get-user-infoList local accounts, view current identity and groupsConfirm whether admin is disabled
argocd admin settings rbac canEvaluate RBAC policy offlineROLE ACTION RESOURCE SUBRESOURCE --namespace argocd
kubectl -n argocd get networkpolicyView the network policies created by the chartcreated by default in chart 10.0+
kubectl auth can-i --list --as=system:serviceaccount:argocd:…Check the real permissions of component ServiceAccountsrepo-server should have almost no permissions
kubectl -n argocd create secret tls argocd-server-tlsConfigure a certificate for argocd-server (automatic hot reload)--cert --key

Disable admin (values snippet)

configs:
  cm:
    admin.enabled: "false"          # disable only after SSO verification works
    # If there is no SSO during the lab, use a local account instead (production uses SSO groups)
    accounts.alice: login
  rbac:
    policy.default: ""              # v3 default: unmatched requests are denied
    policy.csv: |
      g, alice, role:admin
  params:
    server.disable.swagger.ui: "true"   # optional: reduce unauthenticated exposure
# First set a password for alice (admin still works at this point)
argocd account update-password --account alice \
  --current-password "$ADMIN_PW" --new-password 'Alice-Lab-2026!'
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
argocd login localhost:8080 --insecure --username alice --password 'Alice-Lab-2026!'
argocd account list
kubectl -n argocd delete secret argocd-initial-admin-secret
'admin:login' logged in successfully
NAME   ENABLED  CAPABILITIES
admin  false    login
alice  true     login
secret "argocd-initial-admin-secret" deleted

How to verify: Logging in again as admin should return Invalid username or password (a disabled account and a wrong password return the same message, to avoid account enumeration). Common mistake: Disabling admin before SSO has been verified to work locks yourself out; see “Troubleshooting” for recovery. Production use: keep admin only as a “break-glass” account in the password vault, and keep it disabled normally.

Check network policies and component permissions

kubectl -n argocd get networkpolicy
kubectl auth can-i --list --as=system:serviceaccount:argocd:argocd-repo-server | head -5
kubectl get clusterrole argocd-application-controller -o jsonpath='{.rules}'; echo
NAME                               POD-SELECTOR                                                  AGE
argocd-application-controller      app.kubernetes.io/instance=argocd,app.kubernetes.io/name=...  5d
argocd-applicationset-controller   ...
argocd-dex-server                  ...
argocd-notifications-controller    ...
argocd-redis                       ...
argocd-repo-server                 ...
argocd-server                      ...
Resources                                       Non-Resource URLs   Resource Names   Verbs
selfsubjectreviews.authentication.k8s.io        []                  []               [create]
selfsubjectaccessreviews.authorization.k8s.io   []                  []               [create]
selfsubjectrulesreviews.authorization.k8s.io    []                  []               [create]
[{"apiGroups":["*"],"resources":["*"],"verbs":["*"]},{"nonResourceURLs":["*"],"verbs":["*"]}]

repo-server only has the self-check permissions that all identities have, which is normal; the controller's */*/* is where tightening is needed.

Restrict the controller's write permissions (values snippet; adjust for production as needed)

controller:
  clusterRoleRules:
    enabled: true
    rules:
    - apiGroups: ["*"]
      resources: ["*"]
      verbs: ["get", "list", "watch"]          # global read-only: reconciliation needs to see everything
    - apiGroups: ["", "apps", "batch", "networking.k8s.io", "bitnami.com", "external-secrets.io"]
      resources: ["*"]
      verbs: ["create", "update", "patch", "delete"]
    # Deliberately excludes write permissions on rbac.authorization.k8s.io: even if AppProject is bypassed,
    # it cannot create a ClusterRoleBinding to escalate privileges (platform component RBAC is deployed through a separate high-privilege channel)

After tightening, platform applications that need to deploy RBAC objects (for example, a chart that installs ESO) will fail to sync. Common practice: platform components are deployed by another high-privilege Argo CD instance or with separate “platform” cluster credentials, while the business Argo CD gets only restricted permissions; or on the target cluster, use argocd-manager namespace-level Role (the namespace-scoped cluster from lesson 4).

Lab 1: Disable admin and verify network isolation (about 6 min)

Record the version, compare against the module 8 advisory checker:
argocd version --short
helm -n argocd get values argocd -a | grep -A2 'networkPolicy:' | head -6
argocd: v3.6.1+...
argocd-server: v3.6.1+...
  networkPolicy:
    create: true
    defaultDenyIngress: false
Verify that NetworkPolicy really takes effect: connecting to Redis and repo-server from other namespaces should time out; a non-Argo CD Pod inside the argocd namespace should also time out (the policy allows by Pod label, not by namespace).
kubectl run np-test -n default --rm -i --restart=Never --image=busybox:1.37 -- \
  sh -c 'nc -zv -w 3 argocd-redis.argocd 6379; nc -zv -w 3 argocd-repo-server.argocd 8081; echo done'
kubectl run np-test -n argocd --rm -i --restart=Never --image=busybox:1.37 -- \
  sh -c 'nc -zv -w 3 argocd-redis 6379; echo done'
nc: argocd-redis.argocd (10.96.33.12:6379): Connection timed out
nc: argocd-repo-server.argocd (10.96.71.5:8081): Connection timed out
done
nc: argocd-redis (10.96.33.12:6379): Connection timed out
done

If it shows open, this means the CNI does not enforce NetworkPolicy (an older kind, or AKS without the network policy engine enabled), or global.networkPolicy.create was turned off.

Create a replacement account and disable admin: modify the values snippet from the “Commands” page ~/gitops-lab/bootstrap/argocd-values.yaml, then:
ADMIN_PW=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)
# Step 1: only add accounts.alice and policy.csv (do not disable admin yet); after upgrading, set the password for alice
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
argocd account update-password --account alice --current-password "$ADMIN_PW" --new-password 'Alice-Lab-2026!'
argocd login localhost:8080 --insecure --username alice --password 'Alice-Lab-2026!'
argocd app list >/dev/null && echo "alice OK"
# Step 2: then change admin.enabled to "false" and upgrade
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
argocd login localhost:8080 --insecure --username admin --password "$ADMIN_PW"
alice OK
FATA[0000] rpc error: code = Unauthenticated desc = Invalid username or password
Verify RBAC offline:
kubectl -n argocd get cm argocd-rbac-cm -o jsonpath='{.data.policy\.csv}' > /tmp/policy.csv
argocd admin settings rbac can alice sync applications 'team-a/*' --policy-file /tmp/policy.csv
argocd admin settings rbac can bob   sync applications 'team-a/*' --policy-file /tmp/policy.csv
Yes
No
Commit and clean up: commit the values changes to gitops-lab (do not commit passwords). If you want to keep using admin for the later labs, you can temporarily change admin.enabled back to "true"; later commands in this lesson all use alice for demonstration.
cd ~/gitops-lab && git add bootstrap/argocd-values.yaml && git commit -m "harden: disable admin, add break-glass alice" && git push

Case 1: “ghost sync” caused by a shared admin password

Problem: Several teams share the admin account; in the production cluster a Deployment was manually synced back to an old version, and Kubernetes Events only show admin initiated sync, so accountability cannot be established. Approach: connect Entra ID (OIDC) and authorize by group; disable admin, and keep its password in the password vault as a “break-glass” account, with use requiring approval. Configuration:admin.enabled: "false",policy.default: "", and audit events are sent to the SIEM through the event exporter. Limitations: When SSO fails, the break-glass procedure must be enabled (changing the ConfigMap requires cluster permissions, which are themselves audited).

Case 2: 2026-10 incident response for rendering vulnerabilities

Problem: On 2026-10-07 Argo CD published several Critical advisories at once (Kustomize remote ref command execution, Kustomize Helm plugin command execution, Jsonnet arbitrary file read, and PreDelete/PostDelete hook bypassing AppProject), with fixed versions 3.3.15 / 3.4.10 / 3.5.4. Approach: upgrade the chart within 24 hours; before the upgrade is complete, apply the temporary mitigations from the advisories: jsonnet.enable: "false" (if Jsonnet is not used), from kustomize.buildOptions remove --enable-helm, tighten Application get permissions (this only closes the upload path). Configuration: Renovate monitors argo-helm chart versions; security advisories are followed via GitHub Security Advisories subscriptions. Limitations: Some mitigations break applications that depend on the feature, so usage must be inventoried first.

Case 3: a workload in the same cluster reads the Redis cache

Problem: During a penetration test, a compromised business Pod connected directly to argocd-redis:6379, and read a database password injected by a plugin from the rendering cache. Approach: enable NetworkPolicy (AKS with Cilium network policy enabled); change the plugin that “injects secrets at render time” to ESO (modules 3 and 5). Limitations: NetworkPolicy only governs Pod networking; nodes themselves (hostNetwork Pods) may still have access, so node isolation or a separate Argo CD cluster is needed.

Common errors and fixes

FATA[0000] rpc error: code = Unauthenticated desc = Invalid username or password (locked out after disabling admin)

Cause: admin has been disabled, while SSO / the replacement account is not yet usable.

kubectl -n argocd get cm argocd-cm -o jsonpath='{.data.admin\.enabled}'; echo
kubectl -n argocd logs deploy/argocd-server | grep -i -E 'oidc|dex|login' | tail

Fix: break-glass is possible with cluster access: temporarily kubectl -n argocd patch cm argocd-cm --type merge -p '{"data":{"admin.enabled":"true"}}', and change it back after SSO is fixed (and update the values as well, otherwise the next helm upgrade will overwrite it). If you forgot the admin password, you can use argocd account bcrypt to generate a hash and write it into argocd-secret of admin.password and update admin.passwordMtime.

Unable to create application: ... rpc error: code = Unavailable desc = connection error: ... dial tcp 10.96.x.x:8081: i/o timeout

Cause: a custom NetworkPolicy or defaultDenyIngress: true blocked the connection to repo-server; or the repo-server Pod labels were changed and no longer match the policy.

kubectl -n argocd get networkpolicy argocd-repo-server -o yaml | sed -n '/spec:/,$p'
kubectl -n argocd get pod --show-labels | grep -E 'server|controller'

Fix: confirm the source Pod's app.kubernetes.io/name label appears in the from of the repo-server policy; new components (such as a self-built CMP caller) must be allowed separately.

argocd-server log: http: TLS handshake error from 10.244.x.x: remote error: tls: unknown certificate authority

Cause: The Ingress / load balancer connects to the backend over HTTPS but does not trust argocd-server's self-signed certificate; or a client accesses the self-signed certificate directly.

kubectl -n argocd get secret argocd-server-tls -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -noout -subject -issuer -enddate

Fix: terminate TLS at the Ingress and set server.insecure: "true" (the backend uses plaintext inside the cluster and needs to be paired with NetworkPolicy), or write a trusted certificate into argocd-server-tls (automatic hot reload).

Sync failed: ... is forbidden: User "system:serviceaccount:argocd:argocd-application-controller" cannot create resource "clusterrolebindings"

Cause: This is exactly the expected effect of tightening the controller ClusterRole: the business Argo CD can no longer create RBAC objects.

Fix: confirm this is a platform component rather than a business application; move it to be deployed through the platform channel, or grant permissions separately for the specific API group. Do not change permissions back to * just to make the sync pass.

Command-line exercise
1. One command to confirm whether the admin account has been disabled.
argocd account list    # ENABLED column shows false
# Or without logging in:
kubectl -n argocd get cm argocd-cm -o jsonpath='{.data.admin\.enabled}'
2. Verify that a Pod in the default namespace cannot connect to argocd-redis.
kubectl run t --rm -i --restart=Never --image=busybox:1.37 -- nc -zv -w 3 argocd-redis.argocd 6379
Scenario analysis
The security team says: “We only give developers read-only (get) permission on Applications, so the 2026-10 Jsonnet file read vulnerability does not concern us.” Is this judgment correct? How should it be handled?

No. This advisory (GHSA-m3vr-7329-44ww) has two exploitation paths: submitting a .jsonnet file to the repository being built,or via manifestsWithFiles API upload; the latter only requires get permission on an existing directory-type Application. Handling: upgrade to 3.3.15 / 3.4.10 / 3.5.4 or later (the baseline 3.6.1 in this lesson already includes the fix); if Jsonnet is not used, set it before upgrading jsonnet.enable: "false"; and check which sensitive contents are readable by repo-server (mounted private keys, environment variables).

Verified teaching videos

▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · introductory review: components, Application, automated sync (recorded earlier; for versions and security configuration, follow this lesson)

No video specifically about Argo CD hardening was found that is verified via YouTube oEmbed. A CNCF talk titled “Threat Model Report: Security Considerations for Hardening Declarative GitOps on Kubernetes with Argo CD” was found, but its video ID could not be verified, so no link is listed.

Official documentation

Video storyboard script (about 90 seconds)

This courseware cannot directly generate a video or MP3; a storyboard and narration script are provided, which can be passed to a video tool to generate.

Shot 1 · 0–15s
Visual: five component boxes; the controller is marked red for “cluster write permission”, and repo-server is marked yellow for “executes rendering tools”.
Narration: Argo CD holds the keys to change the cluster, and it also executes rendering tools from the repository. The security design starts from these two points.
Shot 2 · 15–40s
Visual: an attacker enters from both the API and Git directions, with shields such as SSO, RBAC, signing and AppProject appearing along the way.
Narration: two attack paths, each with several layers of defense: identity, authorization, commit signing, project allowlist, and finally Kubernetes RBAC as the fallback.
Shot 3 · 40–65s
Visual: a Pod in the default namespace tries to connect to Redis and is blocked by NetworkPolicy; the terminal shows Connection timed out.
Narration: since chart 10.0, network policies are created by default, but only if your CNI enforces them. Be sure to verify this yourself.
Shot 4 · 65–90s
Visual: a timeline showing four Critical advisories from October 2026, next to the fixed version numbers.
Narration: subscribe to security advisories and upgrade promptly on supported branches. When reading an advisory, focus on the exploitation prerequisites, such as needing only read permission.
or score ≥ 70% in the Quiz

Module 2 · Repository credentials, credential templates and private repositories

06:00 – 13:00 · A repository credential is a labeled Secret: repository is scoped to one repo, and repo-creds is reused by URL prefix
7 minHTTPS · SSH · GitHub App★★★★☆
Learning goals
  • Use argocd.argoproj.io/secret-type: repository and repo-creds two types of label to declaratively manage credentials, and explain the rules “a repository with its own credentials does not use a template” and “templates match by longest prefix”.
  • For GitHub, choose the right credential: fine-grained PAT (simple, but tied to a person), read-only Deploy Key (SSH, one key per repo),GitHub App (organization-level, automatically issued installation tokens valid for 1 hour).
  • Manage SSH known_hosts (argocd-ssh-known-hosts-cm) and custom CA (argocd-tls-certs-cm), and reject --insecure-skip-server-verification.
  • Understand project-level credentials (project ) field) and the risks of repository write permissions (for example, the SSH proxy command injection advisory GHSA-j6cw-g6p4-7hch).
Prerequisites: module 1; the PAT, Deploy Key and GitHub App concepts from the GitHub course. Importance:★★★★☆

What: credentials are stored as Secrets in the argocd namespace

Whether you add a repository via the UI, the CLI or declarative YAML, the result is a labeled Secret in the argocd namespace:

Label valueMeaningRequired fieldsTypical use
repositoryA specific repository (with or without credentials)url (Helm / OCI additionally needs type,name)register a repository; public repositories; repositories needing separate credentials
repo-credscredential template, matched by URL prefixurl (prefix) + credential fieldsone credential shared by dozens of repositories in an organization
repository-write / repo-write-credswrite credentials (used by features that need to push, such as Source Hydrator)same as aboverendered manifest push for lesson 2; not needed for read-only deployment

credential fields: HTTPS uses username + password (token in password; username can be any non-empty string, some platforms require a real username; Bitbucket uses x-token-auth), optional tlsClientCertData / tlsClientCertKey; SSH uses sshPrivateKey; GitHub App uses githubAppID,githubAppInstallationID (can be omitted; automatically discovered per organization),githubAppPrivateKey, GitHub Enterprise additionally adds githubAppEnterpriseBaseUrl. An optional project field restricts the credential to one AppProject.

v3 changes Argo CD v3 has removed the old argocd-cm from repositories,repository.credentials,helm.repositories keys. Repositories and credentials can only be declared as Secrets with argocd.argoproj.io/secret-type: repository / repo-creds labels; migration must be done before upgrading from v2.

Why: why use credential templates

If every repository stores its own token, rotating the token means editing dozens of Secrets, and it is easy to miss one. Credential templates separate the “repository list” from the “credentials”: the repository Secret only writes url, while the credentials are centralized in one repo-creds , so rotation only changes one place.

How: matching rules

  1. An Application's repoURL first looks for an exactly matching repository Secret. If it has its own credential fields (username/password/sshPrivateKey etc.), it is used directly.
  2. Otherwise, it looks among all repo-creds for url templates whose repoURL is a prefix, and takes the longest (most specific) one; the order of definition does not matter.
  3. Credentials with a project field apply only to that project's Applications; those without it act as defaults for all projects.
  4. When the controller / server sends requests to repo-server, it passes the resolved credentials along with the request; repo-server does not read Kubernetes Secrets.

How a GitHub App works: Argo CD signs a short-lived JWT (RS256) with the App private key, and calls POST /app/installations/{id}/access_tokens to obtain an installation token valid for about 1 hour, then clones over HTTPS (username x-access-token). The private key itself is never sent to the Git server; the token expires automatically, and permissions are determined by the App's installation scope (selected repositories + Contents: Read-only).

When: how to choose

MethodAdvantagesDisadvantagesRecommended scenario
Fine-grained PAT (HTTPS)simplest; can be limited to repositories and read-onlytied to a personal account, becomes invalid when the person leaves; has an expiry and must be rotatedlabs, personal projects
Deploy Key (SSH)one key per repo, naturally least privilege; not tied to a personone key per repository, hard to manage at scale; requires known_hostsa few critical repositories
GitHub Apporganization-level, tokens expire after 1 hour, auditable, not tied to a person; one template covers the whole organizationrequires an organization admin to create and install the App; the private key must be protectedpreferred for production (GitHub / GHES)
Azure Workload Identity (useAzureWorkloadIdentity)no long-term keysAzure DevOps / ACR onlyAKS + Azure Repos (see the AKS course)
Common misconceptions① “If the repository Secret has a username but no password, the template fills it in” — no; as soon as the repository Secret contains any credential field, the template is no longer used. ② “Credential templates match by definition order” — since v1.4 they match by longest prefix. ③ “If SSH known_hosts is not configured, that's fine, just add ' --insecure-skip-server-verification” — this lets a man-in-the-middle attacker replace your manifest source. ④ “Credential Secrets can be committed to Git directly” — no; generate them with Sealed Secrets or ESO (used in the labs of modules 4 and 5), and keep the ' secret-type ' label.

Structure diagram: repositories, templates and projects

ApplicationrepoURL: https://github.com/acme/payments.git ① repository Secret (exact URL)url: …/acme/payments.git (no credential fields)→ continue looking for a template ② repo-creds: https://github.com/acmeGitHub App (organization-level)prefix length 26 ③ repo-creds: https://github.com/acme/payfine-grained PAT (read-only, payments team)longer prefix → wins controllerresolve credentials and pass them along withthe gRPC request repo-servergit fetchdoes not read the Secret
Figure 2-1: when the repository Secret has no credentials, the longest prefix is matched among repo-creds; the controller / server resolves the credentials and passes them along with the request to repo-server

Sequence diagram: GitHub App exchanges for an installation token

Argo CDapi.github.comgithub.com (git) ① sign JWT with App private key (iss = App ID, ≤10 minutes) ② POST /app/installations/{id}/access_tokens ③ installation token ghs_… (expires in about 1 hour, scope = installed repositories) ④ git fetch over HTTPS (x-access-token : ghs_…) the private key is used only for local signing; the token is cached and automatically renewed before expiry
Figure 2-2: GitHub App token exchange: the long-term private key never leaves Argo CD; Git only sees a short-lived token

Interactive simulator: which credential does this repoURL use?

On the left are the credential Secrets in the argocd namespace (can be toggled on / off); on the right, enter the Application's repoURL and project, then “step through the resolution”. The simulator follows Argo CD's real rules: exact repository match → whether it has its own credentials → project-level first → longest repo-creds prefix. When GitHub App is selected, it continues to demonstrate the token exchange.

Credential Secret
Request
repoURL:
Application's project:
Ready.
$ argocd app get team-a/payments --refresh

Core commands and parameters

CommandPurposeKey parameters
argocd repo add URLAdd a repository (and test the connection)--username --password,--ssh-private-key-path,--github-app-id --github-app-installation-id --github-app-private-key-path,--project
argocd repocreds add URL_PREFIXAdd a credential templatesame as above; list / rm
argocd repo list / getView repositories and connection statusCONNECTION STATUS,-o yaml
argocd cert add-ssh --batchImport SSH host public keytogether with ssh-keyscan
argocd cert add-tls HOST --fromImport custom CAwrite into argocd-tls-certs-cm
kubectl -n argocd get secret -l argocd.argoproj.io/secret-typeList all credential Secretslabel values repository / repo-creds / cluster

HTTPS token + credential template (declarative)

apiVersion: v1
kind: Secret
metadata:
  name: creds-github-you
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repo-creds
stringData:
  type: git
  url: https://github.com/<you>              # prefix: covers all repositories under your account
  username: git                                # any non-empty string
  password: github_pat_xxxxxxxxxxxxxxxx        # fine-grained PAT: Contents read-only
---
apiVersion: v1
kind: Secret
metadata:
  name: repo-gitops-lab
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
stringData:
  type: git
  url: https://github.com/<you>/gitops-lab.git      # no credentials written → uses the template above

SSH Deploy Key + known_hosts

ssh-keygen -t ed25519 -N '' -C argocd-gitops-lab -f ~/.ssh/argocd_gitops_lab
# Add ~/.ssh/argocd_gitops_lab.pub as a read-only Deploy Key on the repository (GitHub → Settings → Deploy keys)
ssh-keyscan github.com 2>/dev/null | argocd cert add-ssh --batch
argocd repo add git@github.com:<you>/gitops-lab.git --ssh-private-key-path ~/.ssh/argocd_gitops_lab
argocd repo list
Enumerated 3 SSH known host entries...
Repository 'git@github.com:<you>/gitops-lab.git' added
TYPE  NAME  REPO                                   INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
git         git@github.com:<you>/gitops-lab.git  false     false  false  true   Successful

How to verify: STATUS is Successful; kubectl -n argocd get cm argocd-ssh-known-hosts-cm -o yaml contains the github.com ed25519 / ecdsa / rsa host keys. Common errors: scp-style git@host:repo cannot specify a port; a non-standard port must be written as ssh://git@host:2222/repo.git; ssh-keyscan itself does not verify host identity, so in production compare against the fingerprints officially published by GitHub.

GitHub App (organization-level template, recommended for production)

argocd repocreds add https://github.com/acme \
  --github-app-id 123456 \
  --github-app-installation-id 7890123 \
  --github-app-private-key-path ./acme-argocd.private-key.pem
argocd repocreds list
Repository credentials for 'https://github.com/acme' added
URL PATTERN               USERNAME  SSH_CREDS  TLS_CREDS  GITHUB_APP
https://github.com/acme             false      false      true
apiVersion: v1
kind: Secret
metadata:
  name: creds-github-acme
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repo-creds
stringData:
  type: git
  url: https://github.com/acme
  githubAppID: "123456"
  githubAppInstallationID: "7890123"     # can be omitted: discovered automatically per organization
  githubAppPrivateKey: |
    -----BEGIN RSA PRIVATE KEY-----
    ...
    -----END RSA PRIVATE KEY-----

App permissions: Repository permissions → Contents: Read-only (minimum requirement), Metadata: Read-only (included automatically). Install the App only on the repositories that need deployment, not on “All repositories”.

Lab 2: make gitops-lab a private repository and connect it using a credential template (about 7 min)

Prepare a fine-grained PAT: GitHub → Settings → Developer settings → Fine-grained tokens: under Repository access, select only gitops-lab, Permissions → Contents: Read-only, expiry 7 days. Then change the repository to Private (or use a new private test repository).
export GH_PAT='github_pat_...'   # only in the current shell; do not write it to a file
argocd app get podinfo-dev --hard-refresh | grep -E 'Sync Status|Message' || true
Sync Status:  Unknown
Message:      Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = failed to list refs: authentication required: Repository not found.
Create a credential template (prefix is your account) and confirm the repository Secret carries no credentials:
argocd repocreds add https://github.com/<you> --username git --password "$GH_PAT"
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type -L argocd.argoproj.io/secret-type
argocd repo list
NAME                   TYPE     DATA   AGE   SECRET-TYPE
creds-1234567890       Opaque   4      5s    repo-creds
repo-1234567891        Opaque   2      3d    repository
TYPE  NAME  REPO                                    ...  CREDS  STATUS      MESSAGE
git         https://github.com/<you>/gitops-lab.git   ...  false  Successful

CREDS false indicates the repository Secret carries no credentials itself; a successful connection shows the template is in effect.

Verify the application recovers:
argocd app get podinfo-dev --hard-refresh | grep -E 'Sync Status|Health'
Sync Status:        Synced to main (3f2c1ab)
Health Status:      Healthy
Demonstrate that “a repository with its own credentials blocks the template”: configure a wrong password separately for a test repository; it will not fall back to the template:
argocd repo add https://github.com/<you>/gitops-lab-test --username git --password wrong 2>&1 | tail -1
FATA[0001] rpc error: code = Unknown desc = error testing repository connectivity: authentication required: Invalid username or token. Password authentication is not supported for Git operations.
Bring credentials into GitOps: the above creds-… Secret cannot be committed directly. Module 4 rewrites it as a SealedSecret (the template includes the secret-type label), and module 5 switches to generating it with ESO. Cleanup: after the lab ends, revoke this PAT on GitHub.

Case 1: an employee's departure causes a full sync failure

Problem: All repositories share one engineer's classic PAT; after he left, the account was disabled, and the next morning all Applications showed authentication required. Approach: switch to an organization-level GitHub App, with the credential template prefix https://github.com/acme, and install the App only on the GitOps repositories. Configuration: store the App private key in Azure Key Vault, with ESO generating the repo-creds Secret (module 5). Limitations: GitHub App installation tokens have API rate limits (calculated per installation); at very large scale, pay attention to using webhook-driven refresh instead of polling.

Case 2: project-level credentials isolating teams

Problem: The repositories of team-a and team-b are under the same organization, but security requirements mean team-b's applications must not be able to read team-a's private repositories. Approach: two repo-creds each carry project: team-a / project: team-b, using two GitHub Apps each installed only on its own repositories; the AppProject's sourceRepos also restricts the prefix. Limitations: Project-level credentials can be added self-service by users with project permissions. This also means you must restrict who can create / update repositories (see the SSH proxy command injection advisory GHSA-j6cw-g6p4-7hch, fixed in 3.3.15 / 3.4.10 / 3.5.4).

Case 3: internal GitLab using a self-signed certificate

Problem: To “get it running first”, every repository had --insecure-skip-server-verification added. Approach: import the enterprise root CA using argocd cert add-tls gitlab.corp.local --from ca.pem into argocd-tls-certs-cm, and remove the insecure flag. Limitations: If the certificate has expired or the hostname does not match, adding the CA does not help; the server certificate must be fixed.

Common errors and fixes

rpc error: code = Unknown desc = authentication required: Repository not found.

Cause: No matching credential; the template prefix does not match (for example, the template https://github.com/acme/ has a trailing slash, or uses different case); the repository Secret's own wrong credentials shadow the template; a credential has a project field, but the Application belongs to another project.

argocd repo get https://github.com/acme/payments.git -o yaml
argocd repocreds list
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=repository -o jsonpath='{range .items[*]}{.metadata.name}{"  "}{.data.url}{"\n"}{end}'

Fix: Have the repository Secret keep only url (and type), and provide credentials uniformly through the template; check the prefix and project fields.

ssh: handshake failed: knownhosts: key is unknown

Cause:argocd-ssh-known-hosts-cm does not contain this host (or the entry for a non-standard-port [host]:port entry).

kubectl -n argocd get cm argocd-ssh-known-hosts-cm -o jsonpath='{.data.ssh_known_hosts}' | grep -c github.com

Fix:ssh-keyscan -p 2222 git.corp.local | argocd cert add-ssh --batch, and verify the fingerprint. Do not bypass it with insecure.

x509: certificate signed by unknown authority

Cause: the HTTPS repository uses an enterprise CA or a self-signed certificate.

openssl s_client -connect gitlab.corp.local:443 -showcerts </dev/null 2>/dev/null | openssl x509 -noout -issuer -subject

Fix:argocd cert add-tls gitlab.corp.local --from corp-root-ca.pem (the ConfigMap key name must match the repository hostname).

failed to get git client for repo ...: Could not find installation ID / 401 A JSON web token could not be decoded

Cause: The GitHub App private key is malformed (extra spaces or newlines when pasted), the App ID is wrong, or the App is not installed on that organization / repository; a large server time skew can also make the JWT invalid.

Fix: re-download .pem, and use --github-app-private-key-path instead of pasting; confirm the installation scope under the organization's Installed GitHub Apps; check node time synchronization.

Command-line exercise
1. For https://github.com/acme all repositories under it, add a GitHub App credential template.
argocd repocreds add https://github.com/acme --github-app-id 123456 --github-app-private-key-path acme.pem
2. List the names and URLs of all credential template Secrets in the argocd namespace.
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=repo-creds \
  -o go-template='{{range .items}}{{.metadata.name}} {{.data.url | base64decode}}{{"\n"}}{{end}}'
Scenario analysis
The platform team has one https://github.com/acme GitHub App template. To access an external collaboration repository, one team used argocd repo add https://github.com/acme/payments.git --username x --password PAT to add a personal token of its own. What are the consequences?

That repository Secret carries its own credentials, so all use acme/payments.git 's Applications (including those of other teams) will switch to this member's personal PAT instead of the GitHub App; when his token expires or he leaves, these applications fail to sync, and the audit shows it as personal access. The correct approach: use a template with its own prefix, or project-level credentials, for the external repository (--project), and restrict the RBAC permissions that let ordinary users create repositories.

Verified teaching videos

No video specifically about Argo CD repository credential templates and GitHub App credentials, verifiable via YouTube oEmbed, was found. You can review TechWorld with Nana's Argo CD introductionthe “connecting a repository” section (verified).

Official documentation

Video storyboard script (about 80 seconds)

This courseware cannot directly generate a video or MP3; a storyboard and narration script are provided, which can be passed to a video tool to generate.

Shot 1 · 0–20s
Visual: three Secret cards in the argocd namespace, labeled repository, repo-creds, repo-creds.
Narration: Argo CD's repository credentials are labeled Secrets. repository refers to a specific repository; repo-creds is a template reused by prefix.
Shot 2 · 20–45s
Visual: one repoURL is compared in turn with three prefixes; the longest one lights up.
Narration: when the repository has no credentials of its own, the template is selected by longest prefix, regardless of definition order.
Shot 3 · 45–80s
Visual: a private-key icon signs a JWT, which is exchanged for a token marked one hour, and then the repository is cloned.
Narration: a GitHub App signs only locally with its private key; the Git server only sees an installation token that expires after one hour. This is the preferred choice for production.
or score ≥ 70% in the Quiz

Module 3 · Choosing a secrets approach: why plaintext must not go into Git

13:00 – 21:00 · The core question in choosing an approach is just one: where plaintext appears, and who holds the key that can decrypt it
8 minCore animationOfficial recommendation: decrypt on the target cluster★★★★★
Learning goals
  • Use experiments to prove that base64 is not encryption and that Git history cannot really be retracted, and state that the correct response when a secret has entered Git is rotation, not deleting the commit.
  • Classify common approaches into three modes: in-cluster decryption (Sealed Secrets),external reference (ESO, Secrets Store CSI Driver, Vault Secrets Operator),render-time decryption / injection (SOPS CMP, KSOPS, argocd-vault-plugin), and explain why the Argo CD official docs strongly recommend the first two.
  • Use the core animation to trace a secret's full path from Git to Pod, and point out which components the plaintext appears in for each approach.
Prerequisites: module 1's components and the Redis cache. Importance:★★★★★ (this is the decision basis for all later modules in this lesson)

What: the secrets problem in GitOps

GitOps requires that “the desired state of the cluster is all in Git”, but a Kubernetes Secret's data is only base64-encoded. Committing it as-is is the same as giving the password to everyone who can read the repository, every clone, every fork, CI caches and backups. Git is also content-addressed: even if a later commit deletes it, it still exists in old commits, the reflog, PR pages on the hosting platform, and other people's local clones.

Why: once leaked, the only reliable response is rotation

  • git filter-repo or BFG rewriting history can only clean up the copies you control, but cannot retract content that has been cloned, cached or scraped by scanners.
  • GitHub's secret scanning and push protection can block tokens of known formats, but cannot block custom passwords.
  • So the process is: rotate immediately (invalidate the old value) → assess impact → then clean up history, and the order must not be reversed.

How: three modes

ModeRepresentativeStored in GitWho decrypts / retrievesCan Argo CD see plaintext?
in-cluster decryptionSealed SecretsSealedSecret encrypted with the cluster public key (ciphertext)the sealed-secrets controller in the target cluster (private key only inside the cluster)No: Argo CD only deploys the ciphertext CR
external referenceExternal Secrets Operator, Secrets Store CSI Driver, Vault Secrets Operatora reference (“go to Key Vault and get the secret named db-password”)the Operator in the target cluster, accessing the external secret store using workload identityNo: Argo CD only deploys the reference
render-time decryption / injectionSOPS (CMP / KSOPS), argocd-vault-pluginSOPS-encrypted file / placeholdersargocd-repo-server (or its plugin sidecar) decrypts when generating the manifestsYes: plaintext appears in repo-server, the Redis cache, and the repo-server API

Conclusion of the Argo CD official docs “Secret Management”: strongly recommend populating secrets on the target cluster, because (1) Argo CD does not need to touch secrets, reducing leak risk; (2) secret updates are decoupled from application sync, so an unrelated release will not accidentally change secrets. For render-time injection approaches, the official docs “strongly caution” against them and note that they are incompatible with the “Rendered Manifests” pattern; if you still use them, at least isolate Redis and repo-server with NetworkPolicy, and consider putting Argo CD in a separate cluster.

When: how to choose

Your situationRecommendationReason
Already have a cloud secrets store (Azure Key Vault, AWS Secrets Manager, Vault)ESOthe single source of truth is in the secrets store; rotation, auditing and access control are handled by the secrets store; Git holds only references
No external secrets store, few clusters, and you want “secrets also in Git”Sealed Secretszero external dependencies, self-contained; the cost is backing up the controller private key, and multiple clusters must be encrypted separately
Multiple environments share the same encrypted file, and the team is already familiar with SOPS (e.g., Flux users)SOPS (a toolchain that prefers in-cluster decryption; accept its risk when using the Argo CD CMP)encryption granularity down to the value, diff-friendly; but in Argo CD, decryption happens in repo-server
Secret only needs to be mounted as a file, and you do not want a Kubernetes Secret object to appearSecrets Store CSI Driverfetch values at mount time; optionally sync to a Secret
Common misconceptions① “The repository is private, so a base64 Secret can be stored in it” — readers of a private repository are usually far more numerous than the people who should know production passwords, and it gets cloned onto every developer machine. ② “The Argo CD UI displays Secrets as ****, so render-time injection is safe” — masking only applies to API output; the Redis cache and repo-server memory hold plaintext; in 2026 there was also a vulnerability that bypassed masking to read Secrets (GHSA-3v3m-wc6v-x4x3, among others). ③ “With Sealed Secrets you no longer need to rotate passwords” — it only protects transport and storage; the encrypted value itself still needs periodic rotation.

Architecture diagram: where the “decryption point” is across the three modes

GitArgo CD (repo-server → Redis → controller)target clusterPod SealedSecretciphertext rendered as-isonly sees ciphertext 🔓 sealed-secrets controllerprivate key in kube-system Secret → Pod ExternalSecretreference (no value) rendered as-isonly sees the reference 🔓 ESO controllerfetches values using workload identity Key Vault / Secrets Manager Secret → Pod SOPS fileciphertext (per value) 🔓 repo-server CMPage private key is in Argo CDplaintext enters the Redis cache apply plaintext Secret directly Secret → Pod
Figure 3-1: red boxes are decryption points; the first two are in the target cluster, the third is inside Argo CD

Decision flow chart

Do you already have an external secrets store?KV / SM / Vault External SecretsGit holds only references Do you only need file mounts?Do not want a Secret object Secrets Store CSI Is the team already heavily usingSOPS? SOPS (acceptthe repo-server decryption risk) Sealed Secrets Yes No Yes No Yes No
Figure 3-2 Selection decision: prefer external references, then in-cluster decryption; decrypting at render time is a risk you accept deliberately

Core animation: the path of a secret from Git to Pod (comparing four methods)

Select a method, then click “Play” or “Next”. The yellow dot is the secret itself, and its label shows its current form: plaintext,ciphertext or reference. Each step highlights the component that actually performs the operation, and the log below shows the matching real commands / API calls. The “Where plaintext appears” panel on the right accumulates every place plaintext has appeared; when comparing the four methods, this column is the answer to choosing one.

Developer terminalkubeseal / sops External secret storeKey Vault / fake Gitgitops-lab Namespace argocd repo-server(+ CMP sidecar) Redis cache controllerdiff · apply kube-apiserver→ etcd In-cluster controller(depends on the approach) Podenv / volume —
Select a method to start.
Where plaintext appears
(none yet)
$ # Choose a method to start
Compare the four after viewing them all In the anti-pattern, plaintext appears in Git and all downstream systems. With Sealed Secrets and ESO, plaintext appears only in the “developer terminal or secret store” and in the target cluster (etcd, controller memory, Pod). With the SOPS CMP, plaintext also appears in repo-server, Redis and the controller, which is why the official docs “strongly warn” against it.

Core commands and parameters

CommandPurposeNotes
kubectl create secret generic … --dry-run=client -o yamlGenerate a Secret manifest without submitting it to the clusterThe data in the output is just base64
base64 -dRestore the Secret valueProves base64 is not encryption
git log -p -S 'czNjcjN0'Search the entire history for additions and removals of a string“Still there after deletion”
gitleaks gitScan repository history for secretsv8.30.1; --max-decode-depth Decodable base64
git filter-repo --replace-textRewrite history to remove a secretOnly after rotation; requires a force push, and everyone must re-clone
kubectl get secret -o json | jq '.data|map_values(@base64d)'View the plaintext value of a Secret in the clusterNote the permissions: get secrets Equivalent to being able to read the plaintext
kubectl create secret generic db --from-literal=password=s3cr3t-demo --dry-run=client -o yaml
echo 'czNjcjN0LWRlbW8=' | base64 -d; echo
apiVersion: v1
data:
  password: czNjcjN0LWRlbW8=
kind: Secret
metadata:
  creationTimestamp: null
  name: db
s3cr3t-demo

How to verify: Anyone can restore it with a single command. Common mistake: Thinking that stringData is safer than data ; the two are just different encodings. Production use: Add gitleaks to CI or enable GitHub push protection to block any kind: Secret from appearing in the GitOps repository (except Sealed / External).

Use AppProject to stop business teams from deploying Secrets directly (optional enforcement)

spec:
  namespaceResourceBlacklist:
  - group: ""
    kind: Secret            # team-a can only get a Secret indirectly, via SealedSecret / ExternalSecret

Note: when a deny list and an allow list both exist, both apply. If team-a uses the SOPS CMP (which renders a Secret), this rule will block it, which is also a governance approach that nudges teams toward the in-cluster decryption option.

Lab 3: reproduce a “base64 leak” yourself and scan with gitleaks (about 6 minutes)

Do it in a local temporary repository; do not push to GitHub. Use a fake value that “looks like” a GitHub token so the scanner will detect it.

Create the temporary repository and commit a Secret:
mkdir -p /tmp/leak-demo && cd /tmp/leak-demo && git init -q
FAKE=ghp_$(head -c 200 /dev/urandom | tr -dc 'A-Za-z0-9' | head -c 36)
kubectl create secret generic gh --from-literal=token=$FAKE --dry-run=client -o yaml > secret.yaml
git add secret.yaml && git commit -qm "add token (oops)"
git rm -q secret.yaml && git commit -qm "remove token"
ls; git log --oneline
e41b0c2 remove token
9a7d3f1 add token (oops)
Prove “still there after deletion”:
git show HEAD~1:secret.yaml | grep token: | awk '{print $2}' | base64 -d; echo
ghp_EXAMPLE_not_a_real_token_0000
Scan the full history with gitleaks (container method, no installation needed):
docker run --rm -v /tmp/leak-demo:/repo ghcr.io/gitleaks/gitleaks:v8.30.1 \
  git /repo --max-decode-depth 2 -v 2>&1 | grep -E 'RuleID|Commit|File|leaks found'
RuleID:      github-pat
Commit:      9a7d3f1...
File:        secret.yaml
WRN leaks found: 1

gitleaks can find secrets in deleted commits and decode base64 (--max-decode-depth). If your version does not support that flag, base64 forms may go undetected once it is removed. This shows that “encoding” only makes things harder for tools and people to spot; it is not protection.

Write out the order of response steps (fill-in exercise; the answer is in the scenario question of the quiz): ① ______ ② check access logs to assess impact ③ rewrite history and force push ④ add push protection / pre-commit scanning.
Cleanup:
rm -rf /tmp/leak-demo

Case 1: cloud access key in a public repository

Problem: A developer committed a Secret containing a base64 cloud access key to a public repository. Within minutes, automated scanners exploited it and generated large compute charges. Response: Immediately disable the key in the cloud console → audit API logs → switch to Workload Identity (no long-lived keys) + ESO. Configuration: Enable secret scanning push protection in the GitHub organization; run gitleaks in the CI of the GitOps repository. Limitation: Scanners only recognize known formats, so custom passwords still depend on process and toolchain (Sealed / ESO).

Case 2: migrating from argocd-vault-plugin to ESO

Problem: The team used AVP to substitute values from Vault into manifests at render time. Every password rotation required a hard refresh and sync in Argo CD, and one unrelated release accidentally pushed the new password to production. Response: Following the official recommendation, switched to ESO: store an ExternalSecret in Git, and ESO automatically updates the Secret according to refreshInterval decoupling the Secret update from application sync. Limitation: During migration, the two methods cannot manage the same Secret at once (they would overwrite each other), so switch application by application.

Case 3: “insider” risk in a private repository

Problem: A compliance audit found more than 30 base64 Secrets in a private GitOps repository. Read access covered 400 engineers and several CI systems. Response: Rotated and migrated in order of most sensitive first, to Sealed Secrets (short term) and ESO (long term). An AppProject deny list prevents business projects from deploying directly Secret. Limitation: Platform projects (for example, the project that deploys Argo CD itself argocd-secret) still need an exception process.

Common errors and fixes

GH013: Repository rule violations found ... Push cannot contain secrets

Cause: GitHub push protection found a token in a known format in the push.

Fix: Do not choose “allow secret” to bypass it; use git reset --soft to undo the local commit, then re-commit with SealedSecret / ExternalSecret. If the token has already been pushed to any remote, rotate it first.

The Argo CD UI shows ++++++++ across the Secret diff, so you cannot tell what changed

Cause: Argo CD masks Secret values (the same value shows the same number of +, different values show different lengths). This is by design.

kubectl -n secrets-demo get secret db -o jsonpath='{.metadata.resourceVersion} {.metadata.managedFields[*].manager}'; echo

Fix: Judge from changes to the SealedSecret / ExternalSecret object (changes in ciphertext or the referenced diff). Do not turn off masking to debug.

After sync, the app still uses the old password (the Secret has been updated)

Cause: Secrets injected as environment variables are not hot-reloaded. Volume mounts update after the kubelet sync period, but subPath mounts never update.

Fix: Restart the workload (kubectl rollout restart), or use a controller such as Reloader. For ESO setups, you can add a checksum annotation to the template to trigger a rolling update (Module 5 production case).

Command-line exercises
1. Search the whole repository history for commits in which kind: Secret appeared.
git log --all --oneline -S 'kind: Secret'
2. Write a single command that lists all plaintext values of a given Secret in the cluster (requires jq).
kubectl -n secrets-demo get secret db -o json | jq '.data | map_values(@base64d)'
Scenario analysis
At 2 a.m. you discover that a production database password was pushed 30 minutes ago, in base64 Secret form, to the organization’s private GitOps repository. Write the response steps in order.

① Rotate immediately the database password (create new credentials in the database and invalidate the old value), send the new value to the cluster through the proper channel (ESO / SealedSecret) and restart the application; ② check database and repository access logs to assess who may have read the old value within those 30 minutes; ③ rewrite history (git filter-repo), force-push and notify everyone to re-clone, and clear CI caches and forks; ④ add push protection / gitleaks, and use an AppProject deny list to block business projects from deploying Secrets directly. The key to the order is rotation first, because rewriting history cannot guarantee that copies are removed.

Verified teaching videos

▶
Bitnami Sealed Secrets - How To Store Kubernetes Secrets In Git Repositories — DevOps & AI Toolkit
English · Viktor Farcic explains why Secrets cannot go directly into Git, and the idea behind Sealed Secrets (recorded earlier; this lesson is authoritative for the version)
▶
Manage Kubernetes Secrets With External Secrets Operator (ESO) — DevOps & AI Toolkit
English · a representative solution for the external reference pattern; the API version shown in the video may be older than the external-secrets.io/v1

official documentation

Video storyboard script (about 100 seconds)

This courseware cannot directly generate video or MP3, so storyboards and narration scripts are provided for use with a video tool.

Shot 1 · 0–20s
Visual: a Secret YAML; one command restores the base64 string to plaintext.
Narration: base64 is just encoding. Putting a Secret in Git means giving the password to everyone who can read the repository.
Shot 2 · 20–45s
Visual: a commit history diagram; after the deleting commit, the old commit still glows and is copied to several computers.
Narration: deleting a commit cannot retrieve copies that have already been cloned. Once a secret enters Git, the correct response is to rotate it immediately.
Shot 3 · 45–80s
Visual: three parallel tracks; red locks appear in the cluster controller, in the Operator next to the external secret store, and in Argo CD’s repo-server.
Narration: the three modes differ in where decryption happens: in-cluster decryption, external reference, and render-time decryption. The first two mean Argo CD never sees plaintext.
Shot 4 · 80–100s
Visual: a decision tree that ends at ESO and Sealed Secrets.
Narration: if you have an external secret store, use External Secrets; if not, use Sealed Secrets. Decrypting at render time is a risk you accept deliberately.
or score ≥ 70% on the quiz

Module 4 · Sealed Secrets

21:00 – 28:00 · Anyone can “seal” with the public key; only the controller in the cluster can “open” it. Ciphertext can safely go into Git.
7 minutescontroller v0.41.2 · chart 2.22.0The private key must be backed up★★★★☆
Learning objectives
  • Explain the encryption process: random 32-byte session key → AES-256-GCM encrypted value → RSA-OAEP (SHA-256) Encrypt the session key with the controller’s public key; in the strict scope, bind “namespace/name” into the ciphertext as the OAEP label.
  • Choose the correct scope (strict / namespace-wide / cluster-wide), and explain “no key could decrypt secret” after a rename.
  • Understand the difference between 30-day automatic renewal (which appends a new key and keeps old ones) and “rotating the secret value”, and complete private key backup, restore and --re-encrypt.
  • Deploy the controller with Argo CD (platform project) and the SealedSecret (team-a project), and use the built-in health check to observe the decryption result.
Prerequisites: The three modes from Module 3. Importance:★★★★☆

What: what a SealedSecret is

Sealed Secrets consists of two parts: the controller (by default in kube-system) and the client kubeseal. At startup the controller generates (or loads) a 4096-bit RSA key pair, and the private key is saved in a regular Secret labeled sealedsecrets.bitnami.com/sealed-secrets-key ; the public key is provided as an X.509 certificate through the controller’s HTTP endpoint (kubeseal --fetch-cert). kubeseal uses the public key to encrypt a regular Secret into a SealedSecret custom resource. The controller watches for it, decrypts it, and creates a Secret of the same name. The Secret’s ownerReference points to the SealedSecret.

Why: when to use it

  • No external secret store, but you still want secrets to follow GitOps (review, history, rollback).
  • Zero external dependencies: the controller works offline and calls no cloud APIs.
  • Sealing needs only the public key, so developers can “seal” without any cluster permissions (the certificate can be committed to the repository for offline use).

How: encryption and scope

  1. kubeseal generates a random one-time session key for each value and encrypts the value with AES-256-GCM (a one-time key, so no nonce is needed).
  2. Encrypt the session key with the cluster public key using RSA-OAEP (SHA-256); the OAEP label parameter is determined by scope: strict is namespace/name, namespace-wide is namespace, cluster-wide is empty.
  3. Output spec.encryptedData.<key> (base64 ciphertext) and spec.template (metadata of the generated Secret, such as labels and type).
  4. The controller tries all active private keys in turn. When the label does not match (renamed or namespace changed), the OAEP check fails → no key could decrypt secret.
Scopekubeseal flag / annotationCan rename?Can change namespace?Applies to
strict (default)NoneNoNoMost cases; prevents someone from copying your ciphertext into their own namespace to decrypt it
namespace-wide--scope namespace-wide / sealedsecrets.bitnami.com/namespace-wide: "true"YesNoReuse within the same namespace
cluster-wide--scope cluster-wide / sealedsecrets.bitnami.com/cluster-wide: "true"YesYesUse with caution: anyone who can create a SealedSecret in the cluster can decrypt it in their own namespace

Key renewal ≠ secret rotation

  • By default the controller every 30 days generates a new key pair and appends it to the active key set (--key-renew-period,0 means disabled). New encryption uses the latest key, and old keys continue to decrypt old ciphertext, so renewal does not break existing SealedSecrets.
  • Renewal only limits what a future leaked private key can decrypt. Old ciphertext already committed to Git can still be decrypted if an old private key leaks. The real remedy is rotating the secret value itself.
  • To generate a new key immediately, use --key-cutoff-time (RFC1123, such as date -R) or the environment variable SEALED_SECRETS_KEY_CUTOFF_TIME.
  • kubeseal --re-encrypt Re-encrypt existing SealedSecrets with the latest key (done online by the controller). The result must be committed back to Git.

Private key backup (key to disaster recovery)

If the cluster is deleted and the private key was not backed up, all SealedSecrets in Git can no longer be decrypted, and all secrets must be regenerated. Backup command: kubectl get secret -n kube-system -l sealedsecrets.bitnami.com/sealed-secrets-key -o yaml > main.key; back up again after every renewal. To restore: in the new cluster, apply the backup first, then (re)start the controller. The backup file is itself the root key and must be kept in a secret store or offline storage,never in Git.

When: comparison with other approaches

Sealed SecretsESOSOPS + Argo CD CMP
Source of truth for valuesCiphertext in GitExternal secret storeCiphertext in Git
Multi-clusterOne key pair per cluster, each encrypted separately (or sharing the private key, which reduces isolation)One Store per cluster, referencing the sameThe same file can serve multiple clusters (sharing the age private key)
Reviewing diffsThe whole ciphertext changes, so you cannot see what changedReferences rarely changeKey names visible, values encrypted, diff-friendly
Rotation processRe-run kubeseal and commitEdit in the secret store; syncs automaticallyEdit with sops and commit
Common misconceptions① “A SealedSecret’s value can be changed with kubectl edit”: the value is ciphertext, so you must re-run kubeseal (or use --merge-into to merge a single key). ② “Backing up the SealedSecret resource is enough”: without the controller’s private key, these ciphertexts are useless. ③ “After a Helm install, kubeseal works directly”: the chart’s default service name is sealed-secrets, while kubeseal looks for kube-system/sealed-secrets-controller by default; set fullnameOverride=sealed-secrets-controller, or pass it each time with --controller-name.

Architecture diagram: public-key sealing, private-key unsealing inside the cluster

Developersecret.yaml (plaintext, not committed)kubeseal --cert pub.pem→ sealed.yaml (ciphertext) GitSealedSecret+ pub-cert.pem Argo CDSync SealedSecret(sees only ciphertext) Target cluster sealed-secrets-controller (kube-system)watches SealedSecret → decrypts with the active private keyGET /v1/cert.pem serves the public key Secret (private keys ×N)label: sealed-secrets-key=active Secret dbownerRef → SealedSecret Pod mounts kubeseal --fetch-cert (fetches only the public key)
Figure 4-1: the public key can be made public (even committed to Git for offline encryption); the private key never leaves the target cluster

Timeline: 30-day renewal and backup

Day 0key-1 generatedBackup #1 Day 30key-2 appendedNew ciphertext uses key-2 Day 60key-3 appended⚠ Backup #1 cannot decrypt new ciphertext At any time--re-encryptOld ciphertext → latest key All old private keys are still kept and can decrypt. After renewal you must back up again, otherwise new ciphertext cannot be decrypted during disaster recovery
Figure 4-2: key renewal is “append”, not “replace”; it is not the same as rotating the secret value

Interactive simulator: kubeseal encryption and scope validation

Choose a scope and enter a value, then click “Play” to watch kubeseal’s real encryption steps. Then change the name or namespace under “Deploy to” to see whether the controller can decrypt it. The session key and ciphertext are demo random bytes (generated in the browser); the algorithm flow matches the Sealed Secrets documentation.

Secret at encryption time: namespace secrets-demo, name db
Value (password):
Scope:
Deploy to (simulating rename / copy to another namespace):
Namespace
Name
Ready.
$ kubeseal --fetch-cert > pub-cert.pem

Core commands and parameters

CommandPurposeKey parameters
kubeseal --fetch-certGet the current public key certificate--controller-name --controller-namespace
kubeseal --format yaml < s.yaml > ss.yamlEncrypt a Secret manifest--cert pub.pem (offline),--scope
kubeseal --rawEncrypt only one value (for hand-editing / merging)--namespace --name (required with strict)
kubeseal --merge-into ss.yamlAdd or change keys in an existing SealedSecretRead the new Secret from stdin
kubeseal --validateHave the controller verify it can decrypt (does not create a Secret)Feed a SealedSecret via stdin
kubeseal --re-encryptRe-encrypt with the latest keyThe result must be committed to Git
kubeseal --recovery-unseal --recovery-private-key k1,k2Decrypt offline with the backup private key (disaster recovery)Use only in emergencies
kubectl create secret generic db -n secrets-demo \
  --from-literal=username=app --from-literal=password=s3cr3t-demo \
  --dry-run=client -o yaml | kubeseal --format yaml > apps/secrets-demo/sealed/db-sealed.yaml
cat apps/secrets-demo/sealed/db-sealed.yaml
---
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  creationTimestamp: null
  name: db
  namespace: secrets-demo
spec:
  encryptedData:
    password: AgBy3i4OJSWK+PiTySYZZA9rO43cGDEq...
    username: AgCtr8PfvWQx0ZHq3b1lNw2k9AVo9Cc...
  template:
    metadata:
      creationTimestamp: null
      name: db
      namespace: secrets-demo

How to verify:kubeseal --validate < db-sealed.yaml No output means success. Common mistake: If the input Secret does not specify a namespace and the current context namespace differs, the strict scope binds to the wrong namespace. Production use: Commit pub-cert.pem to the repository (it is the public key), so developers can seal offline kubeseal --cert pub-cert.pem, with no cluster access needed.

Make Argo CD repository credentials a SealedSecret (keeping the secret-type label)

kubectl create secret generic creds-github-you -n argocd \
  --from-literal=type=git --from-literal=url=https://github.com/<you> \
  --from-literal=username=git --from-literal=password="$GH_PAT" --dry-run=client -o yaml \
| kubectl label --local -f - argocd.argoproj.io/secret-type=repo-creds -o yaml \
| kubeseal --format yaml > platform/sealed-secrets/creds-github-you.yaml
grep -A3 'template:' -A6 platform/sealed-secrets/creds-github-you.yaml | grep secret-type
          argocd.argoproj.io/secret-type: repo-creds

The Argo CD docs note that when using Sealed Secrets, the label may need to be re-added in spec.template.metadata.labels . After generating, be sure to check template whether it carries secret-type label; if not, add it manually. Otherwise Argo CD will not recognize the generated Secret as credentials.

Back up and restore the private key

# Back up (redo after each renewal; save to a secret store or offline media, not Git)
kubectl get secret -n kube-system -l sealedsecrets.bitnami.com/sealed-secrets-key -o yaml > sealed-secrets-keys-$(date +%F).yaml
# Restore: in the new cluster, apply the backup first, then restart the controller
kubectl apply -f sealed-secrets-keys-2026-11-17.yaml
kubectl -n kube-system delete pod -l app.kubernetes.io/name=sealed-secrets

Lab 4: Deploy Sealed Secrets with Argo CD and unseal a secret (about 8 minutes)

Deploy the controller with an Application (platform project, Helm chart 2.22.0; the name matches the kubeseal default):
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: sealed-secrets
  namespace: argocd
spec:
  project: platform
  source:
    repoURL: https://bitnami.github.io/sealed-secrets
    chart: sealed-secrets
    targetRevision: 2.22.0
    helm:
      valuesObject:
        fullnameOverride: sealed-secrets-controller
  destination:
    server: https://kubernetes.default.svc
    namespace: kube-system
  syncPolicy:
    automated: { prune: true, selfHeal: true }
kubectl apply -f argocd/apps/sealed-secrets.yaml
argocd app wait sealed-secrets --health --timeout 180
kubectl -n kube-system get deploy sealed-secrets-controller
kubectl -n kube-system get secret -l sealedsecrets.bitnami.com/sealed-secrets-key
NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
sealed-secrets-controller   1/1     1            1           40s
NAME                      TYPE                DATA   AGE
sealed-secrets-keyx7k2p   kubernetes.io/tls   2      38s
Get the public key and encrypt offline:
cd ~/gitops-lab
kubeseal --fetch-cert > platform/sealed-secrets/pub-cert.pem
openssl x509 -in platform/sealed-secrets/pub-cert.pem -noout -subject -enddate
kubectl create secret generic db -n secrets-demo --from-literal=username=app --from-literal=password=s3cr3t-demo \
  --dry-run=client -o yaml | kubeseal --cert platform/sealed-secrets/pub-cert.pem --format yaml > apps/secrets-demo/sealed/db-sealed.yaml
subject=O = sealed-secret, CN = sealed-secret
notAfter=Nov 15 02:10:33 2036 GMT

The certificate is valid for 10 years, but a new certificate appears every 30 days. Re-fetch it periodically before offline encryption to make sure you use the latest key.

Add a workload that uses the secret and commit it:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sealed-demo
  namespace: secrets-demo
spec:
  replicas: 1
  selector: { matchLabels: { app: sealed-demo } }
  template:
    metadata: { labels: { app: sealed-demo } }
    spec:
      containers:
      - name: podinfod
        image: ghcr.io/stefanprodan/podinfo:6.17.0
        ports: [{ containerPort: 9898 }]
        env:
        - name: DB_PASSWORD
          valueFrom: { secretKeyRef: { name: db, key: password } }
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: secrets-sealed
  namespace: argocd
spec:
  project: team-a
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/secrets-demo/sealed
  destination:
    server: https://kubernetes.default.svc
    namespace: secrets-demo
  syncPolicy:
    automated: { prune: true, selfHeal: true }
git add platform/sealed-secrets apps/secrets-demo/sealed argocd/apps/*sealed*.yaml
git commit -m "sealed-secrets: controller + db SealedSecret" && git push
kubectl apply -f argocd/apps/secrets-sealed.yaml
argocd app wait secrets-sealed --health --timeout 120
argocd app resources secrets-sealed
kubectl -n secrets-demo get secret db -o jsonpath='{.data.password}' | base64 -d; echo
GROUP       KIND          NAMESPACE     NAME         ORPHANED
            Secret        secrets-demo  db           No
bitnami.com SealedSecret  secrets-demo  db           No
apps        Deployment    secrets-demo  sealed-demo  No
s3cr3t-demo

Secret db It is not in Git, but because its ownerReference points to the SealedSecret managed by Argo CD, Argo CD’s resource tree shows it as a child resource,does not treat it as an extra resource to prune.

Verify the strict scope: change the name: db to db2 (in two places), commit, and observe:
argocd app get secrets-sealed | grep -i sealedsecret
kubectl -n secrets-demo get sealedsecret db2 -o jsonpath='{.status.conditions[0].message}'; echo
bitnami.com  SealedSecret  secrets-demo  db2  Synced  Degraded  no key could decrypt secret (password, username)
no key could decrypt secret (password, username)

The Argo CD built-in SealedSecret health check reads the Synced conditions written by the controller, and shows Degraded on failure. Use git revert to restore.

Back up the private key and demonstrate re-encryption:
kubectl get secret -n kube-system -l sealedsecrets.bitnami.com/sealed-secrets-key -o yaml > ~/sealed-keys-backup.yaml
chmod 600 ~/sealed-keys-backup.yaml
kubeseal --re-encrypt < apps/secrets-demo/sealed/db-sealed.yaml > /tmp/re.yaml && diff -q apps/secrets-demo/sealed/db-sealed.yaml /tmp/re.yaml
Files apps/secrets-demo/sealed/db-sealed.yaml and /tmp/re.yaml differ

The ciphertext is different every time (random session key), even if the value does not change. Cleanup (at the end of the course): delete ~/sealed-keys-backup.yaml; keep the controller, because the capstone lab uses it.

Case 1: all secrets fail after a cluster rebuild

Problem: During a disaster recovery drill, the AKS cluster was rebuilt and Argo CD resynced. All SealedSecrets became Degraded because the new controller generated new keys. Response: During bootstrap, before deploying the controller first, restore the private key Secret from Key Vault. After each monthly renewal, a CronJob backs up the private key to Key Vault (using Workload Identity). Limitation: The backup job itself needs permission to read kube-system Secrets, so it must be strictly restricted and audited.

Case 2: shared ciphertext across clusters, or separate encryption

Problem: Three clusters (dev / staging / prod); developers complained that each value had to be encrypted three times. Response: prod uses an independent key (isolated from non-production); dev and staging share one imported key pair; directories are split by environment overlays/<env>/sealed/, and CI uses each environment’s pub-cert.pem is generated automatically. Limitation: A shared private key means that compromising one cluster lets someone decrypt the other cluster’s ciphertext. The long-term approach is migrating to ESO.

Case 3: suspected private key leak

Problem: A misconfigured backup bucket exposed the private key backup file. Response:① Rotate all affected secret values (database passwords, API tokens). ② Use --key-cutoff-time to immediately generate a new key. ③ Re-run kubeseal with the new values and commit. ④ Mark the leaked old key as compromised and remove it from the cluster (after confirming all ciphertext has been re-encrypted). Limitation: Old ciphertext in the Git history can still be decrypted with the leaked private key, so step ① cannot be skipped.

Common errors and fixes

no key could decrypt secret (password)

Cause: Under the strict / namespace-wide scope, the name or namespace was changed; or the ciphertext was encrypted with the public key of another cluster (or of a deleted old controller).

kubeseal --validate < db-sealed.yaml
kubectl -n kube-system logs deploy/sealed-secrets-controller | grep -i 'decrypt' | tail -3
kubectl -n kube-system get secret -l sealedsecrets.bitnami.com/sealed-secrets-key

Fix: Re-encrypt with the current cluster’s certificate using the correct name / namespace. If the cluster was rebuilt, restore the private key backup.

error: cannot fetch certificate: services "sealed-secrets-controller" not found

Cause: Helm was installed without setting fullnameOverride, and the service name is sealed-secrets; or it was installed in another namespace.

kubectl get svc -A | grep sealed

Fix:kubeseal --controller-name sealed-secrets --controller-namespace kube-system --fetch-cert, or set fullnameOverride: sealed-secrets-controller in the chart values.

Resource "db" already exists and is not managed by SealedSecret

Cause: A Secret with the same name was already created manually in the namespace, and the controller does not overwrite it by default.

kubectl -n secrets-demo get secret db -o jsonpath='{.metadata.ownerReferences}'; echo

Fix: After confirming you want to take it over, add the annotation to the existing Secret sealedsecrets.bitnami.com/managed: "true", and the controller will overwrite and take it over.

SealedSecret stays Progressing in Argo CD: Waiting for Sealed Secret to be decrypted

Cause: The controller is not running, or status.observedGeneration has not caught up yet metadata.generation (the controller has not processed the latest version).

kubectl -n kube-system get pod -l app.kubernetes.io/name=sealed-secrets
kubectl -n secrets-demo get sealedsecret db -o jsonpath='{.metadata.generation} {.status.observedGeneration}'; echo

Fix: Fix the controller (image pull, RBAC), or confirm that the namespaces the controller watches include this namespace.

Command-line exercises
1. Encrypt only one value abc123, for namespace secrets-demo named api SealedSecret (strict).
echo -n abc123 | kubeseal --raw --namespace secrets-demo --name api
2. To an existing db-sealed.yaml add one key host.
kubectl create secret generic db -n secrets-demo --from-literal=host=pg.internal --dry-run=client -o json \
  | kubeseal --merge-into apps/secrets-demo/sealed/db-sealed.yaml
Scenario analysis
The team wants to use the same SealedSecret in podinfo-dev and podinfo-staging two namespaces, so it used cluster-wide scope. What is the risk? What are the alternatives?

A cluster-wide ciphertext can be decrypted in any namespace under any name. Anyone who can create a SealedSecret in the cluster (for example team-b through its own Application) can copy this ciphertext into their own namespace and read the plaintext. Alternatives: seal separately for each namespace with the strict scope (automated in CI); or switch to ESO, where the ExternalSecrets on both sides reference the same external secret, and a ClusterSecretStore controls who can access it.

Verified teaching videos

▶
Bitnami Sealed Secrets - How To Store Kubernetes Secrets In Git Repositories — DevOps & AI Toolkit
English · full demonstration of installation, kubeseal, scopes and key renewal (recorded earlier; this lesson uses v0.41.2 and chart 2.22.0)

Official documentation

Video storyboard script (about 90 seconds)

This courseware cannot directly generate video or MP3, so storyboards and narration scripts are provided for use with a video tool.

Shot 1 · 0–20s
Visual: an open lock (the public key) flies from the cluster to the developer’s computer, and the developer seals a Secret into an envelope.
Narration: kubeseal encrypts with the cluster’s public key. Anyone can seal, but only the controller in the cluster can open.
Shot 2 · 20–45s
Visual: the envelope is labeled “secrets-demo/db”; someone renames it to db2, the controller cannot open it, and it shows no key could decrypt secret.
Narration: the default strict scope binds the namespace and name into the ciphertext, so renaming or changing the namespace makes decryption fail.
Shot 3 · 45–70s
Visual: on the timeline, one more key is added every 30 days, and the old keys stay on the key ring.
Narration: the controller appends a new key every thirty days, and old keys keep decrypting old ciphertext. Be sure to back up again after every renewal.
Shot 4 · 70–90s
Visual: the cluster explodes and is rebuilt; the key ring without a backup disappears, and all envelopes in Git turn gray.
Narration: without a private key backup, the ciphertext in Git is useless. Backups must go into a secret store, never into Git.
or score ≥ 70% on the quiz

Module 5 · External Secrets Operator

28:00 – 35:00 · Git contains only “where to fetch and which one”; the values stay in the secret store, and an in-cluster Operator periodically pulls them and generates the Secret
7 minutesESO v2.15.0 · external-secrets.io/v1Zero cost: fake + kubernetes provider★★★★★
Learning objectives
  • Distinguish SecretStore (namespace-scoped),ClusterSecretStore (cluster-scoped, which can be limited with conditions to limit namespaces) and ExternalSecret (which values to fetch and what Secret to generate).
  • Master refreshInterval,target.creationPolicy / deletionPolicy,dataFrom.extract,target.template, and the behavior when the external secret store is unavailable (keeping the last successful Secret).
  • Complete synchronization in a zero-cost environment with the fake and kubernetes providers, and write ClusterSecretStores for Azure Key Vault (Workload Identity) and AWS Secrets Manager (IRSA / Pod Identity).
  • Design the multi-tenant boundary where “the platform provides Stores and teams only write ExternalSecrets”, and handle common ESO and Argo CD diff issues.
Prerequisites: Module 3; Workload Identity from the AKS course (optional). Importance:★★★★★ (the preferred production approach)

What: three core CRDs

ResourceScopeContentsUsually maintained by
SecretStoreNamespaceHow to connect to a secret backend: provider type, address, authentication method (references a ServiceAccount / Secret in that namespace)Teams (small scale)
ClusterSecretStoreClusterSame as above; can be referenced by all (or spec.conditions selected) namespacesPlatform team
ExternalSecretNamespaceWhich Store to reference, which keys to fetch (data / dataFrom), refresh interval, generated Secret name and templateApplication teams (in Git)
ClusterExternalSecret / PushSecret / generators—Create ExternalSecrets in bulk for multiple namespaces; push cluster Secrets back to the secret store; generate passwords, ECR tokens, and so onOn demand

ESO has provided a stable external-secrets.io/v1 API since v0.16; v1.0 was released in 2025-11 and v2.0 in 2026-02 (removing the unmaintained Alibaba and Device42 providers). This lesson’s baseline is v2.15.0 (2026-11-10).

Why: why it is the preferred production choice

  • Single source of truth In the secret store: rotation, versions, access control and audit logs are handled by Key Vault / Secrets Manager.
  • Argo CD never sees the values: Git, repo-server and Redis contain only references.
  • Decoupled from releases: when a value in the secret store changes, ESO updates the Secret at the next refreshInterval refresh cycle. No Git commit is needed, and it is not carried along by unrelated syncs.
  • No long-lived keys: on AKS / EKS, with Workload Identity / IRSA, ESO stores no cloud credentials.

How: one reconciliation

  1. The ESO controller watches an ExternalSecret (or its refresh interval expires).
  2. Resolve secretStoreRef: reads the Store’s provider configuration and checks whether the ClusterSecretStore’s conditions allows that namespace.
  3. Obtains credentials according to the Store’s authentication method: for example, requests a token (TokenRequest) for the referenced ServiceAccount and exchanges it with Entra ID / AWS STS for an access token.
  4. Calls the provider API to read each remoteRef (which can specify version,property).
  5. Apply target.template (which can combine multiple values and generate connection strings), creating or updating the target Secret; creationPolicy: Owner (default), the Secret’s ownerReference points to the ExternalSecret.
  6. Update status: conditions Ready (reason SecretSynced or SecretSyncedError),refreshTime,syncedResourceVersion.
  7. When the backend fails,does not delete the existing Secret. It only sets the condition to False and retries, so applications keep using the last successful value.
FieldValueDescription
refreshInterval1h (default) / 00 means sync only once, at creation or when the spec changes; a value that is too short triggers cloud API throttling and costs
refreshPolicyPeriodic / OnChange / CreatedOnceNewer versions provide this, giving more explicit control over refresh timing
target.creationPolicyOwner / Orphan / Merge / NoneMerge is used to merge keys into an existing Secret
target.deletionPolicyRetain / Delete / MergeHow to handle the target Secret when the secret is deleted in the backend
dataFrom.extractKey nameExpands all fields of a JSON secret into multiple keys

When: choosing a provider

ScenarioproviderAuthentication
AKSazurekvauthType: WorkloadIdentity + ServiceAccount (federated credential)
EKSaws (service: SecretsManager or ParameterStore)IRSA (auth.jwt.serviceAccountRef) or EKS Pod Identity
Multi-cloud / on-premisesvaultKubernetes auth
Testing, zero-cost labsfake,kubernetesstatic values / a Secret in another namespace
Common misconceptions① “After using ESO, there are no Secrets in Kubernetes”: ESO generates ordinary Secrets, which still need etcd encryption at rest and RBAC protection (if you don’t want Secret objects, use the Secrets Store CSI Driver). ② “After changing the value in Key Vault, Pods take effect immediately”: you must wait for refreshInterval, and the environment-variable approach also requires restarting the Pod. ③ “Letting teams write their own SecretStores is more flexible”: the identity referenced by a SecretStore determines which secrets can be read, so handing Stores to teams lets them pick their own identity. Multi-tenant setups should have the platform provide ClusterSecretStores, restrict namespaces with conditions , and enforce prefix-based authorization on the secret store side.

Architecture diagram: Argo CD, ESO and the secret store

Git (gitops-lab)platform/: ClusterSecretStoreapps/: ExternalSecretReferences only, no values Argo CDsync CR Target cluster ClusterSecretStoreazurekv · WI ExternalSecretrefreshInterval 1h ESO controller (external-secrets)watch → authenticate → GetSecret → write Secret Secret dbownerRef → ES Pod Entra ID / STSSA token → access token Key Vault /Secrets Managervalue + version + audit
Figure 5-1: Argo CD syncs only two kinds of CRs, Store and ExternalSecret; fetching values and generating Secrets are both done by ESO inside the cluster

State diagram: behavior when the backend is available / unavailable

Ready=TrueSecretSynced Ready=FalseSecretSyncedError (keeps the old Secret) Secret updatedvalue changed → new resourceVersion backend timeout / 403 next refresh after recovery refreshInterval expires and value changed write succeeds
Figure 5-2: a backend failure does not delete the existing Secret; the Argo CD health check shows the ExternalSecret as Degraded

Interactive simulator: the ESO reconciliation loop

This is a ClusterSecretStore using the fake provider. You can modify the “value in the secret store”, make the backend “disconnect”, and adjust refreshInterval, then advance the clock. Observe when ESO calls the provider, when it writes the Secret, and when (and whether) the environment variables in the Pod change.

External secret store (fake)
/team-a/db/password =
ExternalSecret
refreshInterval:
Ready: —
Cluster
Secret db: (does not exist)
Pod env DB_PASSWORD: (not started)
Clock t=0. The ExternalSecret was just created by Argo CD.
$ argocd app sync secrets-eso

Core commands and parameters

CommandPurposeNotes
kubectl get clustersecretstore,secretstore -AView Stores and readiness statusSTATUS Valid / InvalidProviderConfig
kubectl get externalsecret -A (short form es)View sync statusSTATUS SecretSynced, READY
kubectl describe es NAMEView events and errorsThe raw error text returned by the provider
kubectl annotate es NAME force-sync=$(date +%s) --overwriteTrigger a sync immediatelyArgo CD also has a built-in refresh resource action
kubectl explain externalsecret.spec.targetView fieldscreationPolicy, deletionPolicy, template

Azure Key Vault (AKS + Workload Identity, production approach)

apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
  name: azure-kv-team-a
spec:
  conditions:
  - namespaces: ["secrets-demo", "podinfo-prod"]      # only these namespaces can reference it
  provider:
    azurekv:
      authType: WorkloadIdentity
      vaultUrl: "https://kv-team-a-prod.vault.azure.net"
      serviceAccountRef:
        name: external-secrets-team-a                 # with the azure.workload.identity/client-id annotation
        namespace: external-secrets

One Key Vault per team (or authorize by secret name prefix with RBAC). The managed identity is granted only “Key Vault Secrets User” on that Vault. The subject of the federated credential is system:serviceaccount:external-secrets:external-secrets-team-a (see the Workload Identity section of the AKS course).

AWS Secrets Manager (EKS + IRSA)

apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
  name: aws-sm-team-a
spec:
  provider:
    aws:
      service: SecretsManager
      region: eu-west-1
      auth:
        jwt:
          serviceAccountRef:
            name: external-secrets-team-a             # eks.amazonaws.com/role-arn annotation
            namespace: external-secrets

The IAM policy allows only secretsmanager:GetSecretValue / DescribeSecret on arn:aws:secretsmanager:eu-west-1:<acct>:secret:team-a/*. Secrets Manager bills per secret and per API call, so refreshInterval do not set it too short.

Team-written ExternalSecret (provider-independent)

apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: db
  namespace: secrets-demo
spec:
  refreshInterval: 1h
  secretStoreRef:
    kind: ClusterSecretStore
    name: azure-kv-team-a           # swap in fake / k8s-source in the lab
  target:
    name: db
    creationPolicy: Owner
    template:
      type: Opaque
      data:
        DATABASE_URL: "postgres://{{ .username }}:{{ .password }}@pg.internal:5432/app"
        password: "{{ .password }}"
  data:
  - secretKey: username
    remoteRef: { key: team-a-db-username }
  - secretKey: password
    remoteRef: { key: team-a-db-password }

Lab 5: zero-cost secret sync with the fake and kubernetes providers (about 8 minutes)

Deploy ESO with Argo CD (platform project, chart 2.15.0. The CRDs are installed by the chart and are large, so use ServerSideApply to avoid oversized annotations):
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: external-secrets
  namespace: argocd
spec:
  project: platform
  source:
    repoURL: https://charts.external-secrets.io
    chart: external-secrets
    targetRevision: 2.15.0
  destination:
    server: https://kubernetes.default.svc
    namespace: external-secrets
  syncPolicy:
    automated: { prune: true, selfHeal: true }
    syncOptions: ["CreateNamespace=true", "ServerSideApply=true"]
kubectl apply -f argocd/apps/external-secrets.yaml
argocd app wait external-secrets --health --timeout 300
kubectl get crd | grep external-secrets.io | head -4
kubectl -n external-secrets get deploy
clusterexternalsecrets.external-secrets.io   2026-11-17T03:10:11Z
clustersecretstores.external-secrets.io      2026-11-17T03:10:11Z
externalsecrets.external-secrets.io          2026-11-17T03:10:11Z
...
NAME                                       READY   UP-TO-DATE   AVAILABLE
external-secrets                           1/1     1            1
external-secrets-cert-controller           1/1     1            1
external-secrets-webhook                   1/1     1            1
fake provider: the platform provides one ClusterSecretStore (equivalent to a “secret store”), and teams write ExternalSecrets:
apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
  name: fake
spec:
  conditions:
  - namespaces: ["secrets-demo"]
  provider:
    fake:
      data:
      - key: "/team-a/db/password"
        value: "s3cr3t-v1"
        version: "v1"
      - key: "/team-a/db/config"
        value: '{"host": "pg.internal", "port": "5432"}'
        version: "v1"
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
  name: db-fake
  namespace: secrets-demo
spec:
  refreshInterval: 1m
  secretStoreRef: { kind: ClusterSecretStore, name: fake }
  target: { name: db-fake }
  data:
  - secretKey: password
    remoteRef: { key: /team-a/db/password, version: v1 }
  dataFrom:
  - extract: { key: /team-a/db/config, version: v1 }
kubectl apply -f platform/external-secrets/css-fake.yaml     # in production, the platform Application syncs this too
kubectl apply -f apps/secrets-demo/eso/db-fake.yaml
kubectl get clustersecretstore fake
kubectl -n secrets-demo get es db-fake
kubectl -n secrets-demo get secret db-fake -o json | jq '.data | map_values(@base64d)'
NAME   AGE   STATUS   CAPABILITIES   READY
fake   5s    Valid    ReadWrite      True
NAME      STORETYPE            STORE   REFRESH INTERVAL   STATUS         READY
db-fake   ClusterSecretStore   fake    1m                 SecretSynced   True
{
  "host": "pg.internal",
  "password": "s3cr3t-v1",
  "port": "5432"
}
kubernetes provider: use another namespace secret-source as the “secret store”, read with a dedicated ServiceAccount (closer to real identity authorization):
apiVersion: v1
kind: Namespace
metadata: { name: secret-source }
---
apiVersion: v1
kind: Secret
metadata: { name: team-a-db, namespace: secret-source }
stringData: { username: app, password: from-k8s-provider-v1 }
---
apiVersion: v1
kind: ServiceAccount
metadata: { name: eso-reader, namespace: secret-source }
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: { name: eso-store-role, namespace: secret-source }
rules:
- apiGroups: [""]
  resources: ["secrets"]
  verbs: ["get", "list", "watch"]
- apiGroups: ["authorization.k8s.io"]
  resources: ["selfsubjectrulesreviews"]
  verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: { name: eso-reader, namespace: secret-source }
subjects: [{ kind: ServiceAccount, name: eso-reader, namespace: secret-source }]
roleRef: { kind: Role, name: eso-store-role, apiGroup: rbac.authorization.k8s.io }
---
apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata: { name: k8s-source }
spec:
  conditions:
  - namespaces: ["secrets-demo"]
  provider:
    kubernetes:
      remoteNamespace: secret-source
      server:
        url: https://kubernetes.default.svc
        caProvider: { type: ConfigMap, name: kube-root-ca.crt, key: ca.crt, namespace: secret-source }
      auth:
        serviceAccount: { name: eso-reader, namespace: secret-source }
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata: { name: db, namespace: secrets-demo }
spec:
  refreshInterval: 1m
  secretStoreRef: { kind: ClusterSecretStore, name: k8s-source }
  target: { name: db-eso }
  data:
  - secretKey: password
    remoteRef: { key: team-a-db, property: password }
kubectl apply -f platform/external-secrets/k8s-source.yaml
kubectl apply -f apps/secrets-demo/eso/db-k8s.yaml
kubectl -n secrets-demo get es db
kubectl -n secrets-demo get secret db-eso -o jsonpath='{.data.password}' | base64 -d; echo
NAME   STORETYPE            STORE        REFRESH INTERVAL   STATUS         READY
db     ClusterSecretStore   k8s-source   1m                 SecretSynced   True
from-k8s-provider-v1
Rotation: change only the “secret store”, not Git:
kubectl -n secret-source patch secret team-a-db --type merge -p '{"stringData":{"password":"from-k8s-provider-v2"}}'
kubectl -n secrets-demo annotate es db force-sync=$(date +%s) --overwrite
sleep 5; kubectl -n secrets-demo get secret db-eso -o jsonpath='{.data.password}' | base64 -d; echo
from-k8s-provider-v2
Hand over to Argo CD and commit: put apps/secrets-demo/eso/ into an Application secrets-eso (project team-a) to sync it, and add platform/external-secrets/ to the platform project’s applications.
argocd app create secrets-eso --project team-a --repo https://github.com/<you>/gitops-lab.git \
  --path apps/secrets-demo/eso --dest-server https://kubernetes.default.svc --dest-namespace secrets-demo \
  --sync-policy automated --self-heal
argocd app get secrets-eso | grep -E 'ExternalSecret|Health Status'
Health Status:      Healthy
external-secrets.io  ExternalSecret  secrets-demo  db       Synced  Healthy  Secret was synced
external-secrets.io  ExternalSecret  secrets-demo  db-fake  Synced  Healthy  Secret was synced

Cleanup (after class): argocd app delete secrets-eso; kubectl delete ns secret-source; kubectl delete clustersecretstore fake k8s-source.

Case 1: after a Key Vault rotation, the app still connects with the old password

Problem: The DBA rotated the password in Key Vault. ESO updated the Secret within an hour, but the app reads it from environment variables and only picks up the change at the next release. In the meantime the old password was revoked, causing an outage. Response: Use “dual-password” rotation (old and new passwords coexist for more than one refresh cycle). On the Deployment, use Reloader, or output a checksum of the value in the ExternalSecret template so the controller triggers a rolling update. Limitation: Rolling restarts must be combined with a PDB, to avoid restarting everything at peak times.

Case 2: ExternalSecret stays OutOfSync

Problem: Argo CD shows the ExternalSecret as OutOfSync; the diff contains only the fields conversionStrategy: Default,decodingStrategy: None, and metadataPolicy: None . Cause: These are ESO defaults, filled in by the API Server on write; they are not in Git. Response: Write these defaults explicitly in Git, or enable Server-Side Diff (Lesson 2), or set ignoreDifferences for these fields. Limitation: Default fields may change after an ESO upgrade, so they need to be re-checked.

Case 3: multi-tenant unauthorized read

Problem: The platform provided a ClusterSecretStore that can read the entire Key Vault, and team-b referenced team-a’s database password in its own ExternalSecret. Response: One Vault per team (or one managed identity authorized only for a prefix), and one ClusterSecretStore per team, restricted with spec.conditions.namespaces ; AppProject does not allow teams to create SecretStore / ClusterSecretStore. Limitation: The number of Stores grows with the teams, so it suits generation with an ApplicationSet.

Common errors and fixes

could not get secret data from provider ... SecretSyncedError

Cause: Wrong key name or property, version does not exist, or the identity lacks read permission (Key Vault 403 / AccessDeniedException).

kubectl -n secrets-demo describe es db | sed -n '/Events:/,$p'
kubectl -n external-secrets logs deploy/external-secrets | grep -i error | tail -5

Fix: Check remoteRef.key,property; check authorization on the secret store side; the fake provider’s version must match the Store.

ClusterSecretStore STATUS InvalidProviderConfig / READY False

Cause: Store misconfiguration: Vault URL typo, ServiceAccount does not exist or lacks the Workload Identity annotation; the kubernetes provider lacks selfsubjectrulesreviews permissions or CA configuration.

kubectl describe clustersecretstore k8s-source | sed -n '/Status:/,$p'

Fix: Correct according to the event information. The Role for the kubernetes provider must include authorization.k8s.io/selfsubjectrulesreviews: create.

using unallowed store / namespace "team-b" is not allowed to use this store

Cause: The ClusterSecretStore’s conditions does not include that namespace. This is the intended isolation.

Fix: If access is truly needed, the platform team should change the Store’s conditions (after review), rather than the team creating its own Store.

Argo CD fails to sync the ESO chart: metadata.annotations: Too long: must have at most 262144 bytes

Cause: ESO’s CRDs are very large; a client-side apply writes the whole object into the last-applied-configuration annotation.

Fix: Use syncOptions: ["ServerSideApply=true"] on the Application (already added in the lab).

Command-line exercises
1. Immediately make secrets-demo/db this ExternalSecret resync once.
kubectl -n secrets-demo annotate externalsecret db force-sync=$(date +%s) --overwrite
2. List all ExternalSecrets that are not ready.
kubectl get es -A -o jsonpath='{range .items[?(@.status.conditions[0].status=="False")]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}'
Scenario analysis
The region hosting Key Vault fails for 2 hours. What happens to production applications during that time? What can be seen in Argo CD? What needs to be done?

Existing Secrets are not deleted, and running Pods keep using the old values; newly scaled Pods can also mount the existing Secret. The ExternalSecret’s Ready condition becomes False (SecretSyncedError), and Argo CD shows Degraded, but the sync status stays Synced. The risks: rotation is not possible during this time, and if someone deletes the Secret, ESO cannot rebuild it. Response: set up alerts (ESO metrics / Argo CD health); do not delete Secrets during an outage; for critical secrets, consider a multi-region Key Vault, or use force-sync to refresh immediately after recovery.

Verified teaching videos

▶
Manage Kubernetes Secrets With External Secrets Operator (ESO) — DevOps & AI Toolkit
English · a demonstration of SecretStore and ExternalSecret working together with GitOps. The video may use the older v1beta1 API; this lesson uses external-secrets.io/v1

Official documentation

Video storyboard script (about 90 seconds)

This courseware cannot directly generate video or MP3, so storyboards and narration scripts are provided for use with a video tool.

Shot 1 · 0–20s
Visual: the ExternalSecret in Git only says “fetch team-a-db-password from Key Vault”.
Narration: with External Secrets, Git holds only references, and Argo CD never sees the values.
Shot 2 · 20–50s
Visual: the ESO controller exchanges a ServiceAccount token for an Entra ID access token, fetches the value from Key Vault, and writes it into a Secret.
Narration: ESO accesses the secret store with a workload identity, so no long-lived cloud credentials are stored in the cluster.
Shot 3 · 50–75s
Visual: the value in Key Vault changes; the timer runs through one hour and the Secret updates automatically. The environment-variable Pod still has the old value until a rolling restart.
Narration: rotation changes only the secret store and syncs automatically on the refresh cycle. Remember, environment variables need a Pod restart to take effect.
Shot 4 · 75–90s
Visual: the platform team holds the keys to the ClusterSecretStore; teams can only fill in the ExternalSecret form.
Narration: the key to multi-tenancy: the platform provides the Store and restricts it to namespaces; teams write only ExternalSecrets.
or score ≥ 70% on the quiz

Module 6 · SOPS and Config Management Plugin

35:00 – 42:00 · Value-level encryption, diff-friendly; but in Argo CD, decryption happens in repo-server, a security trade-off that must be explicitly accepted
7 minutesSOPS v3.13.3 · age v1.3.2CMP sidecar · KSOPS v4.5.1Official recommendation against render-time decryption★★★☆☆
Learning objectives
  • Understand the SOPS file format: only values are encrypted (AES-256-GCM) while key names stay in plaintext; the trailing sops metadata records the data key encrypted for each recipient (age / KMS) and the overall MAC.
  • Use .sops.yaml of creation_rules and encrypted_regex: ^(data|stringData)$ to encrypt only the value part of a Secret.
  • Write a CMP sidecar plugin (plugin.yaml): discover / init / generate), via the argo-cd chart’s configs.cmp and repoServer.extraContainers installation; understand the KSOPS approach.
  • Explain the four costs of this approach: the age private key enters Argo CD, plaintext enters the Redis cache and the repo-server API, a generation failure can cause an empty manifest to be pruned, and it is incompatible with the rendered-manifest pattern.
Prerequisites: Module 3; Kustomize and manifest generation from Lesson 2. Importance:★★★☆☆ (understand the principle and risks; ESO is preferred in production)

What: SOPS and age

SOPS (Secrets OPerationS, a CNCF project,getsops/sops) is a file encryption editor that supports YAML / JSON / ENV / INI,encrypts only the values and keeps the structure, so the encrypted file still shows which key changed. Each file has a random data key, used to encrypt each value with AES-256-GCM. The data key is then encrypted separately for each “recipient” and written into the trailing part of the file (age public keys, PGP, Azure Key Vault keys, AWS KMS, GCP KMS and Vault Transit can all serve as recipients), and a MAC covering all values prevents tampering.

age is a simple, modern file encryption tool: age-keygen generates an X25519 key pair; the public key looks like age1…, and the private key looks like AGE-SECRET-KEY-1…. SOPS looks for the private key in the environment variable SOPS_AGE_KEY_FILE,SOPS_AGE_KEY, or at the default path ~/.config/sops/age/keys.txt.

Why: why some people choose it

  • Diff-friendly: reviewers can see that the “password key changed”, whereas Sealed Secrets only shows that the whole ciphertext changed.
  • One file, multiple recipients: it can be encrypted at the same time for a dev cluster’s age key, production’s KMS key, and an operator’s personal age key.
  • Common toolchain: Flux natively supports SOPS decryption inside the cluster; Helm (helm-secrets) and Terraform can also use the same file.

How: two ways to decrypt in Argo CD

ApproachPrincipleAdvantagesDrawbacks
CMP sidecar (this lesson’s lab)Add a sidecar to the repo-server Pod, with the entry point /var/run/argocd/argocd-cmp-server; repo-server sends the source directory to it as a tar stream over a Unix socket, and the sidecar runs the plugin.yaml from its generate command (sops -d + kustomize build), returning the YAML output toThe plugin is isolated from the repo-server main container (separate /tmp, running as UID 999); the keys are mounted only into the sidecarEach Application can use only one plugin; you must maintain the plugin image and tool versions yourself
KSOPSKustomize’s KRM exec plugin (apiVersion: viaduct.ai/v1, kind: ksops); Argo CD needs kustomize.buildOptions: "--enable-alpha-plugins --enable-exec", and an initContainer puts ksops into the repo-servercontinues to use the native Kustomize type; no CMP neededruns exec plugins in the repo-server main container; --enable-exec for all Kustomize applications enables the ability to execute arbitrary binaries, a larger attack surface

Security trade-offs (why the official docs “strongly warn against” it)

  1. The root key enters Argo CD: the age private key (or KMS decryption permission) must be given to repo-server / the sidecar. Any vulnerability that lets repo-server execute arbitrary commands or read files (several Critical advisories in 2026-10 were exactly this kind) can obtain it.
  2. Plaintext enters the cache: the generated manifests (containing plaintext Secrets) are cached in Redis, and can be retrieved through the repo-server gRPC API.
  3. Empty manifests and pruning: if the generate command fails but returns 0 (for example, a pipeline swallows the error), Argo CD receives an empty manifest, and with prune enabled it will delete resources. You must set -o pipefail.
  4. Incompatible with the rendered-manifest pattern: Source Hydrator commits the rendered output back to Git, and plaintext secrets must not appear there.

When: when it can still be used

  • The team already uses SOPS heavily and migration cost is high, Argo CD runs in a separate management cluster, NetworkPolicy is enforced, and versions are kept up to date.
  • Better alternatives: move the “decryption” of SOPS-encrypted files into the cluster (for example, ESO fetches values from a secret store and SOPS is used only on developers’ machines or in Terraform), or migrate to Sealed Secrets / ESO.
Common misconceptions① “SOPS encrypts the whole file”: by default it encrypts all values, but key names, structure and comments (optionally) remain visible. With encrypted_regex , only matching keys are encrypted, while metadata.name stay in plaintext. ② “It is fine to put the age private key in another directory of the Git repository”: once the private key enters Git, all ciphertext is effectively plaintext. ③ “A CMP plugin is a custom resource”: ConfigManagementPlugin is only the configuration file format inside the sidecar. Since 2.8 there is no matching CRD, and applying it to the cluster fails with no matches for kind.

Architecture diagram: decryption in the CMP sidecar

Gitdb.enc.yaml (SOPS)kustomization.yaml Pod argocd-repo-server repo-server main containergit fetch → source directorydiscover plugintar stream → Unix socket sidecar cmp-sopsargocd-cmp-server (UID 999)plugin.yaml: generatesops -d *.enc.yamlkustomize build .🔑 /sops-age/keys.txtseparate /tmp (cmp-tmp) /var/run/argocd (shared socket) ⚠ the returned manifest contains a plaintext Secret→ cached in Redis; retrievable via the repo-server API; the controller compares and applies RedisManifest cache (plaintext) controller → APIapply Secret Secret sops-age (age private key)mounted only into the sidecar
Figure 6-1: decryption happens in the sidecar within the repo-server Pod; the plaintext then appears in the Redis cache and in the controller

File structure diagram: a SOPS-encrypted Secret

apiVersion: v1 ← plaintext (does not match encrypted_regex) kind: Secret metadata: {name: db} ← plaintext, for easier review stringData: password: ENC[AES256_GCM,data:…,iv:…,tag:…,type:str] sops: age: [{recipient: age1…, enc: -----BEGIN AGE…}] mac: ENC[AES256_GCM,…] version: 3.13.3 data key (random)AES-256-GCM encrypts each value one copy per recipientage / KMS encrypts the data key MACtamper / value-deletion protection
Figure 6-2: value-level encryption. Structure is visible, values are hidden; the private key of any one recipient can decrypt the data key

Interactive animation: the full CMP rendering path and where plaintext lands

Plays the whole process of Argo CD generating manifests for an Application that uses the sops-kustomize plugin. Two switches let you observe the consequences: “generate without pipefail and sops fails” demonstrates the risk of an empty manifest being pruned; “cache hit” demonstrates the second request fetching the plaintext manifest directly from Redis.

Ready.
$ argocd app get secrets-sops --hard-refresh

Core commands and parameters

CommandPurposeKey parameters
age-keygen -o key.txtGenerate an age key pairThe public key is in the output line # public key: age1…
sops -e -i FILEEncrypts per .sops.yaml rules, in place--age,--encrypted-regex
sops FILEdecrypts in an editor and re-encrypts on saverequires the private key
sops -d FILEDecrypt to stdout--extract '["stringData"]["password"]'
sops updatekeys FILEWith the new .sops.yaml adds or removes recipientsRotate / add keys
sops rotate -i FILERegenerate the data keyUse after a team member leaves
age-keygen -o ~/.config/sops/age/keys.txt 2>&1 | tee /dev/stderr
AGE_PUB=$(grep 'public key' ~/.config/sops/age/keys.txt | awk '{print $4}')
cat > ~/gitops-lab/.sops.yaml <<EOF
creation_rules:
  - path_regex: apps/secrets-demo/sops/.*\.enc\.yaml$
    encrypted_regex: ^(data|stringData)$
    age: ${AGE_PUB}
EOF
cd ~/gitops-lab
kubectl create secret generic db-sops -n secrets-demo --from-literal=password=sops-s3cr3t \
  --dry-run=client -o yaml > apps/secrets-demo/sops/db.enc.yaml
sops -e -i apps/secrets-demo/sops/db.enc.yaml
cat apps/secrets-demo/sops/db.enc.yaml
Public key: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
apiVersion: v1
data:
    password: ENC[AES256_GCM,data:1Wq9Gm6p3d0Vb3M0p5xD1g==,iv:...,tag:...,type:str]
kind: Secret
metadata:
    creationTimestamp: null
    name: db-sops
    namespace: secrets-demo
sops:
    age:
        - recipient: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
          enc: |
            -----BEGIN AGE ENCRYPTED FILE-----
            ...
            -----END AGE ENCRYPTED FILE-----
    lastmodified: "2026-11-17T03:40:12Z"
    mac: ENC[AES256_GCM,data:...,type:str]
    encrypted_regex: ^(data|stringData)$
    version: 3.13.3

How to verify:sops -d apps/secrets-demo/sops/db.enc.yaml | grep password You can see base64 values. Common mistakes:.sops.yaml The path_regex mismatch causes no matching creation rules found; forgetting -i when encrypting outputs the result to the screen while the file stays in plaintext. Always check before committing. Production use: Recipients include both the cluster key and the operations “break-glass” key (stored on offline media).

argo-cd chart values: install the sops-kustomize plugin

configs:
  cmp:
    create: true
    plugins:
      sops-kustomize:
        discover:
          find:
            glob: "**/*.enc.yaml"
        generate:
          command: [bash, -c]
          args:
            - |
              set -euo pipefail
              # Output the decrypted Secret first, then the remaining Kustomize resources (do not list *.enc.yaml in kustomization)
              for f in $(find . -name '*.enc.yaml' | sort); do
                sops -d "$f"; echo '---'
              done
              kustomize build .
repoServer:
  initContainers:
  - name: install-sops
    image: alpine:3.22
    command: [sh, -c]
    args:
    - wget -qO /custom-tools/sops https://github.com/getsops/sops/releases/download/v3.13.3/sops-v3.13.3.linux.amd64 && chmod +x /custom-tools/sops
    volumeMounts: [{ name: custom-tools, mountPath: /custom-tools }]
  extraContainers:
  - name: cmp-sops
    image: quay.io/argoproj/argocd:v3.6.1        # includes bash and kustomize
    command: [/var/run/argocd/argocd-cmp-server]
    env:
    - { name: SOPS_AGE_KEY_FILE, value: /sops-age/keys.txt }
    securityContext: { runAsNonRoot: true, runAsUser: 999, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false }
    volumeMounts:
    - { mountPath: /var/run/argocd, name: var-files }
    - { mountPath: /home/argocd/cmp-server/plugins, name: plugins }
    - { mountPath: /home/argocd/cmp-server/config/plugin.yaml, subPath: sops-kustomize.yaml, name: argocd-cmp-cm }
    - { mountPath: /tmp, name: cmp-tmp }
    - { mountPath: /usr/local/bin/sops, subPath: sops, name: custom-tools }
    - { mountPath: /sops-age, name: sops-age, readOnly: true }
  volumes:
  - { name: argocd-cmp-cm, configMap: { name: argocd-cmp-cm } }
  - { name: cmp-tmp, emptyDir: {} }
  - { name: custom-tools, emptyDir: {} }
  - { name: sops-age, secret: { secretName: sops-age } }

Key points: ① the entry point must be /var/run/argocd/argocd-cmp-server running as UID 999; ② the plugin config file is located at /home/argocd/cmp-server/config/plugin.yaml; ③ do not share /tmp with the main container (path-traversal mitigation since 2.4); ④ the age private key is mounted only into the sidecar; ⑤ in production, verify the sops binary’s checksum, or build a plugin image with the tools built in instead of downloading them at startup.

KSOPS approach (comparison)

apiVersion: viaduct.ai/v1
kind: ksops
metadata:
  name: db-secret-generator
  annotations:
    config.kubernetes.io/function: |
      exec:
        path: ksops
files:
  - ./db.enc.yaml

Then reference it in kustomization.yaml of generators: , and in argocd-cm set kustomize.buildOptions: "--enable-alpha-plugins --enable-exec". Note: this option applies to all Kustomize applications.

Lab 6: install the sops-kustomize plugin and deploy an encrypted Secret (about 8 minutes)

Put the age private key into the argocd namespace (this step is “handing the root key to Argo CD”; in production it should come from a secret store, for example generated by ESO):
kubectl -n argocd create secret generic sops-age --from-file=keys.txt=$HOME/.config/sops/age/keys.txt
kubectl -n argocd get secret sops-age
Edit the values as described in the Commands section and upgrade:
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd get pod -l app.kubernetes.io/component=repo-server -o jsonpath='{.items[0].spec.containers[*].name}'; echo
kubectl -n argocd logs deploy/argocd-repo-server -c cmp-sops | head -3
repo-server cmp-sops
time="2026-11-17T03:52:01Z" level=info msg="ArgoCD ConfigManagementPlugin Server is starting" built="..." commit="..." version=v3.6.1+...
time="2026-11-17T03:52:01Z" level=info msg="argocd-cmp-server v3.6.1+... serving on /home/argocd/cmp-server/plugins/sops-kustomize.sock"
Prepare the application directory (the kustomization does not list the encrypted file; the plugin decrypts and outputs it separately):
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: secrets-demo
resources:
- app.yaml        # the podinfo Deployment that reads Secret db-sops (rewritten from Module 4’s app.yaml)
cd ~/gitops-lab
sed -e 's/sealed-demo/sops-demo/g' -e 's/name: db,/name: db-sops,/' apps/secrets-demo/sealed/app.yaml > apps/secrets-demo/sops/app.yaml
grep -n 'db-sops' apps/secrets-demo/sops/app.yaml
git add .sops.yaml apps/secrets-demo/sops && git commit -m "sops: encrypted db secret" && git push
git show HEAD --stat | grep enc.yaml
 apps/secrets-demo/sops/db.enc.yaml | 22 ++++++++++++++++++++++

The Secret is named db-sops, to avoid conflicting with the Module 4 Secret owned by SealedSecret db . Two controllers managing the same Secret would overwrite each other.

Create the Application and explicitly specify the plugin:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: secrets-sops
  namespace: argocd
spec:
  project: team-a
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/secrets-demo/sops
    plugin:
      name: sops-kustomize
  destination:
    server: https://kubernetes.default.svc
    namespace: secrets-demo
  syncPolicy:
    automated: { prune: true, selfHeal: true }
kubectl apply -f argocd/apps/secrets-sops.yaml
argocd app wait secrets-sops --health --timeout 120
argocd app resources secrets-sops
kubectl -n secrets-demo get secret db-sops -o jsonpath='{.data.password}' | base64 -d; echo
GROUP  KIND        NAMESPACE     NAME       ORPHANED
       Secret      secrets-demo  db-sops    No
apps   Deployment  secrets-demo  sops-demo  No
sops-s3cr3t
See “plaintext in Argo CD” with your own eyes: anyone with an Application get permission can request the rendered result (whether the Secret values are masked depends on the interface and version; masking is only API-layer protection):
argocd app manifests secrets-sops --source git | grep -A3 'kind: Secret' | head -6
kubectl -n argocd exec deploy/argocd-redis -- sh -c 'redis-cli -a "$REDIS_PASSWORD" --no-auth-warning --scan --pattern "mfst*" | head -3'
kind: Secret
metadata:
  name: db-sops
data:
  password: ++++++++
mfst|app.kubernetes.io/instance|secrets-sops|...|sops-kustomize|...

API output is masked, but in Redis the keys beginning with mfst store the generated manifests (compressed), and they contain the plaintext values. This is why the official docs recommend isolating Redis with NetworkPolicy. Environment variable names and key prefixes may change between versions; check against the actual system.

Cleanup (after class): argocd app delete secrets-sops; after removing the plugin from values, helm upgrade; kubectl -n argocd delete secret sops-age; delete the local ~/.config/sops/age/keys.txt (or store it securely).

Case 1: a silent plugin failure deletes a production Secret

Problem: The CMP’s generate was written as sops -d secret.enc.yaml | kustomize ..., one time the age key mount failed, sops reported an error but the pipeline returned 0, Argo CD received a manifest missing the Secret, and auto-sync + prune deleted the production Secret. Response:set -euo pipefail; annotate the Secret with argocd.argoproj.io/sync-options: Prune=false; for production applications, turn off automatic prune or set a sync window. Limitation: After turning prune off for the Secret, you must manually clean up Secrets that are truly no longer used.

Case 2: migrating from KSOPS to a CMP sidecar

Problem: To use KSOPS, enabled --enable-exec, and a security review pointed out that any Kustomize application can execute binaries in the repository. Response: Changed to a CMP sidecar that applies only to plugin: {name: sops-kustomize} applications, and removed --enable-exec from argocd-cm. Limitation: CMP applications are no longer the “native Kustomize type”, so UI parameter overrides (such as kustomize images) are not available.

Case 3: using an Azure Key Vault key as a SOPS recipient

Problem: Did not want to put the age private key file into the cluster. Response:.sops.yaml Use an azure_keyvault recipient; the CMP sidecar obtains the Key Vault decrypt permission through Workload Identity (the key never leaves Key Vault). Limitation: The plaintext still appears in repo-server and Redis. The risk shifts from “the root key is stolen” to “decryption permission is abused”, which can be audited in Key Vault logs.

Common errors and fixes

Error getting data key: 0 successful groups required, got 0

Cause: sops cannot find a private key that can unlock the data key: SOPS_AGE_KEY_FILE wrong path, the Secret is not mounted into the sidecar, or the file was encrypted with a different age public key.

kubectl -n argocd exec deploy/argocd-repo-server -c cmp-sops -- sh -c 'echo $SOPS_AGE_KEY_FILE; ls -l /sops-age/'
grep recipient apps/secrets-demo/sops/db.enc.yaml

Fix: Verify mounts and environment variables; use sops updatekeys to add the cluster’s age public key to the file.

ComparisonError: ... plugin sops-kustomize not found / couldn't find cmp-server plugin with name "sops-kustomize" supporting the given repository

Cause: sidecar not started, plugin.yaml not mounted to the correct path, or name mismatch (when version is present the name must be <name>-<version>), or the discover rule does not match this directory.

kubectl -n argocd get pod -l app.kubernetes.io/component=repo-server
kubectl -n argocd exec deploy/argocd-repo-server -c cmp-sops -- cat /home/argocd/cmp-server/config/plugin.yaml | head

Fix: Correct the mounts and names. After modifying the ConfigMap you must restart the repo-server Pod. CMP errors are cached, so use Hard Refresh when debugging.

no matches for kind "ConfigManagementPlugin" in version "argoproj.io/v1alpha1"

Cause: plugin.yaml was applied as a Kubernetes resource. This CRD was deprecated in 2.4 and removed in 2.8.

Fix: Put it in a ConfigMap (or bake it into the image) and mount it at the sidecar’s /home/argocd/cmp-server/config/plugin.yaml.

context deadline exceeded (CMP generation timeout)

Cause: plugin execution exceeds the repo-server timeout (default 60s), or the sidecar’s ARGOCD_EXEC_TIMEOUT (default 90s); a slow tool download in the initContainer also slows startup.

Fix: Increase server.repo.server.timeout.seconds and controller.repo.server.timeout.seconds, and set the sidecar’s ARGOCD_EXEC_TIMEOUT; preload tools into the image.

Command-line exercise
1. Decrypt and print only db.enc.yaml the base64 value of password in the file.
sops -d --extract '["data"]["password"]' apps/secrets-demo/sops/db.enc.yaml
2. The team added the ops engineer's age public key to .sops.yaml, how can existing files also be decrypted by them?
sops updatekeys -y apps/secrets-demo/sops/db.enc.yaml
Scenario analysis question
The security team requires that “no Argo CD component may hold a key that can decrypt production secrets.” How should the existing SOPS CMP solution be migrated?

The SOPS CMP approach inherently requires repo-server to hold decryption capability, which cannot meet that requirement. Migration path: import the production secret values into Key Vault (can be sops -d done with a one-time export written over a secure channel), change Git to reference an ExternalSecret so ESO fetches the values inside the cluster; or, if no secrets store is available, switch to Sealed Secrets (the private key exists only in the target cluster). After migration, remove the sops sidecar and sops-age Secret, rotate all values once managed by SOPS (because the age private key was once present in Argo CD), and clear the Redis cache (restart Redis or run a hard refresh).

Verified teaching video

No “Argo CD + SOPS / CMP sidecar” teaching video verified through YouTube oEmbed could be found. Several video titles mentioned in articles and third-party lists were found, but the video IDs could not be verified, so no links are listed. Please use the storyboard script below and the official documentation.

Official documentation

Video storyboard script (about 100 seconds)

This courseware cannot generate a video or MP3 directly, so the storyboard and narration are provided for a video tool to produce.

Shot 1 · 0–20s
Visual: a YAML file with clearly visible keys; the values turn into ENC[AES256_GCM…], and a sops metadata block appears at the bottom.
Narration: SOPS encrypts only the values, so the structure stays readable and code review can show which key changed.
Shot 2 · 20–50s
Visual: a sidecar container pops up in the repo-server Pod; the source directory is passed in as a tar stream, sops decrypts it with the mounted age private key, and kustomize outputs the manifests.
Narration: in Argo CD, decryption is done by the plugin sidecar next to repo-server, with argocd-cmp-server as the entry point.
Shot 3 · 50–80s
Visual: the generated manifests flow into Redis, with a red “plaintext” label; they get an asterisk when returned by the API.
Narration: the cost is that plaintext enters the Redis cache and the private key enters Argo CD. API masking cannot protect the cache.
Shot 4 · 80–100s
Visual: the generate command errors but returns zero, the manifests become empty, and resources are deleted one by one; with set -o pipefail added, the sync fails instead of deleting.
Narration: the plugin must let errors propagate. One line, set -o pipefail, may prevent a production incident.
or score ≥ 70% in the quiz

Module 7 · Commit signature verification and supply chain

42:00 – 50:00 · “Able to push to the repo” should not mean “able to deploy to production”: only sync commits signed by trusted keys
8 minSource Integrity · Argo CD 3.5+signatureKeys is deprecated★★★★☆
Learning objectives
  • Manage the Argo CD GnuPG keyring (argocd gpg add/list/rm,argocd-gpg-keys-cm), and understand the simple trust model of “importing means trust.”
  • Use the AppProject's spec.sourceIntegrity.git.policies configure by repository glob none / head / strict pattern, and move the old signatureKeys over.
  • Understand how strict mode handles the seal commit (Argocd-gpg-seal trailer), and deal with the real-world problem of unsigned commits in history.
  • Place commit signing within the broader supply-chain picture: branch protection, image signing and admission policies, pinning chart and image versions, and verifying Argo CD's own release artifacts.
Prerequisites: GPG signing from the Git course (git commit -S); Lesson 4: AppProject. Importance:★★★★☆

What: Source Integrity Verification

Argo CD lets you declare a “source integrity” condition on an AppProject: when it is not met, the Application will not sync, and reports ComparisonError. The method currently supported is Git GnuPG verification: confirm that the target revision is signed by a trusted GPG key.

  • Since v1.7, there is a project-level spec.signatureKeys (verifies only HEAD).
  • From v3.5 onward, changed to spec.sourceIntegrity, supporting per-repository policies, different policies for each source in multi-source applications, and strict mode. signatureKeys is still supported, but deprecated, the two cannot be used together; only when signatureKeys is set, Argo CD converts it in the background to an equivalent head mode. The old GPG verification docs also note “will be removed in the next major version.”
  • Applies only to Git sources: Helm repositories and OCI sources cannot use GPG verification; once enabled, you cannot use argocd app sync --local; ApplicationSets generated by a git generator where the project field is templated do not support signature verification.

Why: what it defends against

Module 1 covered the attack path “from Git”: if you obtain a developer's Git credentials (or CI token), you can push manifests, and Argo CD faithfully deploys them. Signature verification separates “can push” from “can deploy”: an attacker would also need a trusted private key (usually on a hardware key or personal machine, protected by a passphrase). It also prevents the Git hosting platform or a man-in-the-middle from tampering with content, because the signature covers the commit object's hash.

How: three modes

modeVerification scopeApplies to
noneNo verification, and no further policies are attemptedExplicitly exempts certain repositories
headVerifies only the commit the target revision points to; if the target is an annotated tag, verifies the tag's own signature (requires git tag -s)Equivalent to the old signatureKeys setting; common starting point
strictVerifies the target revision and all its ancestors; when a seal commit is reached, the backward walk on that branch stops therePrevents unsigned changes from entering the history (for example, history rewritten by a force push)

seal commit: a commit signed by a trusted key whose message contains the trailer Argocd-gpg-seal: <reason> that says “I have reviewed all earlier unsigned or no-longer-trusted-key commits and vouch for them.” Used when enabling signing midway through a repo, merging external contributions, removing a departed employee's key, or rotating your own key, without rewriting history. Create: git commit --signoff --gpg-sign --allow-empty --trailer="Argocd-gpg-seal: <justification>".

Keyring: Imported public keys are stored in argocd-gpg-keys-cm (key is the key ID, value is the ASCII-armored public key), mounted into repo-server, and in the Pod's /app/config/gpg/keys builds a temporary keyring. Argo CD's trust model is simple: “importing means trust”, with no Web of Trust support. The RBAC resource for managing keys is gpgkeys (get / create / delete).

When: rollout order

  1. First enable branch protection on the Git platform (require PRs, review, and signed commits).
  2. Import the public keys of all maintainers and the platform web-flow key (commits merged through the GitHub web UI are signed by GitHub's web-flow key; GitHub replaced this key in 2024, so use https://github.com/web-flow.gpg as the authority).
  3. On non-production projects, enable head, observe for a while; upgrade production projects to strict, and use a single seal commit as the starting point.

Comparison with similar mechanisms

Argo CD Source IntegrityFlux GitRepository verifyGitHub “Require signed commits”Image signature admission (Kyverno / policy-controller)
What is verifiedGit commits / tags (GPG)Git commits / tags (GPG), OCI artifacts (cosign)Commits pushed to protected branchesRunning container images
Where it runsBefore sync (repo-server)When fetching the sourceHosting platformKubernetes admission
PreventsUnauthorized manifest changesSame as leftUnsigned pushes (within the platform)Images built without authorization
Common misconceptions① “Seeing Verified on GitHub is enough.” That is the platform's judgment; if an attacker modified content outside the platform or took over a platform account, Argo CD has no independent check. ② “Argo CD can verify SSH signatures / gitsign.” The only method listed in the Source Integrity documentation is GnuPG. ③ “Signature verification protects images.” It only proves that the manifest commit came from a trusted person; whether the images referenced in the manifests are trustworthy requires image signing and admission policies (and pinning versions by digest).

Flowchart: signature check from commit to sync

Developergit commit -S (private key) GitHubBranch protection + signing requirement repo-serverMatch the repository against the AppProject policygit verify-commit / verify-tagKey ID ∈ policy.keys ? argocd-gpg-keys-cm→ /app/config/gpg/keys ✓ PassGenerate manifests → sync ✗ ComparisonErrorNo manifests generated, no syncThe cluster stays in its previous state The repository URL is first matched against the globs in policies[].repos (! excludes); each source applies only one policy; sources that match no policy are not verified
Figure 7-1: the signature check happens before manifest generation; if verification fails, Argo CD does not sync that revision

History diagram: strict mode and seal commit

c1 unsigned c2 unsigned c3 seal ✓Argocd-gpg-seal: enable signing c4 alice ✓ c5 bob ✓ c6 HEAD ✓ strict: walk back from HEAD up to the nearest seal commit (c1 and c2 are no longer checked) head: check only c6
Figure 7-2: strict verifies the full ancestor chain; the seal commit vouches for the unsigned commits earlier in history

Interactive simulator: will this revision be synced?

Below is the gitops-lab main branch history of the repo (oldest to newest, left to right). Click each commit to toggle its signature state (trusted-key signed → untrusted-key signed → unsigned → seal commit). After selecting a policy mode and a trusted key, click “Verify”; the simulator runs repo-server's checks one by one and shows the results and log.

mode: Trusted keys:
Click a commit card to change its signature state, then verify.
$ argocd app get team-a/podinfo-prod --refresh

Core commands and parameters

CommandPurposeNotes
gpg --quick-gen-key "Name <mail>" ed25519 sign 1yGenerate signing keySetting an expiry date and passphrase is recommended
git config user.signingkey ID; git config commit.gpgsign trueSign commits by defaultgit commit -S Sign a single commit
git log --show-signature -1 / git verify-commit HEADVerify signature locallySame logic as Argo CD's check
argocd gpg add --from FILEImport public key into Argo CDBinary or ASCII armor
argocd gpg list / get ID / rm IDManage keyringRBAC resource gpgkeys
argocd proj add-signature-keyOld way (deprecated)Migrate to sourceIntegrity

AppProject policy (3.5+)

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: team-a
  namespace: argocd
spec:
  sourceIntegrity:
    git:
      policies:
      - repos:
        - url: "https://github.com/<you>/gitops-lab.git"
        gpg:
          mode: head                       # change to strict once production is stable
          keys:
          - "A1B2C3D4E5F60718"             # alice (example ID; replace with your long ID)
          - "B5690EEEBB952194"             # GitHub web-flow (for web UI merges; authoritative source is github.com/web-flow.gpg)
      - repos:
        - url: "https://github.com/<you>/*"
        - url: "!https://github.com/<you>/gitops-lab.git"
        gpg:
          mode: none                       # explicitly exempts the remaining repositories

Migrating from signatureKeys

spec:
  signatureKeys:                 # delete this block
  - keyID: 4AEE18F83AFDEB23
---
spec:
  sourceIntegrity:
    git:
      policies:
      - repos: [{ url: "*" }]
        gpg:
          mode: head
          keys: ["4AEE18F83AFDEB23"]

How to verify:argocd proj get team-a -o yaml | grep -A8 sourceIntegrity; after pushing an unsigned commit, the application should show ComparisonError. Common errors: Using a short ID or an inconsistent fingerprint format; forgetting to import the public key into argocd-gpg-keys-cm (a policy has the ID but the keyring lacks that public key, which also fails verification). Production use: The platform keeps the list of maintainer public keys in Git (ConfigMap), synced by a platform Application.

Lab 7: sync only signed commits (about 8 minutes)

Generate keys and configure git signing (Lab key, delete after class):
gpg --batch --passphrase '' --quick-gen-key "GitOps Lab <lab@example.com>" ed25519 sign 30d
KEYID=$(gpg --list-secret-keys --keyid-format long lab@example.com | awk '/^sec/{split($2,a,"/"); print a[2]}')
echo $KEYID
cd ~/gitops-lab
git config user.signingkey $KEYID
git config commit.gpgsign true
gpg --armor --export $KEYID > /tmp/lab-pub.asc
7C2D9A41B3E8F605

To show Verified on GitHub, also add the public key to your GitHub account (Settings → SSH and GPG keys), with an email matching the commit email. This is not required for Argo CD's verification.

Import the public key into Argo CD:
argocd gpg add --from /tmp/lab-pub.asc
argocd gpg list
kubectl -n argocd get cm argocd-gpg-keys-cm -o jsonpath='{.data}' | head -c 120; echo
Created key with key ID 7C2D9A41B3E8F605
KEYID             TYPE     IDENTITY
7C2D9A41B3E8F605  ed25519  GitOps Lab <lab@example.com>
{"7C2D9A41B3E8F605":"-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmDMEZ...
Enable the head policy for team-a (enter the IDs above into the policy on the “Commands” tab; the web-flow line can be kept), then make a signed commit first:
kubectl apply -f argocd/projects/team-a.yaml
git commit --allow-empty -S -m "signed: enable source integrity" && git push
git verify-commit HEAD && argocd app get secrets-sealed --hard-refresh | grep -E 'Sync Status|Conditions' -A1 | head -4
gpg: Signature made Tue Nov 17 04:10:02 2026 UTC
gpg:                using EDDSA key 7C2D9A41B3E8F605
gpg: Good signature from "GitOps Lab <lab@example.com>" [ultimate]
Sync Status:        Synced to main (b81c0e4)
Push an unsigned commit and observe the rejection:
echo "# unsigned" >> apps/secrets-demo/sealed/app.yaml
git -c commit.gpgsign=false commit -am "unsigned change" && git push
argocd app get secrets-sealed --hard-refresh | sed -n '/CONDITION/,/^$/p'
CONDITION         MESSAGE                                                                          LAST TRANSITION
ComparisonError   Failed to load target state: ... revision 5d0e7a2 in Git is not signed, but a signature is required   2026-11-17 04:12:30 +0000 UTC

The cluster stays in the state of the last sync (b81c0e4), and the unsigned change is not deployed.

Restore: take over this change with a signed commit (head mode checks only HEAD, so one new signed commit is enough; strict mode requires a seal commit):
git commit --allow-empty --signoff --gpg-sign --trailer="Argocd-gpg-seal: reviewed unsigned change 5d0e7a2" -m "seal: review unsigned commit"
git push && argocd app get secrets-sealed --hard-refresh | grep 'Sync Status'
Sync Status:        Synced to main (e2f4a90)

--trailer Requires git 2.32 or later.

Cleanup: remove from team-a sourceIntegrity (otherwise unsigned commits in later lessons cannot sync); argocd gpg rm $KEYID; git config --unset commit.gpgsign; gpg --delete-secret-and-public-keys $KEYID.

Case 1: CI bot account stolen

Problem: The image update bot's token (the CI token that automatically changes tags) leaked, and the attacker pushed a commit pointing to a malicious image. Approach: Enable strict signature verification on production projects. The bot uses a dedicated signing key (stored in Key Vault / HSM, with signing done in a controlled pipeline), and its key is listed only in the policies for the repositories it is allowed to modify. Images use digests and are verified by an admission policy for cosign signatures. Limitations: The bot's signing key is itself a high-value target and needs rotation and auditing.

Case 2: enabling signing midway, with many unsigned commits in history

Problem: Wanted to use strict directly, but the repository has three years of unsigned history. Approach: The repository owner makes one empty seal commit (Argocd-gpg-seal: start signing policy 2026-11), then requires all later commits to be signed; after external-contribution PRs are merged, maintainers seal them. Limitations: A seal commit vouches for all prior history, so it needs a clear approval process and records.

Case 3: maintainer departure and key rotation

Problem: A maintainer leaves; their key must be revoked, but the validity of their historical commits must be preserved. Approach: From the policy keys and the keyring, before removing his key, another maintainer submits a seal commit (“remove Bob's key; prior commits reviewed”). In head mode, it is only necessary to ensure that HEAD afterwards is signed by a trusted key. Limitations: If Argo CD is syncing a historical tag (for example, rolling back to an old version) that was signed by a removed key, verification will fail.

Supply chain (Argo CD-related parts)

  • Pin versions: the Application's Helm chart uses a fixed version (such as targetRevision: 2.22.0), images use digests, and production does not track HEAD branches or other mutable references.
  • Image signature admission: Kyverno verifyImages or Sigstore policy-controller verifies cosign signatures in the cluster; every Pod that Argo CD deploys must pass through it.
  • Remote dependencies: Argo CD's repository allowlist only restricts the repositories originally cloned; Kustomize remote bases and Helm dependencies can pull in other sources (the official security documentation explicitly warns about this). Vendor dependencies or pin refs where possible.
  • Argo CD itself: obtain it from the official release page or Helm repository, and verify the images and CLI with cosign / SLSA provenance per the “Verification of Argo CD Artifacts” documentation.

Common errors and fixes

ComparisonError: ... is not signed, but a signature is required

Cause: The target revision is unsigned, or the policy mode is strict and there are unsigned commits in history without a seal.

git log --show-signature -5 --format='%h %G? %GK %s'
argocd proj get team-a -o yaml | sed -n '/sourceIntegrity/,/^  [a-z]/p'

Fix: Sign the commit or add a seal commit; %G? output G (good signature), N (no signature), E (cannot check, usually a missing public key).

Commit is signed but still ComparisonError: the signing key is not in the keyring or the policy (wording varies by version)

Cause: The signer's public key was not imported into the Argo CD keyring, or the key ID is not in the policy's keys list.

argocd gpg list
kubectl -n argocd exec deploy/argocd-repo-server -- sh -c 'GNUPGHOME=/app/config/gpg/keys gpg --list-keys --keyid-format long'

Fix:argocd gpg add --from key.asc and add the ID to the policy. After import, syncing to the Pod may take a while; if it stays out of sync, restart repo-server.

After enabling Source Integrity, argocd app sync --local is rejected

Cause: After enabling Source Integrity, syncing from a local directory is not allowed (explicitly stated in the documentation).

Fix: Go through the normal flow with a signed commit; for an urgent fix, temporarily adjust the project policy following the break-glass procedure and record the change.

Project configured with both signatureKeys and sourceIntegrity: error or unexpected behavior

Cause: The two cannot be used together.

Fix: Delete spec.signatureKeys, and move the keys into sourceIntegrity.git.policies[].gpg.keys (reverse these steps when downgrading to 3.4 or earlier).

Command-line exercise
1. Show the signature status and signing key ID of the last 5 commits.
git log -5 --format='%h %G? %GK %an %s'
2. Create a seal commit that states “start enforcing signing.”
git commit --allow-empty --signoff --gpg-sign --trailer="Argocd-gpg-seal: start enforcing signatures" -m "seal: start signing"
Scenario analysis question
A production project has head mode enabled. An attacker obtains a developer's GitHub token (no GPG private key). Can he get a malicious manifest deployed to production? If the mode is head, can he first push a malicious commit and then trick a maintainer into making a signed empty commit on top of it?

With the token alone, the commits he pushes cannot be signed with a trusted key, so Argo CD rejects the sync (ComparisonError). But in head mode only HEAD is verified: if a maintainer makes a signed commit on top of the malicious commit (for example, merging or rebasing without careful review), HEAD is signed and the malicious change is deployed along with it. strict mode checks all ancestors, so the unsigned malicious commit causes failure unless someone makes a seal commit. A seal commit means “I have reviewed and vouch for this,” so it must accompany a real review process. Conclusion: production should use strict mode, branch protection, and mandatory review.

Verified teaching video

No Argo CD GPG signature verification / Source Integrity teaching video verified through YouTube oEmbed was found (this feature was revised only in 3.5, and existing videos are mostly based on the old signatureKeys). Please use the storyboard below and the official documentation.

Official documentation

Video storyboard script (about 90 seconds)

This courseware cannot generate a video or MP3 directly; the storyboard and narration are provided for a video tool to produce.

Shot 1 · 0–20s
Visual: an attacker pushes a commit using a stolen token, Argo CD accepts it, and the production cluster turns red.
Narration: without signature verification, being able to push means being able to deploy.
Shot 2 · 20–45s
Visual: a sourceIntegrity policy appears in the AppProject; repo-server runs verify-commit on HEAD, and the unsigned commit is blocked at the door.
Narration: starting with version 3.5, signature policies are configured per repository in the project. When verification fails, Argo CD does not generate manifests, and the cluster stays as it is.
Shot 3 · 45–70s
Visual: commit history; the strict-mode check arrow traces back from HEAD and stops at a seal commit marked with a stamp.
Narration: strict mode checks the entire history; the seal commit is the maintainer's signed vouching, and the walk-back stops there.
Shot 4 · 70–90s
Visual: supply-chain links light up in order: signed commits, pinned versions, image signing, admission policy.
Narration: commit signing is only one link in the supply chain. Images also need signing and admission checks, and dependencies need pinned versions.
or score ≥ 70% in the quiz

Module 8 · Security review and common vulnerabilities

50:00 – 60:00 · Combine all the measures in this lesson into one actionable review checklist, and establish a response process of “advisory → assessment → escalation”
10 minSupported branches 3.4 / 3.5 / 3.63.3 reached EOL on 2026-11-03★★★★★
Learning objectives
  • Review an Argo CD instance across six dimensions (identity and access, network and transport, rendering and repositories, secrets, supply chain, operations and response) and give a verification command for each item.
  • Read a GitHub Security Advisory: affected scope, fixed version, exploit prerequisites, CVSS, temporary mitigations. Know that Argo CD only provides patches for the latest three minor versions.
  • Become familiar with representative 2025–2026 advisories: project tokens reading repository credentials, ServerSideDiff leaking Secrets, link annotation XSS, render-tool command execution and file reads, deletion hooks bypassing AppProject, SSH proxy command injection.
  • Use the interactive troubleshooting tree to locate the security and secrets issues covered in this lesson.
Prerequisites: Modules 1–7. Importance:★★★★★

What: review checklist

DimensionCheck itemHow to verifyLesson module
Identity and accessSSO integration, admin disabled, initial password Secret deletedargocd account list; kubectl -n argocd get secret argocd-initial-admin-secret should return NotFoundM1, Lesson 4
policy.default empty or read-only; no one holds unnecessary role:adminargocd admin settings rbac can; review policy.csvM1
create and update permissions for repository, cluster, and GPG keys are given only to the platform group; restrict who can delete Applicationssearch repositories, create,applications, deleteM2, M7
Network and transportNetworkPolicy exists and is enforced by the CNIcross-namespace nc test Redis and repo-server timeoutsM1
argocd-server uses trusted certificates; inter-component TLS verification (optional mTLS)openssl s_client; check --repo-server-ca-cert-pathM1
Rendering and repositoriesunused tools are disabled (such as jsonnet.enable: "false"), Kustomize does not enable unneeded --enable-helm / --enable-execkubectl -n argocd get cm argocd-cm -o yamlM1, M6
credentials use a GitHub App or Deploy Key, no personal PAT; do not use insecure to skip verificationargocd repo list,argocd repocreds listM2
AppProject limits sourceRepos, destinations, and resource allowlists; controller ClusterRole has been tightenedargocd proj get; kubectl get clusterrole argocd-application-controller -o yamlM1, Lesson 4
Secretsno kind: Secret in Git (except Sealed / External); CI scanninggitleaks git; AppProject denylistM3
Sealed Secrets private key is backed up and recovery has been rehearsed; the ESO Store is managed by the platform and restricted to namespaces; plugins that decrypt at render time have an explicit risk-acceptance recordbackup time ≥ most recent renewal; kubectl get clustersecretstore -o yamlM4–M6
Supply chainSource Integrity (production strict); chart and image versions pinned; image signing admissionargocd proj get -o yaml; Kyverno policiesM7
Operations and responserun the latest patches on supported branches; subscribe to security advisories; Renovate tracks chartsargocd version check against advisoriesM8
Audit: Kubernetes Events and API logs (security fields) sent to SIEM; IP recorded by the front proxysync and login events searchable in SIEMM1, M8

Why: Argo CD is a high-value target

It combines an externally exposed web entry point, write credentials for multiple clusters, and a renderer that executes untrusted input. In the first half of 2026 and in October there were several advisories rated CVSS 9.6–9.9, many of which require only low privileges (for example, a read-only Application get). The purpose of a review is not to “pass once,” but to ensure each layer has an owner, a verification method, and the ability to quickly judge impact when an advisory is published.

How: how to read security advisories

  1. Affected and fixed versions: Argo CD only issues patches for the latest three minor versions (as of this lesson, 3.4, 3.5, 3.6); older branches receive no patches even if affected, which is itself a risk.
  2. Exploit prerequisites: what permissions are needed? Git write access, Application get, repository creation rights, or does an option need to be enabled (for example --enable-helm)?
  3. Impact: read Secrets or repository credentials, execute commands in repo-server, bypass AppProject, XSS escalation?
  4. Mitigation: temporary measures in the advisory (disable a tool, tighten a permission) and what they would break.
  5. Action: set the deadline based on CVSS and exploit prerequisites (for example, Critical and exploitable with low privileges: upgrade within 24–72 hours).

Representative advisories (verified on 2026-11-17; GitHub Security Advisories is authoritative)

AdvisorySeverityIssuePrerequisiteFixed version
GHSA-786q-9hcg-v9ff (CVE-2025-55190, 2025-09)Critical 9.9A project-level API token can use /api/v1/projects/{project}/detailed to read repository credentialstoken with project get permission3.1.2, 3.0.14, 2.14.16, 2.13.9
GHSA-3v3m-wc6v-x4x3 (CVE-2026-42880, 2026-05)Critical 9.6ServerSideDiff endpoint returns unmasked Secret dataRead-only by default; combined with IncludeMutationWebhook=true and similar conditions.3.3.9, 3.2.11
GHSA-rg3g-4rw9-gqrp (CVE-2026-45737, 2026-05)ModerateIncomplete fix for the item above: leaks through last-applied-configuration annotationsusers who can view the diff3.2.12, 3.3.10, 3.4.2
GHSA-h98r-wv3h-fr38 (CVE-2026-45738, 2026-05)High 7.3link.argocd.argoproj.io/* links in javascript: annotations cause stored XSS; developer → admin privilege escalationapplication write permission + luring a high-privilege user into clicking3.2.12, 3.3.10, 3.4.2
GHSA-9v9p-x54c-58gc (2026-10)Critical 9.9Kustomize remote ref is parsed as a git option, executing commands in repo-serverGit write permission, or Application get (manifestsWithFiles)3.3.15, 3.4.10, 3.5.4
GHSA-fw5c-w8rc-j7fx (2026-10)Critical 9.9When --enable-helm is enabled, Kustomize makes Helm load a downloader plugin from the repository, which executes commandssame as above, and --enable-helm3.3.15, 3.4.10, 3.5.4
GHSA-m3vr-7329-44ww (2026-10)Critical 9.9Jsonnet import reads arbitrary files on repo-serversame as above (directory-type applications)3.3.15, 3.4.10, 3.5.4; mitigation jsonnet.enable: "false"
GHSA-fmxq-cgp8-87wp (2026-10)Critical 9.9PreDelete / PostDelete hooks skip the AppProject checkGit write permission + deletion of an Application to trigger3.3.15, 3.4.10, 3.5.4
GHSA-j6cw-g6p4-7hch (2026-10)High 8.8SSH repository proxy settings inject ProxyCommand, executing commands in repo-servercan create or update repositories or credential templates3.3.15, 3.4.10, 3.5.4

Some CVE numbers in the 2026-10 batch appear on the advisory pages as longer sequence numbers; this lesson uses GHSA IDs as the primary index. The v3.6.0 general release (2026-11-03) came after these fixes and already includes them.

When: review frequency

  • Do a full review once before go-live; re-review quarterly, and again after each major-version upgrade.
  • On the day each security advisory is published, make an impact assessment (this need not wait for the quarterly review).
  • Do an incremental review when a team onboards (new AppProject, new credentials, new plugin).
Common misconceptions① “We're on the internal network, so Critical can wait for the quarterly maintenance window”: exploiters in the 2026-10 batch need only read-only permission or Git write access, and an insider or stolen developer account is enough. ② “The latest chart version means the latest Argo CD”: the chart's appVersion is the Argo CD version, which can be overridden by the global.image.tag value in values, so use the argocd version server version as authoritative. ③ “AppProject is the security boundary, so teams can be given loose Git permissions”: AppProject is an internal Argo CD check, and bypasses have already happened; the backstop is the controller's Kubernetes RBAC and Git-side branch protection.

Flowchart: security advisory response

Advisory publishedGHSA notification Version affected?argocd version Prerequisites met?Feature enabled / permissionwho has it Temporary mitigationDisable tool / tighten RBAC Upgrade to patched versionchart → GitOps release Post-incident review and forensicsAudit logs, credential rotationRemove mitigations
Figure 8-1: first determine “is it affected, are the prerequisites met”; mitigation and upgrade run in parallel, and the review comes last (including rotating any credentials that may have leaked)

Layer diagram: six review dimensions and owners

Identity and accessPlatform team + identity team Network and transportPlatform team + network team Rendering and repositoriesPlatform team SecretsPlatform team (store) + application teams (references) Supply chainSecurity team + repository maintainers Operations and responsePlatform on-call + security operations Backstop: controller's Kubernetes RBAC · admission policies on target clusters · Git branch protection
Figure 8-2: each dimension needs a clearly assigned owner; the three items at the bottom are the backstop when Argo CD's own checks fail

Interactive tool: version × security advisory checker + review scoring

Enter your Argo CD server version (argocd version in the argocd-server line), tick the features enabled in your environment, and the checker judges each item against the fixed versions in the table above: “is it affected, are the prerequisites met, what should be done.” The review checklist below can be ticked and scored (saved in this browser).

Argo CD version:
—
Supported branches: 3.4 / 3.5 / 3.6 (3.3 reached EOL on 2026-11-03)
$ argocd version --short

Review checklist (12 items)

Common review commands

CommandCheck
argocd version --shortWhether the server version is the latest patch on a supported branch
kubectl -n argocd get cm argocd-cm -o yamladmin.enabled,jsonnet.enable,kustomize.buildOptions, links and UI settings
kubectl -n argocd get cm argocd-rbac-cm -o yamlpolicy.default,policy.csv,scopes
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type -L argocd.argoproj.io/secret-typelist of repository / template / cluster credentials
argocd proj list -o yaml | grep -E 'sourceRepos|sourceIntegrity|clusterResourceWhitelist' -A3project boundaries and signature policies
kubectl -n argocd logs deploy/argocd-server | grep '"security"'security logs with security-level fields
kubectl get events -A --field-selector involvedObject.kind=Applicationwho initiated syncs and when

One-click review script (read-only, outputs PASS / WARN)

#!/usr/bin/env bash
set -uo pipefail
ns=argocd
pass(){ printf 'PASS  %s\n' "$1"; }; warn(){ printf 'WARN  %s\n' "$1"; }
ver=$(kubectl -n $ns get deploy argocd-server -o jsonpath='{.spec.template.spec.containers[0].image}')
echo "server image: $ver"
[ "$(kubectl -n $ns get cm argocd-cm -o jsonpath='{.data.admin\.enabled}')" = "false" ] && pass "admin disabled" || warn "admin enabled"
kubectl -n $ns get secret argocd-initial-admin-secret >/dev/null 2>&1 && warn "initial admin secret still exists" || pass "initial admin secret removed"
[ "$(kubectl -n $ns get networkpolicy --no-headers 2>/dev/null | wc -l)" -ge 5 ] && pass "network policies present" || warn "network policies missing"
[ -z "$(kubectl -n $ns get cm argocd-rbac-cm -o jsonpath='{.data.policy\.default}')" ] && pass "policy.default empty" || warn "policy.default set"
kubectl -n $ns get cm argocd-cm -o jsonpath='{.data.kustomize\.buildOptions}' | grep -q -- '--enable-exec' && warn "kustomize --enable-exec" || pass "no kustomize exec plugins"
kubectl -n $ns get secret -l argocd.argoproj.io/secret-type -o jsonpath='{range .items[*]}{.data.insecure}{"\n"}{end}' | grep -q . && warn "repo with insecure flag" || pass "no insecure repos"
kubectl get clusterrole argocd-application-controller -o jsonpath='{.rules[0].verbs}' | grep -q '\*' && warn "controller has * verbs" || pass "controller role narrowed"
for p in $(kubectl -n $ns get appproj -o name); do
  kubectl -n $ns get $p -o jsonpath='{.spec.sourceIntegrity}' | grep -q gpg && pass "$p source integrity" || warn "$p no source integrity"
done
server image: quay.io/argoproj/argocd:v3.6.1
PASS  admin disabled
PASS  initial admin secret removed
PASS  network policies present
PASS  policy.default empty
PASS  no kustomize exec plugins
PASS  no insecure repos
WARN  controller has * verbs
WARN  appproject.argoproj.io/default no source integrity
WARN  appproject.argoproj.io/platform no source integrity
WARN  appproject.argoproj.io/team-a no source integrity
WARN  appproject.argoproj.io/team-b no source integrity

How to use: Write WARN items into the review report with an “accept / fix / deadline” decision. Common errors: The script can only check that configuration exists, not that it takes effect (for example, whether NetworkPolicy is enforced by the CNI); for critical items, combine it with the connectivity tests from M1.

Lab 8: review this lesson's environment and simulate an advisory response (about 8 minutes)

Run the review script: save the script from the Commands tab as ~/gitops-lab/tools/review-argocd.sh and run it, recording the WARN items.
mkdir -p ~/gitops-lab/tools && chmod +x ~/gitops-lab/tools/review-argocd.sh
~/gitops-lab/tools/review-argocd.sh | tee /tmp/review-$(date +%F).txt | grep -c WARN
Simulated advisory: “Jsonnet arbitrary file read”. Assume you are still running the affected version; first apply the temporary mitigation and verify:
configs:
  cm:
    jsonnet.enable: "false"
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd get cm argocd-cm -o jsonpath='{.data.jsonnet\.enable}'; echo
argocd app list -o name | while read a; do argocd app get "$a" -o json | jq -r '"\(.metadata.name) \(.status.sourceType)"'; done | grep -i jsonnet || echo "no jsonnet apps"
false
no jsonnet apps

Inventory dependencies before mitigating: if any application depends on Jsonnet, disabling it will render those applications empty, and combined with prune it may delete resources.

Check who can exploit it manifestsWithFiles (only Application get is required):
kubectl -n argocd get cm argocd-rbac-cm -o jsonpath='{.data.policy\.csv}' | grep -E 'applications, (get|\*)'
p, role:team-a-dev, applications, get, team-a/*, allow
g, alice, role:admin

This shows that all developers on team-a meet the exploit prerequisites. This is why “upgrading” rather than “tightening permissions” is the root fix.

Upgrade path rehearsal: pin the chart version in values and submit the upgrade through GitOps (Lesson 7 covers Argo CD self-management):
helm search repo argo/argo-cd --versions | head -3
helm -n argocd history argocd | tail -2
NAME          CHART VERSION  APP VERSION  DESCRIPTION
argo/argo-cd  10.18.0        v3.6.1       A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool...
argo/argo-cd  10.17.2        v3.6.1       ...
Write the review conclusion: score the review checklist on the Animation tab, and commit the results together with /tmp/review-*.txt to docs/security-review-2026-11.md (the repository records only conclusions, never any secrets).

Case 1: the “no patch” risk on an EOL branch

Problem: A group's Argo CD is stuck on 2.x, and several Critical advisories in 2026-10 explicitly state that 2.x no longer receives patches. Approach: First apply all temporary mitigations (disable Jsonnet, remove --enable-helm, restrict repository creation and Application deletion permissions, and do not allow the controller to write RBAC), while planning the upgrade per the v2 → v3 breaking-change checklist from Lesson 1 (tracking method, RBAC log permissions, etc.). Limitations: Mitigations cannot fully cover everything (for example, for the Kustomize remote ref issue, “there is no complete mitigation besides upgrading”).

Case 2: handling the ServerSideDiff secret leak

Problem: When the 2026-05 ServerSideDiff advisory was published, the team was running the affected 3.3.x and heavily used Server-Side Diff. Approach: Upgrade to 3.3.10 (which also covers the later incomplete fix); check API logs for ServerSideDiff callers; rotate Secrets that could have been read during the log window (especially ServiceAccount tokens and TLS private keys). Limitations: Argo CD does not record client IPs (record them at the front proxy); forensics requires combining with proxy logs.

Case 3: review as an onboarding gate

Problem: A new team wants to join the shared Argo CD and use a custom CMP plugin. Approach: Onboarding review requirements: plugin images are built and signed by the platform; plugins must not hold keys that can decrypt production secrets (use ESO instead); generate must set -o pipefail; AppProject default denylist Secret. Limitations: The review adds onboarding time, so the platform should provide templates (ApplicationSet + pre-provisioned AppProject) to reduce the cost.

Interactive troubleshooting tree: security and secrets issues

Choose step by step from the symptom; leaf nodes give diagnostic commands and fixes.

Supplement: quick reference for common errors

After upgrading the chart, NetworkPolicy prevents custom components from connecting to repo-server / Redis

Cause: Starting from chart 10.0, NetworkPolicy is created by default, allowing only Argo CD's own components.

kubectl -n argocd get networkpolicy argocd-redis -o yaml | sed -n '/ingress:/,/policyTypes/p'

Fix: Write additional NetworkPolicy allow rules for custom components instead of disabling global.networkPolicy.create.

argocd-server logs many "security":2 access denied entries

Cause: Possibly misconfigured automation (expired tokens, insufficient permissions), or probing.

kubectl -n argocd logs deploy/argocd-server --since=1h | grep '"security":2' | head

Fix: Aggregate by user or token; after confirming the source, fix the configuration or revoke the project token (delete the JWT ID); check the source IP at the front proxy.

Command-line exercise
1. One command that returns the image currently running for argocd-server (including the version).
kubectl -n argocd get deploy argocd-server -o jsonpath='{.spec.template.spec.containers[0].image}'; echo
2. Find all repository Secrets carrying the insecure label.
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=repository -o json \
  | jq -r '.items[] | select(.data.insecure != null) | .metadata.name'
Scenario analysis question
The Argo CD you're responsible for runs v3.4.9; on Friday night you receive the 2026-10 batch advisory (fixed in 3.4.10). In the environment, team-a has Application get permission, and the option --enable-helm is not enabled; there are two Jsonnet applications. Write out the actions for tonight and next Monday.

Tonight: confirm the affected versions (3.4.9 < 3.4.10). The prerequisites for the Kustomize remote ref (GHSA-9v9p) and the Jsonnet file read (GHSA-m3vr) are met (only Application get is needed); --enable-helm that one's prerequisite is not met; the deletion-hook bypass (GHSA-fmxq) requires Git write access plus deletion. The best action is to upgrade to 3.4.10 tonight (or go directly to 3.6.1, after assessing the minor-version change). If you must wait for a window, take mitigations first: the Jsonnet applications pause auto-sync, and then set jsonnet.enable: "false" (or accept the risk and strengthen monitoring), temporarily restrict Application get (only the upload path can be turned off), and restrict Application deletion permissions. Next Monday: complete the upgrade, revoke temporary mitigations, check which credentials repo-server can read and assess whether to rotate them, and review why patch response needed manual work (introduce Renovate and security advisory subscriptions).

Verified teaching video

No Argo CD security review / vulnerability response video verified through YouTube oEmbed was found. CNCF threat-modeling talks and the ArgoCon multi-tenant security session schedule pages were found, but video IDs could not be verified. You can review the Module 1 introductory video (verified).

Official resources

Video storyboard script (about 90 seconds)

This courseware cannot generate a video or MP3 directly; the storyboard and narration are provided for a video tool to produce.

Shot 1 · 0–20s
Visual: cards for the six review dimensions flip open one by one, each with a verification command written on it.
Narration: a security review is not a one-time spreadsheet; every item needs an owner and a verification method.
Shot 2 · 20–50s
Visual: a security advisory is split into four columns: affected versions, exploit prerequisites, impact, mitigation.
Narration: when reading an advisory, check two things first: whether my version is affected, and whether the prerequisites hold in my environment.
Shot 3 · 50–75s
Visual: a version timeline; the 3.3 branch is marked EOL, with arrows pointing to 3.4, 3.5, and 3.6.
Narration: Argo CD only provides patches for the latest three minor versions. Staying on an old branch is itself a risk.
Shot 4 · 75–90s
Visual: the mitigation and upgrade tracks run in parallel and converge at “post-incident review and credential rotation.”
Narration: run mitigation and upgrade in parallel, don't forget the review at the end, and rotate any credentials that may already have leaked.
or score ≥ 70% in the quiz

Command cheat sheet

Common commands for this lesson's hardening, credentials, three secret-management options, and signature verification
Argo CD v3.6.1kubeseal 0.41.2 · ESO 2.15.0 · sops 3.13.3

Hardening

argocd version --short
argocd account list
kubectl -n argocd patch cm argocd-cm --type merge \
  -p '{"data":{"admin.enabled":"false"}}'
kubectl -n argocd delete secret argocd-initial-admin-secret
kubectl -n argocd get networkpolicy
argocd admin settings rbac can ROLE ACTION RES OBJ \
  --policy-file policy.csv

Repository credentials

argocd repocreds add https://github.com/acme \
  --github-app-id ID --github-app-private-key-path k.pem
argocd repo add git@github.com:acme/x.git \
  --ssh-private-key-path ~/.ssh/deploy_key
ssh-keyscan github.com | argocd cert add-ssh --batch
argocd cert add-tls git.corp.local --from ca.pem
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type

Sealed Secrets

kubeseal --fetch-cert > pub-cert.pem
kubectl create secret generic db --from-literal=k=v \
  -n NS --dry-run=client -o yaml \
  | kubeseal --cert pub-cert.pem --format yaml > db-sealed.yaml
echo -n v | kubeseal --raw --namespace NS --name db
kubeseal --validate < db-sealed.yaml
kubeseal --re-encrypt < db-sealed.yaml > new.yaml
kubectl get secret -n kube-system \
  -l sealedsecrets.bitnami.com/sealed-secrets-key -o yaml > keys.bak

External Secrets

kubectl get clustersecretstore,secretstore -A
kubectl get es -A
kubectl describe es NAME -n NS
kubectl annotate es NAME -n NS force-sync=$(date +%s) --overwrite
kubectl explain externalsecret.spec.target

SOPS / age

age-keygen -o ~/.config/sops/age/keys.txt
sops -e -i secret.enc.yaml          # per .sops.yaml rules
sops secret.enc.yaml                # edit
sops -d --extract '["data"]["k"]' secret.enc.yaml
sops updatekeys -y secret.enc.yaml
sops rotate -i secret.enc.yaml

Signature verification

git config commit.gpgsign true
git log -5 --format='%h %G? %GK %s'
argocd gpg add --from pub.asc
argocd gpg list
git commit --allow-empty --signoff --gpg-sign \
  --trailer="Argocd-gpg-seal: reason" -m "seal"

CMP plugin debugging

kubectl -n argocd get pod -l app.kubernetes.io/component=repo-server \
  -o jsonpath='{.items[0].spec.containers[*].name}'
kubectl -n argocd logs deploy/argocd-repo-server -c cmp-sops
argocd app get APP --hard-refresh
argocd app manifests APP --source git

Review

kubectl -n argocd get cm argocd-cm -o yaml | grep -E \
  'admin.enabled|jsonnet.enable|buildOptions'
kubectl get clusterrole argocd-application-controller -o yaml
argocd proj get team-a -o yaml | grep -A8 sourceIntegrity
gitleaks git . --max-decode-depth 2

Quick troubleshooting table

SymptomMost likely causeFirst command
authentication required: Repository not foundCredential mismatch: a repository Secret carrying wrong credentials shadows the templateargocd repocreds list
knownhosts: key is unknownMissing SSH host public keyssh-keyscan HOST | argocd cert add-ssh --batch
no key could decrypt secretRenamed / changed namespace / public key from a different clusterkubeseal --validate
ExternalSecret SecretSyncedErrorWrong key name or the identity lacks permissionkubectl describe es
0 successful groups required, got 0sops cannot find the age private keyecho $SOPS_AGE_KEY_FILE (in the sidecar)
... is not signed, but a signature is requiredUnsigned commit / unsigned history under strictgit log --format='%h %G? %GK'
Can connect to Redis across namespacesCNI does not enforce NetworkPolicykubectl run … nc -zv argocd-redis.argocd 6379

Recommended configuration snippet

global:
  networkPolicy:
    create: true                 # chart 10.0+ default; keep enabled
configs:
  cm:
    admin.enabled: "false"
    jsonnet.enable: "false"      # when not using Jsonnet
    resource.sensitive.mask.annotations: "api-key"
  rbac:
    policy.default: ""
  params:
    server.disable.swagger.ui: "true"
controller:
  clusterRoleRules:
    enabled: true                # see Module 1: global read-only + limited write

Integrated lab + graduation quiz

Implement a complete security baseline of “hardening + secrets + signature verification” for team-a's payment service
About 40 minuteskind lab · zero cost
Scenario team-a is going live with the payments service (simulated with podinfo), which needs three secrets: a database password (from the “secrets store”, via ESO), a third-party webhook signing key (team-managed, via Sealed Secrets), and private GitOps repository access credentials (platform-managed, generated by ESO repo-creds). The security team requires: admin disabled, Redis isolated, team-a unable to deploy directly Secret, and production revisions must be signed.
Hardening baseline: upgrade Argo CD using the “security baseline” values from the cheat sheet, run the M1 connectivity tests and the M8 review script, and record the WARN items.
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
~/gitops-lab/tools/review-argocd.sh
Project boundary: in team-a's AppProject, add namespaceResourceBlacklist: [{group: "", kind: Secret}], keep in the allowlist SealedSecret and ExternalSecret; add to the target namespace payments.
kubectl create ns payments
kubectl apply -f ~/gitops-lab/argocd/projects/team-a.yaml
argocd proj get team-a | grep -i -E 'denied|allowed'
Database password (ESO): in secret-source create payments-db, extend k8s-source ClusterSecretStore's conditions to include payments, in apps/payments/ write an ExternalSecret (generated from template DATABASE_URL).
kubectl -n secret-source create secret generic payments-db --from-literal=password=pay-db-v1
kubectl -n payments get es,secret
Webhook key (Sealed Secrets, strict):
kubectl create secret generic webhook -n payments --from-literal=signing-key=whsec_demo_123 --dry-run=client -o yaml \
  | kubeseal --cert ~/gitops-lab/platform/sealed-secrets/pub-cert.pem --format yaml > ~/gitops-lab/apps/payments/webhook-sealed.yaml
Workload and Application: podinfo Deployment (container podinfod, port 9898) via envFrom reads both Secrets; create Application payments (project team-a, path apps/payments, automated sync). To verify, directly placing a kind: Secret into that directory will be rejected by the AppProject.
argocd app wait payments --health --timeout 180
kubectl -n payments exec deploy/payments -c podinfod -- env | grep -E 'DATABASE_URL|signing' | sed 's/=.*/=***/'
Repository credentials via ESO: in secret-source store the PAT (or GitHub App private key), and the platform's ExternalSecret generates, in the argocd namespace, a Secret carrying the argocd.argoproj.io/secret-type: repo-creds label (target.template.metadata.labels), then delete the template created manually in M2 and confirm the repository still connects successfully.
Signature gate: enable for team-a sourceIntegrity (head), push an unsigned commit to confirm it is rejected, then restore with a seal commit.
Rotation drill: change secret-source/payments-db, force-sync, then run kubectl -n payments rollout restart deploy/payments, confirm the new value takes effect; the entire process involves no Git commits.
Acceptance checklist

Open-ended self-test (6 questions)

1. Why does the official guidance recommend “populating secrets on the target cluster”? Answer from both the risk and user-experience perspectives.

Risk: Argo CD never touches secrets; there is no plaintext in repo-server, Redis, or the API, so even if Argo CD is compromised, the secret values cannot be obtained. User experience: secret updates are decoupled from application sync, so new secrets are not accidentally shipped in an unrelated release, and rotation does not require a Git commit.

2. Can Sealed Secrets' 30-day key renewal replace password rotation?

No. Renewal only adds a new key for new encryption; old keys are still kept for decryption, so old ciphertext can still be opened if the old private key leaks. You must rotate the secret values themselves regularly, and rotate immediately upon suspected leakage.

3. Design a multi-tenant ESO scheme that prevents team-b from reading team-a's secrets.

One secrets store per team (or identities authorized by prefix) and one ClusterSecretStore,conditions.namespaces containing only that team's namespaces; the team's AppProject allows only ExternalSecret, not SecretStore / ClusterSecretStore; the platform uses an ApplicationSet to generate Stores; identities on the secrets-store side get minimal authorization and auditing enabled.

4. If the team insists on using SOPS CMP, what compensating controls would you require?

Argo CD on an independent cluster or enforced NetworkPolicy (Redis, repo-server); the age private key is mounted only into the sidecar, comes from the secrets store, and can be rotated; plugin images are version-pinned and signed; generate uses set -euo pipefail; set key Secrets to Prune=false; upgrade Argo CD promptly; written risk acceptance and a migration plan.

5. What is each of head and strict mode suited for? What is the risk of a seal commit?

head only verifies the target commit, suitable for getting started and non-production; strict verifies the entire ancestor chain, suitable for production. A seal commit vouches for all earlier unsigned commits; without a real review, it effectively “launders” malicious commits, so it requires an approval record and execution by a small number of trusted maintainers.

6. How could a read-only user exploit the 2026-10 rendering vulnerabilities? How can such risks be reduced architecturally?

Through the manifestsWithFiles endpoint, upload a malicious kustomization / jsonnet to an existing Application (requires only Application get), executing commands or reading files in repo-server. Architecturally: upgrade promptly; disable unneeded tools; repo-server mounts no high-value keys (it does not decrypt secrets); NetworkPolicy restricts repo-server egress; tighten controller RBAC; use short-lived tokens (GitHub App) for repository credentials to limit the impact of leaks.

Sources and version notes

All versions and behaviors were verified against official sources on 2026-11-17
TopicVerified conclusionSources (accessed 2026-11-17)
Argo CD versionv3.6.1 (2026-11-04) is the latest stable release; v3.5.7 and v3.4.13 were released at the same time; v3.3.19 is the last 3.3 release, and 3.3 reached EOL on 2026-11-03argo-cd releases
argo-cd Helm chart10.18.0 (appVersion v3.6.1); from 10.0.0 onward global.networkPolicy.create defaults to true; configs.cmp,repoServer.extraContainers,redisSecretInitargo-helm charts/argo-cd (README, values.yaml)
Security model, TLSJWT authentication, admin token 24h, minimum TLS 1.2, repo-server defaults to a self-signed certificate that the caller does not verify,--repo-server-ca-cert-path recommended,--repo-server-strict-tls deprecated, Swagger UI can be disabledSecurity · TLS
Repository credentialsrepository / repo-creds labels, longest-prefix matching,project field, GitHub App fields, installation ID can be auto-discovered; v3 removes legacy repository keys from argocd-cm; repository-write / repo-write-credsPrivate Repositories · Declarative Setup · Source Hydrator
Secret management recommendationsOfficial guidance strongly recommends populating on the target cluster; strongly warns against render-time injection (plaintext cache in Redis, incompatible with the rendered-manifests model)Secret Management
Sealed Secretscontroller v0.41.2, chart 2.22.0 (repo https://bitnami.github.io/sealed-secrets); AES-256-GCM + RSA-OAEP SHA-256, 4096-bit keys, 30-day renewal, 10-year certificates, scope, backup / restore,fullnameOverride tip; Argo CD has a built-in SealedSecret health checksealed-secrets README / crypto.md · resource_customizations
External Secrets Operatorv2.15.0 (2026-11-10), chart 2.15.0 (https://charts.external-secrets.io); v1.0.0 (2025-11), v2.0.0 (2026-02, removed Alibaba / Device42); API external-secrets.io/v1; usage of fake and kubernetes providersESO releases · ESO documentation
SOPS / age / KSOPSSOPS v3.13.3 (2026-07-23), age v1.3.2 (2026-08-29), KSOPS v4.5.1 (2026-04-13); KSOPS requires --enable-alpha-plugins --enable-execsops · age · KSOPS
Config Management Pluginsidecar entry point /var/run/argocd/argocd-cmp-server, UID 999,/home/argocd/cmp-server/config/plugin.yaml, separate /tmp, CRD removed in 2.8,ARGOCD_EXEC_TIMEOUT default 90s, pipefail tipConfig Management Plugins
Signature verificationsince 3.5 spec.sourceIntegrity (none / head / strict, seal commit, migration); signatureKeys deprecated and cannot be used together; the GPG verification page notes it will be removed in the next major version; GitHub web-flow current key B5690EEEBB952194 (old 4AEE18F83AFDEB23 expired on 2024-01-16)Source Integrity · Git GnuPG · github.com/web-flow.gpg
Security advisoriessee the Module 8 table (GHSA-786q, 3v3m, rg3g, h98r, 9v9p, fw5c, m3vr, fmxq, j6cw)argo-cd Security Advisories
Other toolskind v0.33.0 (built-in kube-network-policies since v0.24); gitleaks v8.30.1; podinfo 6.17.0kind · gitleaks · podinfo

Video verification notes

Only videos whose title and channel were verified via YouTube oEmbed (https://www.youtube.com/oembed?url=…&format=json):

SOPS / CMP, Source Integrity, Argo CD hardening, and vulnerability response: no verifiable video was found; storyboard scripts are provided in the corresponding modules.

Narration notes

The “Audio” tab uses the browser's built-in Web Speech API (zh-CN reads the narration, en-US reads the terms). This courseware cannot embed an MP3; the narration script can be given directly to a TTS tool or recorded. Numbers in the narration follow Chinese reading conventions.

Known limitations

  • The authoring environment did not run a kind cluster,all outputs marked “Expected output (example)” are examples compiled from official documentation and source code; hashes, IPs, timestamps, ciphertext, and some message wording will differ from actual output (especially the ComparisonError text for failed signature verification, ESO status messages, and Redis cache key names and environment variables).
  • Some CVE numbers for the 2026-10 security advisories appear on the advisory pages as unusual long sequence numbers; this lesson uses GHSA IDs as authoritative. Advisory content follows the latest version on the GitHub page.
  • The kind default CNI's NetworkPolicy support is based on the kind v0.24 release notes (kube-network-policies); for other environments, rely on actual connectivity tests.
  • The sample rules for tightening the controller ClusterRole only illustrate the approach. Production needs to adjust them to the resource types actually deployed, and plan the deployment channel for platform components separately.
  • The CMP example downloads the sops binary in an initContainer for demonstration; production should use pre-built tools and plugin images with verified checksums and signatures.
  • The Azure Key Vault and AWS Secrets Manager configuration in Module 5 has not been run in a real cloud environment; for creating identities and authorizations, refer to the AKS course and each cloud's official documentation.