User and operator guide · Security

SPIFFE And mTLS

Status: currentReviewed: 2026-06-18Audience: deployment engineers, platform security engineers, service developers, validation engineers
On this pagePurposeCurrent Service BoundaryArchitectureIdentity ModelRuntime BehaviorStartup EnforcementPeer AuthorizationDeployment PatternsKubernetesDocker And Local IntegrationClassified, DDIL, And Enterprise DeploymentsService OnboardingValidationStatic And Unit ValidationSPIRE-Backed Integration ValidationLive Platform EvidenceEvidence Collection CommandsEvidence Lookup StepsControl MappingOperationsHealth ChecksRotationBackup And RecoveryTroubleshooting
Important

The SPIFFE/mTLS boundary is security-sensitive. Do not mark a deployment validated from configuration files alone.

A validated deployment must show current evidence from the running platform: SPIRE server and agent health, workload registration entries, reachable Workload API sockets, issued SVIDs, service allowlists, mTLS handshakes, denied unauthorized peers, certificate rotation, and artifact hashes in the RMF evidence bundle.

Purpose

Atlas uses SPIFFE identities and mutual TLS to give internal services cryptographic workload identity. The design goal is that services authenticate each other with short-lived X.509 SVIDs issued by SPIRE and then authorize peers by exact SPIFFE ID instead of by network location alone.

Atlas services use the SPIFFE Workload API to obtain short-lived service identities, build TLS settings from those identities, pin the configured trust domain, and authorize peers by the expected SPIFFE IDs.

SPIFFE/SPIRE CA material is a separate workload-identity trust domain. It must be managed separately from gateway HTTPS certificates and CAC/PIV trust bundles. See security:certificate-authority-management.html for the enterprise CA hierarchy and evidence model.

Current Service Boundary

Area Current behavior Validation boundary

Shared service identity support

Atlas opens the SPIFFE Workload API source, validates the configured trust domain, rejects malformed or cross-domain allowlist entries, builds HTTP and gRPC TLS settings, and logs SVID rotation updates.

Unit and integration tests can validate helper behavior. Live validation must also prove that a real SPIRE agent socket issued SVIDs to the running services.

Authn, Identity, and Session gRPC services

Authn, identity, and session services require SPIRE mTLS outside development and test environments. Each service uses configured peer allowlists and gRPC transport credentials.

These services can be marked validated only when their configured peers connect successfully and unauthorized peers are denied.

Attestation, Kill Switch, Interceptor, and TrustAI service paths

These services include SPIFFE/mTLS startup hooks. Peer authorization coverage is validated when the deployed path has explicit allowed IDs or an equivalent approved configuration.

Claim peer-authorization coverage for these paths only with live handshake and authorization evidence.

API gateway and browser/API edge

The public gateway TLS boundary is separate from SPIFFE service mTLS. The gateway can enforce modern HTTPS for external clients, while SPIFFE mTLS is the internal service identity mechanism.

Validate gateway TLS with live endpoint probes; validate SPIFFE mTLS with internal service probes.

TrustAI edge scoring TLS

TrustAI also has a separate certificate-file TLS/mTLS configuration for edge scoring clients. That path is distinct from SPIFFE Workload API identity.

Evidence must identify whether a result came from SPIFFE mTLS or certificate-file mTLS.

External dependencies

Atlas Cache, Vault, LDAP, PKI, object storage, and other dependencies may use TLS, but they are not automatically protected by the SPIFFE helper.

Dependency TLS and credential controls need their own evidence.

Architecture

Spiffe Mtls Architecture
Spiffe Mtls ArchitectureArchitecture diagramOpen full size ↗

The important security property is not simply "TLS is enabled." A protected internal service path needs all of the following:

  • A workload receives an X.509 SVID from the SPIRE agent.

  • The service TLS configuration is built from the SPIFFE Workload API source.

  • The trust domain in configuration matches the issued identity.

  • The server authorizes a narrow set of expected peer SPIFFE IDs.

  • Unauthorized identities, malformed IDs, and cross-domain identities are denied.

  • Rotation is tolerated without restarting the platform path under test.

Identity Model

The current repository configuration uses a configured SPIFFE trust domain of trustscore.local in several files. Treat that value as an implementation identifier that must be changed deliberately if the deployment trust domain changes. Do not use product naming assumptions as the trust-domain authority; use the live SPIRE server configuration and the service allowlists.

A valid service identity has this shape:

spiffe://<trust-domain>/<workload-id>

