Skip to content

Add SPIFFE interoperability, security, and end-to-end coverage #6206

Open

Description

@jhrozek

Description

Verify both authentication methods against real SPIRE infrastructure and
ToolHive's deployed configuration, and document the threat model and
operational failure modes.

Unit tests with hand-rolled certificates and self-signed JWTs will not catch
the failures that matter here. The interesting bugs live in the gap between what
SPIRE actually issues and what the validator assumes — SAN shapes, key usage,
bundle rotation timing, audience handling — so the positive paths must run
against credentials SPIRE minted.

Scope

  • Add table-driven parser, validator, policy and client-authentication tests.
  • Add real TLS and JWT-SVID integration tests.
  • Add an end-to-end SPIRE deployment and test matrix.
  • Document the threat model, supported configuration, rotation behaviour and
    operational failure modes.

Acceptance criteria

Positive paths, against real SPIRE-issued credentials:

  • X.509-SVID and JWT-SVID authentication both succeed.
  • Both methods produce equivalent grants and Cedar authorization decisions for
    the same SPIFFE ID.

Negative and boundary coverage:

  • Malformed and additional URI SANs
  • Invalid X.509 chains and wrong key usage
  • Wrong trust domains
  • Missing or mismatched client IDs
  • Expired JWT assertions
  • Incorrect or multiple JWT audiences
  • Wrong JWT keys, key IDs and algorithms
  • OIDC token / JWT-SVID type confusion
  • Bundle rotation, key removal, and cross-trust-domain mix-up
  • Exact and wildcard client-association boundaries
  • All four client shapes: public, secret-confidential, X.509-SVID, JWT-SVID
  • client_credentials and RFC 8693 token exchange
  • Restart and persisted-association behaviour

Discovery:

  • Metadata verified for X.509-only, JWT-only and combined configurations.
  • Public-only deployments' metadata is unchanged.

Documentation:

  • Threat model covers CA or signing-key compromise, Bundle Endpoint compromise,
    assertion replay, TLS termination, and Workload API socket access.
  • Production deployment and troubleshooting documentation is complete.

Dependencies

  • Sub-issue 6 (SPIRE and operator deployment integration) — the E2E matrix needs
    the deployable path

Related

  • Part of the SPIFFE client-authentication epic

Activity

  1. added
    enhancement
    go
    on Aug 5, 2026
  2. added
    needs-triage
    on Aug 5, 2026
  3. removed
    needs-triage
    on Aug 5, 2026
  4. jhrozek commented on Aug 13, 2026

    @jhrozek
    ContributorAuthor

    Reuse from the spiffee-authserver branch: high.

    pkg/authserver/spiffe/e2e_test.go is 387 lines doing a real mTLS handshake through a client_credentials request, skipping cleanly when certs are absent. Directly reusable as the shape for the positive path.

    deploy/spiffe-poc/demo/run-demo.sh (668 lines) and run-delegation-demo.sh exercise the full flow in a cluster, including the delegation path.

    The compliance matrix at the top of docs/spiffe-poc/future-directions.md is close to a ready-made interop checklist against the draft. It lists each requirement as compliant, partial or missing with the reason and a file reference. Worth converting into the test matrix rather than rewriting it from the spec.

    Note the PoC's negative coverage is thinner than its positive coverage, and the fail-closed case it did verify (a client_id=spiffe://... with no client certificate falling through to the default strategy) is the one the epic quotes. The rest of the negative matrix is new work.

  5. jhrozek commented on Oct 21, 2026

    @jhrozek
    ContributorAuthor

    Merged so far: #6879 (4fd4854) adds the embedded auth server to the OSS Scanner threat model, including SPIFFE assertion replay as an accepted trade-off. No SPIRE-backed e2e coverage is on main yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationauthorizationenhancementgo

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions