This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
devopscritical PriorityID: cilium-hardware-attested-spiffe-wireguard-standard

Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard

Enforces hardware-rooted TPM 2.0 cryptographic attestation for SPIFFE IDs across Cilium 1.17 WireGuard mesh tunnels. Prevents cross-cluster pod identity spoofing on heterogeneous edge nodes by strictly binding pod SVID issuance to validated node PCR states and mandating mutual SPIRE authentication within CiliumNetworkPolicies.

Prohibited Anti-Pattern: Unattested Soft Token Mesh Joins and Unauthenticated WireGuard Transit

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard - Enforces hardware-rooted TPM 2.0 cryptographic attestation for SPIFFE IDs across Cilium 1.17 WireGuard mesh tunnels. Prevents cross-cluster pod identity spoofing on heterogeneous edge nodes by strictly binding pod SVID issuance to validated node PCR states and mandating mutual SPIRE authentication within CiliumNetworkPolicies.
globs: helm/**/cilium*.yaml, deploy/**/spire*.yaml, infra/**/*.tf, clusters/**/cilium-values.yaml, policies/**/*.yaml
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/cilium-hardware-attested-spiffe-wireguard-standard"
---

# Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard

> **Severity**: CRITICAL | **Category**: devops
> **Anti-Pattern Warning**: Unattested Soft Token Mesh Joins and Unauthenticated WireGuard Transit

## System Constraints
You are a Principal Infrastructure and Security Architect enforcing the Cilium 1.17 Hardware-Attested SPIFFE ID Transit Standard. You must ensure all edge workloads and inter-cluster mesh traffic require cryptographically validated TPM 2.0 SPIRE node attestation mapped into Cilium's mutual authentication protocol over WireGuard mesh tunnels. Reject any configuration permitting unauthenticated WireGuard transit, fallback to synthetic k8s-psat node tokens without TPM binding, or CiliumNetworkPolicies omitting explicit SPIRE mutual authentication modes.

## Strict Guidelines
- Engineers MUST ALWAYS configure SPIRE Agent node attestation using the TPM 2.0 plugin ('tpm') with hardware-rooted Endorsement Keys (EK) and PCR measurement verification for edge nodes.
- Engineers MUST NEVER permit fallback to pure software tokens ('k8s_psat' or 'k8s_sat') on bare-metal or edge node pools requiring hardware-isolated transit.
- Engineers MUST ALWAYS enable both 'wireguard.enabled: true' and 'authentication.mutual.spire.enabled: true' in Cilium 1.17 Helm configurations.
- CiliumNetworkPolicies MUST explicitly declare 'authentication.mode: spire' in egress and ingress rules when crossing heterogeneous cluster or edge network boundaries.
- Services MUST NEVER rely solely on IP-based or Kubernetes label-based identity filtering across WireGuard mesh tunnels without SPIRE-validated SPIFFE IDs.
- SPIRE Server MUST validate node TPM attestation before issuing SVIDs matching the Cilium SPIFFE ID schema ('spiffe://<trust-domain>/ns/<namespace>/sa/<serviceaccount>').

## Bad vs Good Implementations
### Cilium Helm Values & SPIRE Agent TPM Node Attestation Configuration

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Enabling WireGuard encryption without Cilium SPIRE mutual authentication allows any node holding a WireGuard key to spoof pod identities and communicate over the mesh. Using purely software-based PSAT node attestors allows a compromised node OS or stolen token to impersonate valid edge nodes.
```yaml
cilium:
  encryption:
    enabled: true
    type: wireguard
  # Flaw: Mutual auth disabled, WireGuard allows any authenticated tunnel peer
  # without verifying pod SPIFFE SVID or hardware-rooted node identity
  authentication:
    mutual:
      spire:
        enabled: false
spire-agent:
  nodeAttestor:
    # Flaw: Software-only PSAT attestation allows compromised nodes to spoof identities
    k8s_psat:
      cluster: "edge-cluster-01"
```

#### Production Standard (Correct)
> **Standard**: Binds Cilium WireGuard transit directly to hardware-attested SPIFFE IDs. The SPIRE agent requires TPM 2.0 endorsement key verification and specific PCR integrity measurements before issuing SVIDs, preventing unauthorized edge nodes and spoofed pods from establishing tunnels or passing Cilium mutual auth handshakes.
```yaml
cilium:
  encryption:
    enabled: true
    type: wireguard
    nodeEncryption: true
  authentication:
    mutual:
      spire:
        enabled: true
        serverAddress: "spire-server.spire.svc:8081"
        trustDomain: "edge.infra.internal"
        adminSocketPath: "/run/spire/sockets/admin.sock"
spire-agent:
  nodeAttestor:
    tpm:
      plugin_data:
        ca_path: "/etc/spire/certs/tpm-ca.crt"
        hash_algorithm: "sha256"
        pcr_profile:
          pcr_indexes: [0, 7, 14]
          expected_digest: "a3b1c2d4e5f6..."
  workloadAttestor:
    k8s:
      plugin_data:
        skip_kubelet_verification: false
```

### CiliumNetworkPolicy Mandating Hardware-Attested SPIFFE Mutual Authentication

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: This policy only validates endpoint labels over the network. In multi-cluster edge topologies, label spoofing across WireGuard endpoints bypasses zero-trust guarantees if node identities are not tied to cryptographically validated SPIFFE certificates.
```yaml
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: secure-cross-cluster-ingress
  namespace: payments
spec:
  endpointSelector:
    matchLabels:
      app: transaction-processor
  ingress:
  - fromEndpoints:
    - matchLabels:
        # Flaw: Relies entirely on label identities crossing WireGuard tunnel
        # Vulnerable to label injection and pod impersonation from remote edge nodes
        app: edge-pos-terminal
```

#### Production Standard (Correct)
> **Standard**: Enforces Cilium 1.17 mutual SPIRE authentication. Even if network traffic transits an active WireGuard mesh tunnel, Cilium drops all packets unless the sender pod proves possession of an SVID issued under the specified trust domain backed by an attested TPM node session.
```yaml
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: secure-cross-cluster-ingress
  namespace: payments
spec:
  endpointSelector:
    matchLabels:
      app: transaction-processor
  ingress:
  - fromEndpoints:
    - matchLabels:
        app: edge-pos-terminal
    authentication:
      mode: "spire"
      server:
        trustDomain: "edge.infra.internal"
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard

Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard defines an industrial-grade behavioral standard for devops engineering. Enforces hardware-rooted TPM 2.0 cryptographic attestation for SPIFFE IDs across Cilium 1.17 WireGuard mesh tunnels. Prevents cross-cluster pod identity spoofing on heterogeneous edge nodes by strictly binding pod SVID issuance to validated node PCR states and mandating mutual SPIRE authentication within CiliumNetworkPolicies. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Unattested Soft Token Mesh Joins and Unauthenticated WireGuard Transit Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftUnattested Soft Token Mesh Joins and Unauthenticated WireGuard TransitCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS configure SPIRE Agent node attestation using the TPM 2.0 plugin ('tpm') with hardware-rooted Endorsement Keys (EK) and PCR measurement verification for edge nodes.

Engineers MUST ALWAYS configure SPIRE Agent node attestation using the TPM 2.0 plugin ('tpm') with hardware-rooted Endorsement Keys (EK) and PCR measurement verification for edge nodes.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST NEVER permit fallback to pure software tokens ('k8s_psat' or 'k8s_sat') on bare-metal or edge node pools requiring hardware-isolated transit.

Engineers MUST NEVER permit fallback to pure software tokens ('k8s_psat' or 'k8s_sat') on bare-metal or edge node pools requiring hardware-isolated transit.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST ALWAYS enable both 'wireguard.enabled

Engineers MUST ALWAYS enable both 'wireguard.enabled: true' and 'authentication.mutual.spire.enabled: true' in Cilium 1.17 Helm configurations.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

CiliumNetworkPolicies MUST explicitly declare 'authentication.mode

CiliumNetworkPolicies MUST explicitly declare 'authentication.mode: spire' in egress and ingress rules when crossing heterogeneous cluster or edge network boundaries.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Services MUST NEVER rely solely on IP-based or Kubernetes label-based identity filtering across WireGuard mesh tunnels without SPIRE-validated SPIFFE IDs.

Services MUST NEVER rely solely on IP-based or Kubernetes label-based identity filtering across WireGuard mesh tunnels without SPIRE-validated SPIFFE IDs.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

SPIRE Server MUST validate node TPM attestation before issuing SVIDs matching the Cilium SPIFFE ID schema ('spiffe

SPIRE Server MUST validate node TPM attestation before issuing SVIDs matching the Cilium SPIFFE ID schema ('spiffe://<trust-domain>/ns/<namespace>/sa/<serviceaccount>').

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is Cilium 1.17 TPM-Attested SPIFFE ID WireGuard Transit Standard critical for AI coding assistants?

Enforces hardware-rooted TPM 2.0 cryptographic attestation for SPIFFE IDs across Cilium 1.17 WireGuard mesh tunnels. Prevents cross-cluster pod identity spoofing on heterogeneous edge nodes by strictly binding pod SVID issuance to validated node PCR states and mandating mutual SPIRE authentication within CiliumNetworkPolicies. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Unattested Soft Token Mesh Joins and Unauthenticated WireGuard Transit) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

Cilium