Expand description
Platform workload identity: RFC 7523 JWT-bearer assertions signed with a Cloud Foundry instance identity certificate.
Cloud Foundry gives every app instance an X.509 certificate and RSA key
(paths in CF_INSTANCE_CERT and CF_INSTANCE_KEY), rotated before they
expire. The certificate’s subject names the instance (CN) and, in OU
values, its app:<guid>, space:<guid>, and organization:<guid>.
An app (or the AgentVisor sidecar beside it) proves that identity by
sending /v1/token an RFC 7523 assertion
(grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer): a short-lived
JWT signed RS256 with the instance key, whose x5c header carries the
instance certificate and its intermediates. WorkloadTrust::verify
checks, in order:
- size, JOSE header (
alg = RS256, 1 to 4x5ccertificates); - the certificate chain up to a configured instance-identity root, valid now, with the clientAuth extended key usage;
- the assertion signature with the certificate’s key;
- the claims:
audnames the gateway,subis the instance GUID, the lifetime is at mostMAX_ASSERTION_LIFETIME_S, andjtiis present; jtiwas not seen before (a bounded replay cache).
The caller then maps the verified identity to a configured workload, which names the human principal the agent acts for, and issues a gateway-signed agent token.
Structs§
- CfInstance
Identity - The platform identity proven by a verified assertion.
- Verified
Assertion - A verified assertion.
- Workload
Trust - Trusted instance-identity roots plus the replay cache.
Enums§
- Workload
Error - Why an assertion was refused.
Constants§
- JWT_
BEARER_ GRANT_ TYPE - RFC 7523 §2.1 grant type.
- MAX_
ASSERTION_ LIFETIME_ S - Longest accepted assertion lifetime (
exp - iat), in seconds.
Functions§
- cf_
identity - Read a Cloud Foundry instance identity out of an X.509 subject name.
- name_
attributes (attribute OID, text)pairs of an X.509 Name, given the contents of its outer SEQUENCE. String types other than UTF8String, PrintableString, and IA5String are skipped.- tlv
- Split one DER TLV off the front of
input:(tag, value, rest).