Skip to main content

Extension Examples

Working implementations of Defakto extensions, each one a complete walkthrough from source code to a verified deployment. Each guide lists its own prerequisites.

These pages are task-oriented. For configuration fields, wire protocols, and troubleshooting, see the reference page for the extension point you are using.

Which extension do you need?

Defakto has four extension points. They run in different places, are configured through different mechanisms, and are not interchangeable, so it is worth confirming which one you need before following a guide. Two questions narrow it down.

Where does the data or the decision live?

  • On the workload's own host — hardware present on the node, a local file, the workload's binary. Only an agent-side extension can see these.
  • In a central system — a CMDB, an asset inventory, a service catalog, a policy engine. A server-side extension reaches these without granting every node access to them.

At which point in the lifecycle?

  • A workload asks for an SVID → workload attestation.
  • An agent connects to the Trust Domain Server → agent attestation.
  • A workload asks the server directly, with no agent involved → serverless attestation.

The four surfaces

SurfaceRunsYour code isConfigured with
Server workload attestationTrust Domain Server, on each SVID requestAn HTTPS webhookspirl-server Helm values, under trustDomainDeployment.deployment.extensionWorkloadAttestation
Agent workload attestationEvery agent host, on each SVID requestA local executable speaking JSON over stdin and stdoutspirl-system Helm values, under agent.extensionWorkloadAttestation
Agent attestationBoth, when an agent logs inAn executable on the host and a webhook on the serverManaged Configuration, AgentAttestation policy
Serverless attestationTrust Domain Server, on each SVID requestAn HTTPS webhook, with the proof produced in the workload through the SDKManaged Configuration, ServerlessAttestation policy

Three differences catch people out:

  • Only the server workload attestation surface can be scoped. invokeForClusterIds and invokeForWorkloadAttributes narrow which workloads reach your webhook. The agent runs its executable for every workload on the node, with no equivalent filter.
  • Rollout differs. The two workload attestation surfaces are Helm values, so a change rolls pods: server pods for one, the agent DaemonSet for the other. Agent and serverless attestation are Managed Configuration and apply without restart.
  • Both workload attestation surfaces can deny as well as enrich. Returning an error refuses the identity. The choice between them is about where the decision's inputs live, not about what the extension is allowed to do.

Examples by task and surface

The agent-side and server-side surfaces do the same two jobs, so the guides pair up:

What you want to doOn the agent hostFrom a central webhook
Add custom attributesGPU DetectionAdd Custom Attributes
Refuse an identityBinary VerificationDeny SVID Issuance
Control SPIFFE ID namingRegistration Entries

If the pair on a row both look plausible, pick by the first question above: The host-local input belongs on the agent, the centrally-maintained one belongs in a webhook.

Examples

Examples are grouped by the surface they use, since that is the choice you make first.