Skip to content

Support External IDs as subject names in ZTS user certificate requests #3402

Description

@ctyano

Problem

PostUserCertificateRequest currently assumes that the requested user certificate subject is an Athenz user principal under the configured user domain, for example user.joe. This prevents ZTS from issuing a user certificate when the subject CN is an External ID such as email:ext.joe@athenz.io.

This is useful for deployments where the user identity is established by an external IdP and represented in Athenz policy data using the existing External ID syntax.

Proposal

Allow PostUserCertificateRequest to accept External IDs in the request name and CSR subject CN, for example:

  • email:ext.joe@athenz.io

For normal Athenz user principals, the existing behavior remains unchanged:

  • user.joe is still validated as an Athenz user principal.
  • The user. prefix is still stripped before calling the configured user certificate provider.

For External IDs:

  • ZTS validates that the subject uses the External ID separator format.
  • The full External ID is preserved when validating the CSR and when passing the request to the configured user certificate provider.
  • The user certificate provider accepts the External ID when the IdP token subject or configured username claim matches it.

Justification

This change does not make Athenz responsible for user authentication. The actual user authentication remains delegated to the configured external IdP and the user certificate provider.
ZTS only validates that the requested certificate subject matches the CSR and that the provider confirms the attested identity.

This also does not redefine External IDs as ordinary Athenz Principals. External IDs remain conceptually separate from Athenz user/service principals. The change only allows an External ID, already supported as an identity reference in Athenz policy concepts, to be used as the subject identifier for the user certificate issuance flow.

Without this support, deployments that intentionally spec user authentication outside of Athenz cannot issue user certificates for externally authenticated identities unless they map those identities into synthetic user.* principals. Preserving the External ID avoids that lossy mapping and keeps the certificate subject aligned with the identity asserted by the external IdP.

Scope

This issue is limited to user certificate issuance through PostUserCertificateRequest.

It does not change:

  • normal user.* certificate issuance behavior
  • role or service certificate issuance
  • how Athenz authenticates users
  • the general conceptual distinction between Athenz Principals and External IDs

Acceptance Criteria

  • PostUserCertificateRequest can issue a certificate when request name and CSR CN are email:ext.joe@athenz.io.
  • Existing user.joe behavior remains unchanged.
  • Invalid External ID-like values are rejected.
  • Provider token subject / username claim validation supports the full External ID.
  • Unit tests cover both ZTS request validation and user certificate provider subject matching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions