ProficientNowTechRFCs

4. Components

RFC-WORKLOAD-IDENTITY-0001                                      Section 4
Category: Standards Track                                      Components

4. Components

← Previous: Architecture | Index | Next: Kubernetes Workloads →


4.1 Component Taxonomy

4.1.1 Component Categories

CategoryComponentsPurpose
Identity IssuersSPIRE, Kubernetes, Cloud ProvidersIssue cryptographic identity
Credential AuthoritiesVaultIssue access credentials
Identity ConsumersVault, Linkerd, ApplicationsVerify and use identity
Secret DistributionESO, Vault AgentDeliver secrets to workloads
Machine IdentityTeleport tbotNon-Kubernetes identity

4.1.2 Component Relationships


4.2 SPIRE Architecture

4.2.1 SPIRE Overview

SPIRE (SPIFFE Runtime Environment) is the reference implementation of the SPIFFE specification, providing attestation-based workload identity.

ComponentFunction
SPIRE ServerIssues SVIDs, manages registrations
SPIRE AgentRuns on each node, attests workloads
Registration EntriesDefine which workloads get which SPIFFE IDs
Trust BundleCA certificates for trust establishment

4.2.2 SPIFFE ID Structure

SPIFFE IDs follow a URI format:

spiffe://<trust-domain>/<workload-path>
ComponentExampleDescription
Trust Domainprod.example.comAdministrative boundary
Workload Path/ns/payments/sa/apiHierarchical identifier

Example SPIFFE IDs:

WorkloadSPIFFE ID
Payments APIspiffe://prod.example.com/ns/payments/sa/api
CI Pipelinespiffe://prod.example.com/ci/github/repo/main
ArgoCDspiffe://prod.example.com/ns/argocd/sa/argocd-server

4.2.3 SPIRE Server Configuration

SPIRE Server deployment considerations:

AspectConfiguration
DeploymentKubernetes Deployment, HA with shared storage
Data StorePostgreSQL for HA, SQLite for dev
Key ManagementAWS KMS, GCP KMS, or Vault Transit
Upstream AuthorityRoot CA or Vault PKI integration

4.2.4 SPIRE Agent Configuration

SPIRE Agent runs as a DaemonSet:

AspectConfiguration
DeploymentDaemonSet on all worker nodes
Node AttestationKubernetes PSAT (Projected ServiceAccount Token)
Workload AttestationKubernetes Pod (labels, SA, namespace)
SocketUnix socket at /run/spire/sockets/agent.sock

4.2.5 Registration Entries

Registration entries map workloads to SPIFFE IDs:

# Example: Register all pods in payments namespace
entries:
  - spiffe_id: spiffe://prod.example.com/ns/payments/sa/api
    parent_id: spiffe://prod.example.com/spire/agent/k8s_psat/production/node
    selectors:
      - k8s:ns:payments
      - k8s:sa:api
    ttl: 3600

4.2.6 SPIRE Deployment Diagram


4.3 Vault Integration

4.3.1 Vault as Credential Authority

Per RFC-SECOPS-0001, Vault is the credential authority. This RFC adds workload-specific integrations.

IntegrationPurpose
Kubernetes AuthAuthenticate workloads via ServiceAccount tokens
JWT/OIDC AuthAuthenticate CI/CD via OIDC tokens
SPIFFE AuthAuthenticate via SPIFFE SVIDs (future)
AppRoleLegacy automation authentication

4.3.2 Kubernetes Auth Method

Kubernetes auth method configuration:

ParameterValuePurpose
kubernetes_hostAPI server URLKubernetes API for token validation
kubernetes_ca_certCA certificateVerify Kubernetes API
token_reviewer_jwtSA tokenVault's credential to call TokenReview
issuerOIDC issuerExpected issuer in SA tokens

4.3.3 Role-to-Policy Mapping

Kubernetes auth roles map pods to Vault policies:

RoleBound NamespacesBound SAsPolicies
payments-apipaymentsapipayments-read, payments-db
argocdargocdargocd-serverargocd-repos, argocd-clusters
tekton-pipelinetekton-pipelines*ci-secrets

4.3.4 Policy Templates

Vault policy templates use identity metadata:

# Template: Namespace-scoped secret access
path "secret/data/ns/{{identity.entity.aliases.auth_kubernetes-prod.metadata.service_account_namespace}}/*" {
  capabilities = ["read", "list"]
}
 
# Template: Service-specific database access
path "database/creds/{{identity.entity.aliases.auth_kubernetes-prod.metadata.service_account_name}}" {
  capabilities = ["read"]
}

4.3.5 Vault Agent Integration

Vault Agent runs as sidecar or init container:

