/security-tooling-skills:spiffe-spire-workload-identity-configurationfrom security-tooling-skills
Guides configuring SPIRE Server and Agent to issue cryptographic workload identities (SPIFFE IDs, X.509-SVIDs, JWT-SVIDs) for zero-trust service-to-service authentication.
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.
Zero-trust service-to-service authentication requires each workload to
prove what it is cryptographically, without relying on a shared
secret, a static API key, or network location (which IP/subnet it's on)
as a stand-in for identity — all three of those are exactly what an
attacker who's compromised one node can trivially forge or steal.
SPIFFE (Secure Production Identity Framework For Everyone) defines
the identity model: a URI-formatted SPIFFE ID
(spiffe://trust-domain/path) naming a workload, and two token formats
carrying it — an X.509-SVID (a short-lived X.509 certificate with
the SPIFFE ID in its URI SAN, used for mTLS) and a JWT-SVID (a
short-lived signed JWT, used where mTLS isn't practical, e.g. calling
through an intermediary that terminates TLS). SPIRE is the reference
implementation: a SPIRE Server acting as the trust domain's
certificate authority and identity registry, and a SPIRE Agent
running on every node that attests each local workload's identity
(verifying, via a selector like a Kubernetes service account or a Unix
process attribute, that a workload really is what it claims to be)
before handing it a short-lived SVID — with no long-lived credential
ever touching disk. This is a different layer than
enterprise-sso-and-idp-federation-configuration,
which federates human workforce identity into applications, and than
vault-operations-and-pki-engine-configuration,
which issues general-purpose secrets and certificates on request but has
no built-in concept of automatically attesting which specific workload
process is asking. This skill covers designing the trust domain and
SPIFFE ID structure, configuring node and workload attestation, SVID
rotation, and trust domain federation.
example.org or
prod.example.internal) — this is embedded in every SPIFFE ID issued
under it and is expensive to change later since it's baked into every
workload's identity and every relying party's trust configuration.upstream_authority plugin,
or a cloud provider's ACM Private CA) if the org wants SPIRE's issued
certificates chained to an already-trusted root.join_token attestor only for small/manual setups
(not recommended at scale — it doesn't cryptographically verify
anything about the node itself).Design the SPIFFE ID path structure deliberately before the first
registration entry is created — a consistent, hierarchical scheme
makes selector-to-identity intent legible and makes future policy
(e.g. "anything under /ns/payments/ may call the payments database")
expressible:
spiffe://prod.example.internal/ns/payments/sa/payments-service
spiffe://prod.example.internal/ns/payments/sa/payments-worker
spiffe://prod.example.internal/ns/checkout/sa/checkout-service
Mirror the identity path structure to something already meaningful in the environment (Kubernetes namespace/service account, or an environment/team/service hierarchy for VMs) rather than an arbitrary flat list of workload names.
Configure the SPIRE Server with its trust domain, datastore, and (optionally) an upstream authority instead of relying on SPIRE's self-signed root for a production trust domain that needs to chain to an already-trusted CA:
# server.conf
server {
trust_domain = "prod.example.internal"
data_dir = "/opt/spire/data/server"
log_level = "INFO"
ca_ttl = "24h"
default_svid_ttl = "1h"
}
plugins {
DataStore "sql" {
plugin_data {
database_type = "postgres"
connection_string = "postgres://spire:${SPIRE_DB_PASSWORD}@postgres.internal/spire_server sslmode=require"
}
}
NodeAttestor "k8s_psat" {
plugin_data {
clusters = {
"prod-cluster" = {
service_account_allow_list = ["spire:spire-agent"]
}
}
}
}
UpstreamAuthority "vault" {
plugin_data {
vault_addr = "https://vault.internal:8200"
pki_mount_point = "pki_int"
ca_cert_path = "/etc/spire/certs/vault-ca.pem"
}
}
}
default_svid_ttl (short — an hour is a common production value) is
the single most consequential setting here: it's what makes every
issued identity naturally expire and rotate rather than becoming a
long-lived credential by another name.
Configure the SPIRE Agent on each node with the matching trust domain and the node attestor appropriate to the environment:
# agent.conf (Kubernetes DaemonSet)
agent {
trust_domain = "prod.example.internal"
server_address = "spire-server.spire.svc"
server_port = 8081
socket_path = "/run/spire/sockets/agent.sock"
}
plugins {
NodeAttestor "k8s_psat" {
plugin_data {
cluster = "prod-cluster"
}
}
WorkloadAttestor "k8s" {
plugin_data {
skip_kubelet_verification = false
}
}
KeyManager "memory" {
plugin_data {}
}
}
Write registration entries scoped as narrowly as the workload attestor allows — a selector matching an entire namespace grants that identity to every pod in the namespace, which is rarely the intent:
spire-server entry create \
-spiffeID spiffe://prod.example.internal/ns/payments/sa/payments-service \
-parentID spiffe://prod.example.internal/spire/agent/k8s_psat/prod-cluster \
-selector k8s:ns:payments \
-selector k8s:sa:payments-service \
-ttl 3600
Warning: a registration entry using only a broad selector (e.g.
-selector k8s:ns:paymentsalone, with no service-account selector) grants thepayments-serviceSPIFFE ID to any pod in thepaymentsnamespace, including a future, unrelated workload someone deploys into that namespace later. Combine selectors ( namespace and service account, or namespace and a specific pod label) to scope an identity to the exact workload it's meant for.
Fetch SVIDs through the Workload API — never read the Agent's key material or SVID files directly from disk if avoidable; the Workload API (a local Unix domain socket, gRPC) is what handles automatic rotation transparently to the workload:
// Go SDK: fetch and watch for SVID rotation via the Workload API
source, err := workloadapi.NewX509Source(ctx,
workloadapi.WithClientOptions(workloadapi.WithAddr("unix:///run/spire/sockets/agent.sock")),
)
if err != nil {
log.Fatal(err)
}
defer source.Close()
tlsConfig := tlsconfig.MTLSServerConfig(source, source, tlsconfig.AuthorizeAny())
server := &http.Server{TLSConfig: tlsConfig}
NewX509Source maintains a background connection to the Agent and
transparently swaps in the newest SVID as it rotates — the
application code never manually reloads a certificate file.
Authorize peers by SPIFFE ID, not by which CA signed their certificate — mTLS alone only proves "signed by a CA I trust," not "this is specifically the workload I intend to talk to":
// authorize only a specific expected peer identity, not "any" SVID
// from the trust domain
tlsConfig := tlsconfig.MTLSClientConfig(source, source,
tlsconfig.AuthorizeID(spiffeid.RequireFromString(
"spiffe://prod.example.internal/ns/payments/sa/payments-service",
)),
)
tlsconfig.AuthorizeAny() (used in step 5's server example) accepts
any valid SVID from the trust domain and is appropriate only when the
caller-side authorization is enforced elsewhere (e.g. an application-
layer allow-list); a client connecting to a specific expected service
should authorize that exact SPIFFE ID.
Expose a JWT-SVID for workloads that can't do mTLS directly (e.g. calling through a load balancer or proxy that terminates TLS before the request reaches the workload):
# fetch a JWT-SVID for a specific audience via the Workload API CLI
spire-agent api fetch jwt -audience payments-api \
-socketPath /run/spire/sockets/agent.sock
The receiving service validates the JWT-SVID's signature against the
trust domain's published JWKS and checks the aud claim matches
itself — treat an unchecked aud claim the same as an unchecked JWT
audience in any other OIDC flow (see
enterprise-sso-and-idp-federation-configuration
for the equivalent human-identity pitfall).
Federate two trust domains explicitly, exchanging each domain's trust bundle and scoping which SPIFFE IDs from the far side are actually trusted — federation is opt-in per relying party, not a blanket cross-trust the moment two SPIRE Servers know about each other:
# on trust domain A's SPIRE Server: register domain B as a federated bundle
spire-server federation create \
-trustDomain acquired-co.internal \
-bundleEndpointURL https://spire-server.acquired-co.internal:8443 \
-bundleEndpointProfile https_web
# a registration entry that federates: this workload accepts SVIDs
# from the federated trust domain too, not just its own
spire-server entry create \
-spiffeID spiffe://prod.example.internal/ns/payments/sa/payments-service \
-parentID spiffe://prod.example.internal/spire/agent/k8s_psat/prod-cluster \
-selector k8s:ns:payments -selector k8s:sa:payments-service \
-federatesWith acquired-co.internal
Scope -federatesWith per registration entry to the specific
workloads that genuinely need to talk across the trust domain
boundary, rather than a blanket federation trusted by every workload
in the domain.
Monitor SPIRE Server/Agent health and SVID issuance rate as a first-class operational signal — a SPIRE Server outage or an Agent losing its connection to the Server means workloads eventually can't rotate expiring SVIDs and start failing mTLS handshakes as their current SVID expires:
# key metrics to alert on (SPIRE exposes Prometheus-format telemetry)
spire_server_registration_entry_count
spire_agent_svid_rotate_failure
spire_server_ca_manager_rotate_failure
default_svid_ttl short (an hour is a common production
baseline) and rely on the Workload API's automatic rotation rather
than ever extending TTL "to reduce load" — short-lived, automatically
rotated identity is the core security property SPIFFE/SPIRE provides.AuthorizeID) wherever the caller
knows exactly which service it intends to reach; reserve
AuthorizeAny for cases where authorization genuinely happens at
another layer.Symptom: A workload unexpectedly receives a SPIFFE identity meant for a different service running in the same namespace. Fix: The registration entry's selector matched on namespace alone (or an otherwise too-broad selector) rather than combining namespace with a service-account or pod-label selector specific to the intended workload (step 4). Tighten every registration entry to the narrowest selector combination the workload attestor supports, and audit existing entries for this exact broad-selector pattern.
Symptom: mTLS between two SPIRE-issued workloads succeeds even
though the calling service should never have been allowed to reach
this particular callee.
Fix: The server side is using AuthorizeAny() and relying on no
other authorization check, so any valid identity from the trust
domain is accepted as a peer (step 6). mTLS with SPIRE proves which
workload is calling, not that it's authorized to call — add an
explicit AuthorizeID/allow-list check, or an application-layer
authorization step, rather than treating "presented a valid SVID" as
equivalent to "is allowed to call this service."
Symptom: All workloads across a node start failing mTLS
handshakes with expired-certificate errors at roughly the same time.
Fix: The SPIRE Agent on that node lost connectivity to the SPIRE
Server (network issue, Server outage, or a node attestation failure
after a node's underlying instance was replaced) and stopped rotating
SVIDs before they expired. Alert on spire_agent_svid_rotate_failure
and Agent-to-Server connectivity specifically, rather than only
noticing after workloads start failing at the application layer.
Symptom: After federating two trust domains, a workload in trust
domain A can successfully authenticate to a service in trust domain B
that was never intended to be reachable across the boundary.
Fix: The federation was configured as a blanket trust bundle
exchange with -federatesWith applied too broadly, rather than
scoped per registration entry to the specific workloads meant to
cross the boundary (step 8). Review every registration entry using
-federatesWith and restrict it to the minimum set of workloads that
genuinely need cross-domain access.
Symptom: A newly onboarded team stands up their own node
attestation using join_token, and months later an audit can't
explain what actually proves a node running under that token is the
node it claims to be.
Fix: join_token node attestation provides no cryptographic
verification of the node's actual identity/environment — it's meant
for small manual/testing setups, not production fleets. Migrate to an
environment-appropriate attestor (k8s_psat for Kubernetes, the
cloud-provider node attestor for VM fleets) that ties node identity to
something independently verifiable (a cloud instance's own attested
metadata, a Kubernetes-issued service account token).
Scenario: payments-service and checkout-service run as
Kubernetes workloads in the prod.example.internal trust domain and
need mutual TLS between them with cryptographically attested identity —
no shared API keys, no long-lived certificates.
default_svid_ttl = "1h" and Postgres-backed SQL datastore.spire-server entry create \
-spiffeID spiffe://prod.example.internal/ns/payments/sa/payments-service \
-parentID spiffe://prod.example.internal/spire/agent/k8s_psat/prod-cluster \
-selector k8s:ns:payments -selector k8s:sa:payments-service -ttl 3600
spire-server entry create \
-spiffeID spiffe://prod.example.internal/ns/checkout/sa/checkout-service \
-parentID spiffe://prod.example.internal/spire/agent/k8s_psat/prod-cluster \
-selector k8s:ns:checkout -selector k8s:sa:checkout-service -ttl 3600
checkout-service fetches an X.509-SVID via the Workload API and
opens an mTLS connection to payments-service, authorizing the
specific expected peer identity:
tlsConfig := tlsconfig.MTLSClientConfig(source, source,
tlsconfig.AuthorizeID(spiffeid.RequireFromString(
"spiffe://prod.example.internal/ns/payments/sa/payments-service",
)),
)
payments-service accepts the connection using AuthorizeAny() plus
an explicit application-layer check that the caller's SPIFFE ID path
starts with spiffe://prod.example.internal/ns/checkout/, rejecting
any other otherwise-valid identity from the trust domain.X509Source swaps in the new
SVID for any new TLS handshake automatically.acquired-co.internal's SPIRE trust domain is
federated, scoped narrowly: only checkout-service's registration
entry gets -federatesWith acquired-co.internal added, so it alone
(not every workload in prod.example.internal) can now authenticate
against a specific service in the acquired company's trust domain.UpstreamAuthority chain target for SPIRE's own CA), distinct from SPIRE's automated, attested workload-identity issuance covered here.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
spiffe, spire, workload-identity, zero-trust, mtls, spiffe-id
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.
/falco-configuration-validationValidates Falco runtime detection rules for false-positive rate and actual firing correctness before trusting them in a channel that pages a human — running new/changed rules in log-only mode against real traffic, measuring alert volume and content, and confirming a rule fires on a deliberate positive-control trigger before promoting it to a higher-severity, paging-routed configuration. Use when the user asks to "validate this Falco rule before enabling it," "why is Falco so noisy," "test our Falco rules don't false-positive on real traffic," "review this rule set before it pages on-call," or "make sure Falco rules aren't about to be enabled in enforce/blocking mode without an audit period." Pairs with falco-runtime-threat-detection-configuration.
/falco-runtime-threat-detection-configurationGuides authoring and deploying Falco runtime threat detection rules — the eBPF/kernel-module-based syscall event stream, Falco's rule syntax (condition/output/priority), writing custom rules for a specific workload's known-good behavior, tuning noisy default rules, and wiring alerts to Falcosidekick outputs. Use when the user asks to "write a Falco rule to detect X," "why is Falco alerting on normal behavior," "detect a shell spawned inside a container at runtime," "set up Falco with eBPF instead of the kernel module," "send Falco alerts to Slack/PagerDuty," or "what's the difference between Falco and admission-control policy engines like OPA/Kyverno." Pairs with falco-configuration-validation for pre-enforcement false-positive testing.
/fortify-static-analysisGuides deep, tool-specific use of OpenText (formerly Micro Focus) Fortify Static Code Analyzer (SCA) and Fortify Audit Workbench for enterprise, on-premises static analysis — the translate/scan build workflow, Fortify Security Rulepacks, audit workbench triage (Not an Issue / Reliability / Suspicious), and how Fortify's on-prem, build-integrated model differs operationally from cloud-native SAST. Use when the user asks to "run a Fortify scan", "configure sourceanalyzer for a build", "triage findings in Fortify Audit Workbench", "integrate Fortify with Jenkins/Azure DevOps", "reduce Fortify SCA false positives", or "compare Fortify against SonarQube/Semgrep for enterprise compliance". Fortify-specific depth on the translate/scan model and enterprise workflow; for the general SAST concept see sast-integration in the devsecops domain.
/kubewarden-admission-policy-configurationGuides configuring Kubewarden as a WASM-based Kubernetes admission policy engine — installing the policy-server and controller, writing or reusing WebAssembly policies from the Kubewarden Policy Hub, ClusterAdmissionPolicy/AdmissionPolicy resources, monitor-mode rollout before enforce, and multi-language policy authoring (Rego, Rust, Go via the SDKs) as an alternative to OPA/Gatekeeper or Kyverno. Use when the user asks to "set up Kubewarden," "write a WASM admission policy," "why use Kubewarden instead of OPA/Kyverno," "reuse a policy from the Kubewarden Policy Hub," "run an admission policy in monitor mode before enforcing it," or "author a Kubernetes admission policy without writing Rego."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin security-tooling-skillsOther plugins' skills for the same job