Skip to content

Send a placeholder subject in the certificate signing request - #199

Merged
mengqiy merged 1 commit into
aws:workloadidentityfrom
adp-825:adpotdar/add-subject-name-to-csr
Oct 18, 2026
Merged

mengqiy merged 1 commit into
aws:workloadidentityfrom
adp-825:adpotdar/add-subject-name-to-csr

Conversation

@adp-825

@adp-825 adp-825 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

X.509-SVID issuance fails against the current STS stack: buildCSR sent an
empty pkix.Name, and since STS does not parse the CSR, that empty subject
reaches the signer, which rejects it.

Set a fixed common name, eks-workload-identity. It names the agent rather
than the workload on purpose — the agent does not choose the identity. The
SPIFFE ID still comes only from the attested session, and the request still
carries no SAN and no extensions.

Temporary: STS will overwrite the subject with an empty value and mark the SAN
extension critical itself (blocked on the signer's validation). Any subject
works until then and is ignored afterwards, so delete csrSubjectCommonName
once that ships.

Also: buildCSR's doc comment claimed STS ignores the subject and SAN, which
is what made the empty subject look safe — corrected.
TestBuildCSRCarriesNothingButTheKey is renamed to TestBuildCSRNamesNoIdentity
and now pins the exact subject; its other assertions are unchanged.

@adp-825
adp-825 requested a review from a team as a code owner October 18, 2026 05:33
STS does not parse the CSR, so the subject passes through to the signer, and
the signer rejects a blank one. Every X.509-SVID issuance therefore fails
against the current stack, because buildCSR sent an empty pkix.Name.

Set a fixed common name instead. The value names the agent rather than the
workload on purpose: the agent does not choose the identity, so a common name
that looked like one would claim it does. The SPIFFE ID still comes only from
the attested session, and the request continues to carry no SAN and no
extensions.

This is temporary. STS intends to overwrite the subject with an empty value and
mark the SAN extension critical itself, which is what makes a certificate with
no subject SPIFFE compliant; that change is blocked on the signer's own
validation. Any subject works until then and is ignored afterwards, so this is
forwards compatible and the constant should be deleted once STS overwrites it.

buildCSR keeps its signature, since the value is fixed and needs nothing from
the workload. Its doc comment claimed STS ignores the subject and SAN in the
request, which is not true of either; it now states the invariant that holds,
that the request names no identity.

TestBuildCSRCarriesNothingButTheKey is renamed to TestBuildCSRNamesNoIdentity,
as the request is no longer nothing but the key, and now pins the exact subject
so an extra attribute fails. Its other assertions are unchanged.
@adp-825
adp-825 force-pushed the adpotdar/add-subject-name-to-csr branch from fd5cb73 to 86bad81 Compare October 18, 2026 05:38
@mengqiy
mengqiy merged commit 0d12411 into aws:workloadidentity Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants