Skip to main content

What It Does

The Credential Injector receives hexr_tool() calls from agents, validates their SPIFFE identity, and exchanges it for short-lived cloud credentials (AWS STS, GCP STS, Azure AD).

Exchange Flow

1

Agent calls hexr_tool()

Your agent code calls hexr_tool("aws_s3", ...). The request goes to the Envoy sidecar.
2

Envoy verifies mTLS

Envoy verifies the X.509 SVID from the process-specific certificate and extracts the SPIFFE ID.
3

Credential Injector receives request

Envoy forwards the request to the Credential Injector with the SPIFFE ID in the header.
4

OPA policy check

The Credential Injector asks OPA: “Can spiffe://.../{role} access aws_s3?” OPA returns ALLOW with constraints.
5

Cloud STS exchange

The Credential Injector calls AWS AssumeRoleWithWebIdentity (or GCP/Azure equivalent) using the JWT-SVID.
6

Temporary credentials returned

The cloud provider returns temporary credentials (15-minute TTL). These are injected into the original request and returned to the agent.

Supported Providers

AWS

STS AssumeRoleWithWebIdentity with OIDC federation.Returns: AccessKeyId, SecretAccessKey, SessionToken

GCP

Workload Identity Federation via STS token exchange.Returns: access_token (OAuth 2.0)

Azure

Federated identity credentials via Azure AD.Returns: access_token (Bearer)

Three-Tier Cache

Credential lookups are cached at three levels to minimize STS round-trips: Cache keys include the SPIFFE ID + service + region, ensuring per-process credential isolation.

OPA Policy Integration

Before exchanging credentials, the Credential Injector queries OPA:

Configuration


Image