ModeUse Case
Init ContainerPopulate secrets at startup
SidecarContinuous secret refresh
CSI DriverMount secrets as volumes

4.4 Teleport Machine ID

4.4.1 tbot Overview

Teleport Machine ID (tbot) provides identity for non-Kubernetes workloads:

ComponentFunction
tbotAgent that obtains and renews machine certificates
Bot UserTeleport user representing the machine
Bot RolePermissions granted to the machine
Join TokenBootstrap credential (single-use)

4.4.2 Supported Platforms

PlatformAttestationUse Case
KubernetesServiceAccountK8s-hosted automation
AWS EC2Instance identity documentEC2 VMs
GCP GCEInstance metadataGCE VMs
Azure VMInstance metadataAzure VMs
GitHub ActionsOIDC tokenCI/CD pipelines

4.4.3 Machine Certificate Lifecycle

4.4.4 tbot Configuration

Example tbot configuration for Kubernetes:

version: v2
onboarding:
  join_method: kubernetes
  token: bot-token
storage:
  type: kubernetes_secret
  name: machine-certs
  namespace: automation
outputs:
  - type: identity
    destination:
      type: directory
      path: /var/run/teleport/certs

4.5 Linkerd Service Mesh

4.5.1 Linkerd Identity

Linkerd provides automatic mTLS for service-to-service communication:

ComponentFunction
Identity ControllerIssues workload certificates
ProxySidecar that handles mTLS
Trust AnchorRoot CA for mesh identity

4.5.2 Identity Model

Linkerd identity is based on Kubernetes ServiceAccounts:

Identity: <service-account>.<namespace>.serviceaccount.identity.linkerd.<trust-domain>

Example:

api.payments.serviceaccount.identity.linkerd.cluster.local

4.5.3 mTLS Configuration

mTLS is automatic within the mesh:

TrafficEncryptionIdentity
Pod to Pod (in mesh)mTLSLinkerd certificates
Pod to Pod (one not in mesh)Plaintext (or TLS)No Linkerd identity
External ingressTLS terminationIngress certificate

4.5.4 Authorization Policies

Linkerd Server and ServerAuthorization resources:

# Server: Define what traffic a workload accepts
apiVersion: policy.linkerd.io/v1beta3
kind: Server
metadata:
  name: api-server
  namespace: payments
spec:
  podSelector:
    matchLabels:
      app: api
  port: 8080
  proxyProtocol: HTTP/2
 
# Authorization: Define who can access
apiVersion: policy.linkerd.io/v1beta1
kind: ServerAuthorization
metadata:
  name: allow-frontend
  namespace: payments
spec:
  server:
    name: api-server
  client:
    meshTLS:
      serviceAccounts:
        - name: frontend
          namespace: payments

4.6 External Secrets Operator

4.6.1 ESO in Workload Identity

Per RFC-SECOPS-0001, ESO distributes secrets from Vault to Kubernetes. For workload identity:

Use CaseESO Role
Bootstrap secretsDistribute SPIRE join tokens
Workload secretsDistribute application secrets
Vault credentialsDistribute Vault tokens (legacy)

4.6.2 ESO Secret Flow

4.6.3 ClusterSecretStore Configuration

Per RFC-SECOPS-0001, ClusterSecretStore uses Kubernetes auth:

apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: vault
spec:
  provider:
    vault:
      server: https://vault.vault.svc.cluster.local:8200
      path: secret
      auth:
        kubernetes:
          mountPath: kubernetes-prod
          role: eso
          serviceAccountRef:
            name: external-secrets
            namespace: external-secrets

4.7 Cloud Provider Integration

4.7.1 AWS Integration

ComponentConfiguration
IRSAServiceAccount → IAM Role mapping
Pod Identity AgentEKS add-on for token injection
OIDC ProviderEKS cluster as OIDC provider

4.7.2 GCP Integration

ComponentConfiguration
Workload IdentityServiceAccount → GSA mapping
Workload Identity PoolKubernetes SA as identity source
Service Account KeyNOT USED (violates INV-2)

4.7.3 Azure Integration

ComponentConfiguration
Workload IdentityServiceAccount → Managed Identity
Federated CredentialsOIDC federation configuration
User-Assigned IdentityPer-workload Azure identity

4.7.4 Cloud Integration Diagram


4.8 Component Summary

ComponentRoleInvariants Enforced
SPIREIssue workload identityINV-1, INV-3
VaultIssue credentialsINV-2, INV-4
LinkerdNetwork identityINV-6
ESODistribute secrets(per RFC-SECOPS)
tbotMachine identityINV-1, INV-2
Cloud IAMCloud accessINV-2, INV-5

Document Navigation


End of Section 4