Skip to content

Document certificate template selection logic based on certificate usages #460

Open

Description

@yoshimi-I

Problem

When using aws-privateca-issuer with AWS RAM (Resource Access Manager) cross-account PCA sharing, changing the usages field in a cert-manager Certificate resource can cause unexpected AccessDeniedException errors.

This happens because aws-privateca-issuer implicitly selects different ACM PCA certificate templates based on the usages field:

  • usages: [server auth, client auth] → EndEntityClientAuthCertificate template
  • usages: [server auth] → EndEntityServerAuthCertificate template

When the PCA is shared via RAM, the managed permission attached to the RAM share may only allow specific templates (e.g., EndEntityClientAuthCertificate). Removing client auth from usages silently switches the template, which can result in:

AccessDeniedException: User is not authorized to perform: acm-pca:IssueCertificate
because no resource-based policy allows the acm-pca:IssueCertificate action

Impact

This is particularly problematic because:

  1. The template selection logic is not documented — users have no way to know that changing usages affects the PCA template
  2. The error message does not mention the template mismatch — it only says "not authorized"
  3. It only affects cross-account (RAM-shared) PCA setups, making it hard to reproduce in single-account environments

Suggestion

  1. Document the template selection logic — clearly state which usages combinations map to which PCA templates
  2. Consider adding an explicit template override option — allow users to specify the PCA template directly in the AWSPCAClusterIssuer or Certificate annotation, rather than relying on implicit selection from usages
  3. Improve error messaging — when IssueCertificate fails, include the template ARN that was used in the error log

Environment

  • aws-privateca-issuer version: v1.6.0
  • cert-manager version: v1.17.4
  • Setup: Cross-account PCA shared via AWS RAM

References

Activity

  1. bmsiegel commented on Apr 23, 2026

    @bmsiegel
    Contributor

    Thanks for the issue. This behavior is documented in our README: https://github.com/cert-manager/aws-privateca-issuer#using-aws-pca-template-arns

    Also, if you want the explicit override option, please follow the instructions to use our beta environment here: #458 (comment)

  2. added a commit that references this issue on Apr 23, 2026
    5b9ae0a
  3. yoshimi-I commented on Apr 23, 2026

    @yoshimi-I
    Author

    @bmsiegel
    Thanks for the quick response! I'm aware of the template mapping table in the README — it was actually very helpful in understanding the root cause.

    My point is that the README doesn't mention the impact on cross-account setups using AWS RAM. The template table alone doesn't make it obvious that changing usages can break RAM permissions. I've submitted #461 to add a warning section specifically for this scenario.

    I'll also check out the beta environment for the explicit template override in #458 — that would be a great solution for this class of issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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