/security-tooling-skills:sealed-secrets-and-external-secrets-operatorfrom security-tooling-skills
Implements two GitOps-friendly Kubernetes secrets patterns: Bitnami Sealed Secrets (client-side encryption via kubeseal) and External Secrets Operator (sync from Vault, AWS, Azure into native Secrets).
Ships in security-tooling-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
GitOps workflows (Argo CD, Flux) want every cluster resource, including
secret-bearing ones, declared in git — but a native Kubernetes Secret
is only base64-encoded, not encrypted, so committing one directly is
equivalent to committing plaintext. Two Kubernetes-native controller
patterns solve this from opposite directions. Bitnami Sealed
Secrets lets you encrypt a secret client-side into a SealedSecret
custom resource that is safe to commit to git in plaintext-ciphertext
form; only the in-cluster controller (holding the matching private key)
can decrypt it back into a real Secret, so the encrypted manifest is
useless to anyone without cluster access. External Secrets Operator
(ESO) inverts the flow entirely: nothing secret-bearing is ever
committed to git at all — a lightweight ExternalSecret resource
declares which secret to fetch from an external system (Vault, AWS
Secrets Manager, Azure Key Vault, GCP Secret Manager, and others), and
the operator continuously syncs the real value from there into a native
Secret object at runtime. Both are Kubernetes-native, CRD-driven, and
GitOps-compatible; choosing between them (or using both) depends on
whether the org already has a centralized secrets manager to sync from
and whether the encrypted-blob-in-git model or the no-secret-in-git
model fits the team's operating model better.
Secret to a GitOps repo
without exposing its plaintext value, and asks specifically about
kubeseal or the Sealed Secrets controller.Secret objects, and asks about
External Secrets Operator, SecretStore, or ExternalSecret.SealedSecret that won't decrypt, or an
ExternalSecret stuck in a non-SecretSynced state.SealedSecret/ExternalSecret, SecretStore,
ClusterSecretStore) — both projects ship as Helm charts.kubeseal CLI (must match the installed
controller's major version — kubeseal and the controller are
versioned together and a mismatch can cause decryption/encryption
incompatibilities) and cluster access sufficient to fetch the
controller's public certificate for offline encryption.>= 0.9 for stable
ClusterSecretStore multi-tenant behavior; a backing secrets manager
already populated with the real secret values (ESO syncs from
Vault/AWS/Azure/GCP, it does not replace them), and a workload
identity mechanism for the operator to authenticate to that backend —
see secrets-management
for the underlying secrets-manager setup and the general
"why not hardcode secrets" rationale this skill assumes rather than
restates.SecretStores: workload identity federation already
configured (AWS IRSA / Azure Workload Identity / GCP Workload
Identity) so ESO authenticates without a long-lived static credential
— see
cloud-iam-hardening
for the federation setup this depends on.SealedSecret/ExternalSecret manifests to a reconciled repo, though
neither tool requires GitOps specifically — both work with plain
kubectl apply too.Install the controller (Helm):
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
helm install sealed-secrets-controller sealed-secrets/sealed-secrets \
--namespace kube-system
Fetch the controller's public certificate for offline encryption
(so kubeseal can encrypt without live cluster access, e.g. in a CI
job that doesn't have cluster credentials):
kubeseal --fetch-cert \
--controller-name sealed-secrets-controller \
--controller-namespace kube-system \
> pub-cert.pem
Create the plaintext Secret locally (never commit it), then
seal it with kubeseal:
kubectl create secret generic db-credentials \
--namespace payments \
--from-literal=username=svc-payments \
--from-literal=password='<GENERATED_PASSWORD>' \
--dry-run=client -o yaml > db-credentials.yaml
kubeseal --format yaml --cert pub-cert.pem \
< db-credentials.yaml > sealed-db-credentials.yaml
rm db-credentials.yaml # never commit the plaintext version
Resulting sealed-db-credentials.yaml (safe to commit — ciphertext only):
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: db-credentials
namespace: payments
spec:
encryptedData:
username: AgBy3i4OJSWK+PiTySYZ...(ciphertext, truncated)...
password: AgBy3i4OJSWK+PiTySYZ...(ciphertext, truncated)...
template:
metadata:
name: db-credentials
namespace: payments
type: Opaque
Commit and apply — the controller watches for SealedSecret
objects and decrypts them into a real Secret in the same namespace
automatically:
git add sealed-db-credentials.yaml
kubectl apply -f sealed-db-credentials.yaml
kubectl get secret db-credentials -n payments # controller-created, decrypted
Scope encryption to a namespace/name by default — Sealed
Secrets' default scope binds ciphertext to the target namespace and
secret name, so the same ciphertext can't be copy-pasted into a
different namespace and decrypted there. Use the broader
cluster-wide or namespace-wide scope annotations only when a
genuine cross-namespace reuse case exists, since it weakens this
binding:
kubeseal --scope namespace-wide --format yaml --cert pub-cert.pem \
< db-credentials.yaml > sealed-db-credentials.yaml
Back up the controller's private key immediately after install and store it in a proper secrets manager/offline vault — losing it makes every previously-sealed secret permanently undecryptable:
kubectl get secret -n kube-system \
-l sealedsecrets.bitnami.com/sealed-secrets-key \
-o yaml > sealed-secrets-key-backup.yaml
Restore onto a rebuilt cluster by applying this backed-up key before the controller starts, so it reuses the same keypair rather than generating a new one.
Install the operator (Helm):
helm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets external-secrets/external-secrets \
--namespace external-secrets --create-namespace
Define a ClusterSecretStore pointing at the backing secrets
manager, authenticating via workload identity rather than a static
credential wherever the backend supports it. AWS Secrets Manager
example (IRSA-based auth):
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
name: aws-secrets-manager
spec:
provider:
aws:
service: SecretsManager
region: us-east-1
auth:
jwt:
serviceAccountRef:
name: external-secrets-sa
namespace: external-secrets
Vault example (Kubernetes auth method):
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
name: vault-backend
spec:
provider:
vault:
server: "https://vault.example.internal:8200"
path: "myapp"
version: "v2"
auth:
kubernetes:
mountPath: "kubernetes"
role: "payments-prod"
serviceAccountRef:
name: external-secrets-sa
namespace: external-secrets
Azure Key Vault example (Workload Identity):
apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
name: azure-keyvault
spec:
provider:
azurekv:
authType: WorkloadIdentity
vaultUrl: "https://example-kv.vault.azure.net"
serviceAccountRef:
name: external-secrets-sa
namespace: external-secrets
Declare an ExternalSecret per workload, referencing the store
and the specific remote key(s) to sync:
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: db-credentials
namespace: payments
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: db-credentials # the native Secret ESO creates/updates
creationPolicy: Owner
data:
- secretKey: username
remoteRef:
key: prod/payments/db
property: username
- secretKey: password
remoteRef:
key: prod/payments/db
property: password
Use a namespaced SecretStore instead of ClusterSecretStore
when different teams/namespaces should have independently-scoped
credentials/paths to the backend, rather than one shared
cluster-wide store everyone implicitly trusts.
Verify sync status rather than assuming success — ESO surfaces
condition status on the ExternalSecret resource itself:
kubectl get externalsecret db-credentials -n payments
# NAME STORE REFRESH INTERVAL STATUS READY
# db-credentials aws-secrets-manager 1h SecretSynced True
Set refreshInterval deliberately — short intervals (e.g.
1m) keep the cluster copy closer to real-time but add load on the
backend API and its rate limits; longer intervals (e.g. 1h) are
usually sufficient since rotation events can also trigger an
immediate re-sync via ESO's push-based reconciliation on backend
change where the provider supports it.
Secret manifest used as kubeseal's
input, even momentarily, to a git-tracked working directory — generate
it to a local, gitignored path, seal it, then delete the plaintext
file immediately.SealedSecret permanently unrecoverable.SealedSecret ciphertext to namespace (default) rather than
cluster-wide unless there's a genuine cross-namespace need, and scope
SecretStore (namespaced) over ClusterSecretStore when different
teams should not implicitly share one trust boundary to the backend.creationPolicy: Owner on ExternalSecret targets so ESO
manages the full lifecycle of the generated Secret (including
cleanup when the ExternalSecret is deleted), and avoid manually
editing the generated Secret directly since ESO will overwrite it on
the next sync.Symptom: A cluster is rebuilt (or the Sealed Secrets controller is
reinstalled) and every previously-committed SealedSecret fails to
decrypt, with the controller logging a decryption error.
Fix: The controller generated a new keypair on install instead
of reusing the original one. Restore the backed-up controller private
key (step 6) before the new controller starts for the first time,
or if the key truly is lost, every affected secret must be re-sealed
from its original plaintext value against the new public certificate
— this is unrecoverable otherwise, which is why the backup step is
not optional.
Symptom: A SealedSecret that worked fine in namespace payments
fails to decrypt after being copy-pasted into namespace payments-staging
for a "quick" environment clone.
Fix: This is by design — default scope binds ciphertext to the
exact namespace and secret name it was sealed for, so it cannot be
reused elsewhere. Re-seal a fresh copy targeting the new namespace, or
use --scope namespace-wide/cluster-wide deliberately (with the
understanding that this weakens the binding) if genuine reuse across
namespaces is required.
Symptom: An ExternalSecret stays stuck showing SecretSynced: False and the target Secret never appears.
Fix: Check the ExternalSecret's status conditions and the ESO
controller logs first (kubectl describe externalsecret ... and
kubectl logs -n external-secrets deploy/external-secrets) — the
most common causes are the SecretStore/ClusterSecretStore
authentication failing (workload identity misconfigured, wrong
Vault role/policy) or the remoteRef.key/property not matching
what actually exists in the backend; verify the backend path/key
directly with the backend's own CLI before assuming ESO is broken.
Symptom: kubeseal on a developer's laptop produces a
SealedSecret that the in-cluster controller rejects or fails to
decrypt, despite following the same steps that worked last month.
Fix: A kubeseal CLI version mismatch against the controller's
version, or an outdated cached public certificate, is the most common
cause. Re-fetch the certificate (kubeseal --fetch-cert, step 2)
rather than reusing a locally cached one, and confirm the kubeseal
CLI major version matches the deployed controller's.
Symptom: A workload's Secret (created by ESO) doesn't reflect a
password that was just rotated in the backing secrets manager, and
the pod keeps failing auth with the old value.
Fix: Either refreshInterval hasn't elapsed yet (ESO polls, it
doesn't necessarily push instantly unless the provider supports
event-driven sync), or the application itself cached the old value
in memory/a connection pool and hasn't reloaded it — force an ESO
re-sync (annotate/touch the ExternalSecret to trigger reconciliation)
and separately confirm the application has a mechanism to pick up an
updated mounted/env secret (restart, file-watch reload, or short
connection-pool lifetime), mirroring the same rotation-propagation
problem general secrets-manager rotation has.
A team GitOps-manages a payments namespace with Argo CD. They use
Sealed Secrets for one bootstrap TLS secret needed before anything else
starts, and External Secrets Operator synced from AWS Secrets Manager
for all application runtime secrets.
Bootstrap secret, sealed once and committed:
kubectl create secret tls bootstrap-tls \
--namespace payments \
--cert=bootstrap.crt --key=bootstrap.key \
--dry-run=client -o yaml \
| kubeseal --format yaml --cert pub-cert.pem \
> sealed-bootstrap-tls.yaml
Application secrets, via ESO (ClusterSecretStore from step 8's AWS
example, plus this ExternalSecret):
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: payments-db-credentials
namespace: payments
spec:
refreshInterval: 30m
secretStoreRef:
name: aws-secrets-manager
kind: ClusterSecretStore
target:
name: payments-db-credentials
creationPolicy: Owner
data:
- secretKey: connection-string
remoteRef:
key: prod/payments/db
property: connection_string
Argo CD Application manifest points at the repo path containing both
sealed-bootstrap-tls.yaml (safe ciphertext) and the ExternalSecret/
ClusterSecretStore YAML (contains no secret material at all, just
references) — neither file, if leaked, exposes a usable credential:
the sealed one requires the cluster's private key to decrypt, and the
ExternalSecret one is just a pointer requiring the operator's live
workload-identity-authenticated access to AWS Secrets Manager.
Result: git log on this repo shows every secret-related change (a
SealedSecret update, or an ExternalSecret's remoteRef pointing at
a new key) without ever having exposed a plaintext credential in git
history, satisfying both the GitOps "everything in git" requirement and
the "no plaintext secrets in git" requirement simultaneously.
Secret committed alongside SealedSecret/ExternalSecret
manifests as a safety net.What SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/certificate-lifecycle-management-at-scaleGuides managing TLS/mTLS certificate lifecycle across many services and environments beyond a single Kubernetes cluster — enterprise CA integration (ACME private CA, Microsoft AD CS, cloud-managed private CAs), cross-service rotation automation, expiry monitoring/alerting, and CA hierarchy/trust-chain management for a mixed fleet of VMs, on-prem servers, and multiple clusters. Use when the user asks to "automate cert rotation across our whole fleet," "integrate with our enterprise CA," "why do we keep having certificate expiry outages," "design a CA hierarchy for the org," "track every certificate's expiry date across environments," or "cert-manager only covers our Kubernetes clusters, what about everything else." Distinct from cert-manager's Kubernetes-native scope — see `../../../kubernetes-platform/skills/cert-manager-tls-automation/SKILL.md`.
/enterprise-sso-and-idp-federation-configurationGuides configuring enterprise workforce single sign-on — SAML 2.0 and OIDC federation between an identity provider (Okta, Azure AD/Entra ID, Keycloak) and downstream applications, including metadata exchange, attribute/claim mapping, group-to-role provisioning (SCIM), and multi-IdP federation trust. Use when the user asks to "set up SAML SSO with Okta," "configure Azure AD/Entra ID as our OIDC provider," "stand up Keycloak as an internal IdP," "map IdP groups to application roles," "debug a SAML assertion that won't validate," or "federate a second IdP for an acquired company's users." Distinct from cloud-iam-hardening (workload/service IAM in a cloud provider) — this skill is about federating *human workforce* identity into applications for SSO.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin security-tooling-skillsOther plugins' skills for the same job