For example, the service allowlists in config/atlas/*.yaml currently reference identities such as:

spiffe://trustscore.local/atlas-authn
spiffe://trustscore.local/atlas-identity
spiffe://trustscore.local/atlas-session
spiffe://trustscore.local/api-gateway
spiffe://trustscore.local/killswitch
spiffe://trustscore.local/trustai
Service Configured allowed peer IDs

atlas-authn

atlas-identity, atlas-session, api-gateway, killswitch

atlas-identity

atlas-authn, atlas-session, api-gateway, killswitch, trustai

atlas-session

atlas-authn, atlas-identity, api-gateway, killswitch, trustai

The helper rejects allowlist entries that are malformed or outside the configured trust domain. If authorization is enabled but no allowlist is provided, the helper fails closed by constructing an authorizer that rejects all peer identities.

Runtime Behavior

Spiffe Mtls Runtime
Spiffe Mtls RuntimeArchitecture diagramOpen full size ↗

Startup Enforcement

atlas-authn, atlas-identity, and atlas-session enforce SPIRE outside development and test environments. If SPIRE is disabled in a non-development environment, startup returns an error instead of silently serving without internal mTLS.

Development and unit-test environments may intentionally disable SPIRE to allow isolated test runs. That mode must not be used as evidence for production or classified deployment posture.

Peer Authorization

The secure service path uses NewMTLSClientWithAuthz with enforceAuthz set to true and a configured allowed_ids list. The helper behavior is:

Configuration state Behavior Evidence status

Authorization enabled with explicit allowed IDs

Uses SPIFFE AuthorizeOneOf against the parsed ID list.

Eligible for validation.

Authorization enabled with an empty allowed list

Fails closed and rejects peer connections.

Evidence-required or failed until configured.

Authorization disabled

Uses AuthorizeAny, logs an insecure-mode warning, and accepts any valid identity in the trust bundle.

Not acceptable as validated service authorization.

Allowed ID outside the trust domain

Initialization fails.

Failed configuration.

Malformed allowed ID

Initialization fails.

Failed configuration.

Deployment Patterns

Kubernetes

The Kubernetes manifests define a SPIRE server StatefulSet and SPIRE agent DaemonSet. The current manifests use k8s_psat node attestation, a projected service account token for the agent, a persistent SPIRE server volume, a hostPath socket directory for agent Workload API exposure, and health probes for both server and agent.

Spiffe Mtls Kubernetes
Spiffe Mtls KubernetesArchitecture diagramOpen full size ↗

Kubernetes deployment requirements:

Requirement What to verify

SPIRE server health

The server StatefulSet is ready, serving the SPIRE APIs, retaining state across restarts, and publishing the trust bundle expected by agents.

Agent health

Every schedulable node that can run Atlas workloads has a ready SPIRE agent and a mounted Workload API socket.

Node attestation

k8s_psat attestation is configured with the correct cluster name, service account allowlist, audience, and token path.

Workload selectors

Registration entries use selectors that bind identities to the intended workload attributes, not broad namespace-only selectors unless explicitly accepted by the authorization boundary.

Socket mount

Service pods mount the agent socket path expected by service config. Current service config examples use /tmp/spire-agent/public/api.sock; Kubernetes agent manifests expose /run/spire/sockets/agent.sock, so deployment overlays must align the path.

Network policy

Workload API sockets remain local to the node, SPIRE server APIs are reachable only from authorized agents and administrators, and internal service traffic is restricted to intended paths.

Docker And Local Integration

The Docker SPIRE stack is useful for local integration and lab validation. The current Docker assets start SPIRE server and agent containers, configure SQLite-backed server state, expose health and telemetry endpoints, and mount Docker and host information into the agent for workload attestation.

The Docker agent currently uses privileged container settings and mounts the Docker socket. Treat that deployment as development or lab infrastructure unless a deployment-specific security review accepts those host-level permissions.

Docker asset Role

docker/spire-server.yml

Starts SPIRE server and agent containers for local/lab use.

docker/spire/server/server.conf

Defines the server trust domain, datastore, node attestors, upstream authority, health, and telemetry.

docker/spire/agent/agent.conf

Defines the agent socket, bootstrap bundle path, node attestors, workload attestors, health, and telemetry.

Classified, DDIL, And Enterprise Deployments

For classified, DDIL, and enterprise deployments, SPIFFE/mTLS evidence must be collected from the actual deployment topology, not copied from local Docker results.

Deployment posture Additional expectations

Classified environment

Use approved certificate, key, logging, backup, and administrative access procedures. Preserve SPIRE server state and trust bundle handling as controlled security artifacts. Record who can create or modify SPIFFE registration entries.

DDIL environment

Prove that services continue operating with existing SVIDs during expected disconnected intervals, that rotation behavior is understood when SPIRE connectivity is restored, and that stale or expired SVIDs fail safely.

Enterprise environment

Integrate registration management with change control, central logging, vulnerability management, backup and recovery, and identity governance processes. Treat SPIRE server administration as privileged infrastructure administration.

Multi-cluster environment

Document each trust domain, federation relationship, bundle distribution path, and cross-domain authorization rule. Do not assume a single-cluster allowlist applies across domains.

Service Onboarding

Use this checklist when adding or hardening a service-to-service path.

  1. Assign the service a stable SPIFFE ID in the deployment trust domain.

  2. Create or update SPIRE registration entries with narrow workload selectors.

  3. Mount the SPIRE agent Workload API socket into the service runtime.

  4. Configure the service trust domain and socket path.

  5. Add explicit peer IDs to the receiving service allowlist.

  6. Use NewMTLSClientWithAuthz for server paths that must authorize specific peers.

  7. Capture startup logs proving SPIRE is required in the target environment.

  8. Run authorized and unauthorized handshake tests.

  9. Capture evidence artifacts and hashes under the RMF evidence run.

Example registration commands are deployment-specific because selectors differ between Docker, Kubernetes, systemd, and classified runtime environments. The evidence package should include the exact registration entries exported from the live SPIRE server for the run under review.

Validation

Static And Unit Validation

Run the security tests that exercise SPIFFE authorization and TLS behavior:

Internal implementation checks are omitted from this public guide.

Expected coverage includes:

  • AuthorizeAny detection for service authorization paths that must be explicit.

  • Rejection of missing allowlists when authorization is enforced.

  • Rejection of malformed SPIFFE IDs.

  • Rejection of identities outside the configured trust domain.

  • TLS configuration and certificate validation checks.

SPIRE-Backed Integration Validation

Run integration tests only against a live SPIRE agent socket. These tests are intentionally skipped when the socket is not present, so skipped integration tests are not validation evidence.

Internal implementation checks are omitted from this public guide.

If the deployment exposes the Workload API socket at a different path, set SPIRE_SOCKET_PATH to the mounted socket path and ensure the service configuration uses the same value.

Live Platform Evidence

For RMF/control validation, run the artifact-gated validation path against the integrated local-live Atlas platform:

make control-validation

The evidence bundle for SPIFFE/mTLS should include:

Evidence artifact Required content

SPIRE server configuration

Trust domain, node attestors, datastore, key manager, bundle publisher, health endpoint, and administrative access boundary.

SPIRE agent configuration

Server address, bootstrap bundle, Workload API socket path, node attestor, workload attestors, health endpoint, and mounted socket permissions.

Registration entries

SPIFFE IDs, selectors, parent IDs, TTLs, federates-with settings when used, and timestamps from the live SPIRE server.

Service configuration

Trust domain, socket path, enabled flags, and explicit allowed peer IDs for each protected service.

Positive handshake result

Authorized service pair, request path, peer SPIFFE ID, TLS version, timestamp, and log correlation ID.

Negative handshake result

Unauthorized or cross-domain peer, expected denial, timestamp, and log correlation ID.

Rotation result

Evidence that the service observed an SVID update and continued serving or failed safely according to the runbook.

Artifact manifest

SHA-256 hashes for logs, command outputs, exported registration entries, and generated validation summaries.

Evidence Collection Commands

For Kubernetes deployments using the manifests in this repository, collect the control-plane state from the trustscore namespace:

kubectl -n trustscore rollout status statefulset/spire-server
kubectl -n trustscore rollout status daemonset/spire-agent
kubectl -n trustscore get pods -l app=spire-server -o wide
kubectl -n trustscore get pods -l app=spire-agent -o wide
kubectl -n trustscore get configmap spire-bundle -o yaml

SERVER_POD="$(kubectl -n trustscore get pod -l app=spire-server -o jsonpath='{.items[0].metadata.name}')"
kubectl -n trustscore exec "$SERVER_POD" -c spire-server -- \
  /opt/spire/bin/spire-server entry show \
  -socketPath /tmp/spire-server/private/api.sock

Expected outcome:

  • The SPIRE server StatefulSet and agent DaemonSet report ready rollout status.

  • Each node that can run Atlas workloads has a ready spire-agent pod.

  • The trust bundle exists and matches the deployment trust domain.

  • The registration entry export includes only the intended Atlas service identities and narrow selectors.

For a service pod, verify that the configured Workload API socket is present before using the service as mTLS evidence:

SERVICE_POD="<atlas-service-pod>"
kubectl -n trustscore exec "$SERVICE_POD" -- test -S /run/spire/sockets/agent.sock
kubectl -n trustscore logs "$SERVICE_POD" --since=30m | \
  grep -E 'SPIFFE|SVID|mTLS|Workload API|rotation'

If the service config still uses /tmp/spire-agent/public/api.sock, use that path in the socket test and document the overlay that maps the agent socket into the container.

For the Docker lab stack, collect equivalent lab evidence with:

docker compose -f docker/spire-server.yml up -d
docker compose -f docker/spire-server.yml ps
docker exec spire-server /opt/spire/bin/spire-server healthcheck
docker exec spire-agent /opt/spire/bin/spire-agent healthcheck
docker exec spire-server /opt/spire/bin/spire-server entry show

Docker evidence is useful for local integration only. It must not be reused as Kubernetes, classified, DDIL, or enterprise deployment proof.

Evidence Lookup Steps

After an RMF gate run, confirm that SPIFFE/mTLS evidence is present and tied to the control result:

RUN_DIR="$(ls -1dt artifacts/rmf/evidence/* | head -1)"
jq -r '.controls[] | select(.id=="SC-8" or .id=="SC-7" or .id=="IA-2") |
  [.id, .status, .boundary, .reason] | @tsv' "$RUN_DIR/control-results.json"
find "$RUN_DIR" -type f \( -iname '*spire*' -o -iname '*spiffe*' -o -iname '*mtls*' \) | sort
(cd "$RUN_DIR" && sha256sum -c manifest.sha256)

If the find command returns no live SPIRE or handshake artifacts, do not cite the run as SPIFFE/mTLS deployment evidence even when adjacent TLS or gateway controls passed.

Control Mapping

Control family SPIFFE/mTLS relevance Evidence expectation

AC

Service-to-service access enforcement by authorized workload identity.

Allowlist configuration and denied unauthorized peer evidence.

IA

Non-person entity authentication through SPIFFE X.509 SVIDs.

Issued SVID details and successful identity verification evidence.

SC

Transmission confidentiality, integrity, cryptographic protection, session protection, and boundary enforcement.

TLS version, certificate chain, trust bundle, mTLS handshake, and network exposure evidence.

AU

Security-relevant connection, denial, and rotation events.

Logs with timestamps, peer identities, outcomes, and correlation IDs.

CM

Controlled configuration of trust domains, socket paths, registration entries, and allowlists.

Reviewed manifests, config files, and change records.

CP

Recovery of SPIRE server state and trust bundle continuity.

Backup and restore evidence for SPIRE datastore, key material handling, and service recovery tests.

Operations

Health Checks

Operators should verify:

  • SPIRE server is healthy and serving the expected trust domain.

  • SPIRE agents are healthy on every node that hosts Atlas services.

  • The Workload API socket exists inside each service container at the configured path.

  • Services log successful SPIFFE source initialization.

  • Services log SVID rotation updates during long-running validation.

  • Unauthorized peers are denied and produce auditable events.

Rotation

SPIRE-issued SVIDs are short-lived by design. Atlas services watch the workload identity source for certificate updates. Rotation validation should include a long enough run to observe at least one update or an operator-driven rotation event, then prove that authorized traffic still succeeds and unauthorized traffic remains denied.

Backup And Recovery

SPIRE server state is part of the service identity control plane. Recovery documentation and evidence should include:

  • SPIRE server datastore backup and restore procedure.

  • Key manager and upstream authority recovery procedure.

  • Trust bundle recovery and redistribution procedure.

  • Registration entry export and restore procedure.

  • Service behavior while the SPIRE server is unavailable but agents and cached identities remain active.

  • Service behavior after SVID expiration when the control plane cannot recover in time.

Troubleshooting

Symptom Likely cause Corrective action

Service fails to start outside development.

SPIRE is disabled or socket configuration is missing.

Enable SPIRE for the service and align the socket path with the deployed agent mount.

Initialization fails with a trust-domain error.

The configured trust domain is malformed or does not match allowed IDs.

Correct the trust domain and regenerate allowlist entries from the intended trust domain.

Peer connection is rejected.

Peer SPIFFE ID is not in the receiver allowlist, registration entry is wrong, or selectors issued a different ID.

Export the peer SVID and receiver allowlist, compare exact IDs, and correct registration or configuration.

All peers are rejected.

Authorization is enabled with no allowed IDs, causing fail-closed behavior.

Add explicit allowed IDs for the intended peer services.

Integration tests skip.

No live SPIRE agent socket is available at the configured test path.

Start the SPIRE stack and set SPIRE_SOCKET_PATH to the actual socket path.

Docker validation passes but cluster validation fails.

Docker and Kubernetes use different socket paths, attestors, selectors, or SPIRE versions.

Validate the target deployment directly and align service configuration with that deployment.

Rotation evidence is missing.

The validation run ended before SVID rotation or did not capture helper logs.

Extend the run, force a controlled rotation where appropriate, and capture service logs.

Documentation Claim Boundary

This page supports a precise claim:

  • The repository contains SPIFFE/mTLS helper code, service startup enforcement for selected core services, service allowlist configuration, deployment manifests, and tests that can validate SPIFFE authorization and TLS behavior.

This page does not support these claims without current live evidence:

  • Every internal Atlas service path is protected by SPIFFE mTLS.

  • Every configured service has current SPIRE registration entries in a target environment.

  • Docker lab results prove Kubernetes, classified, DDIL, or enterprise posture.

  • A control is validated when tests were skipped because SPIRE was unavailable.