Skip to content
Projekte

cert-manager/aws-privateca-issuer

Auf GitHub ansehen

Über uns

Addon for cert-manager that issues certificates using AWS Private CA.

Systeme und Infrastruktur

So werden diese Zahlen gemessen

Gemessener Sternzuwachs

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Verlauf wird gesammelt

Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.

README.md

Original

Logo

Latest version

AWS Private CA Issuer

AWS Private CA Issuer is a cert-manager external issuer for AWS Private CA. Create an AWSPCAIssuer or AWSPCAClusterIssuer that points at your private CA, and cert-manager can issue certificates from it.

[!TIP] Amazon EKS also provides AWS Private CA Issuer as the EKS add-on aws-privateca-connector-for-kubernetes. See AWS add-ons.

Setup

Install cert-manager first.

Then install AWS Private CA Issuer using Helm:

helm repo add awspca https://cert-manager.github.io/aws-privateca-issuer
helm install aws-privateca-issuer awspca/aws-privateca-issuer \
  --namespace aws-privateca-issuer --create-namespace

Then, on Amazon EKS, configure EKS Pod Identity for the controller. On other clusters, see IAM for IRSA and IAM Roles Anywhere. See the chart README for its values.

Upgrading

Helm does not upgrade CRDs, so apply charts/aws-pca-issuer/crds/ before upgrading. Otherwise the API server rejects or silently drops new fields such as serviceAccountRef, and an Issuer that loses it falls back to ambient credentials where they are allowed.

[!WARNING] As of v1.12.0, an AWSPCAIssuer doesn't use the controller's own AWS credentials (EKS Pod Identity, IRSA, IAM Roles Anywhere, or the instance profile) unless the chart's enableIssuerAmbientCredentials is true; it defaults to false. Before upgrading, choose how AWSPCAIssuers get AWS credentials:

  • Central identity: set enableIssuerAmbientCredentials: true. Every AWSPCAIssuer shares the controller's credentials, so anyone who can create an AWSPCAIssuer can issue certificates from any CA the controller's role allows.
  • Per-Issuer identity: give each AWSPCAIssuer a serviceAccountRef, so it uses its own IAM role through IRSA, as described in IRSA per Issuer.

See Recommended setup.

Usage

An Issuer names the private CA that signs certificates, and tells the controller how to get AWS credentials for it:

apiVersion: awspca.cert-manager.io/v1beta1
kind: AWSPCAClusterIssuer
metadata:
  name: example
spec:
  # The ARN of the AWS Private CA that signs certificates, and its region.
  arn: arn:aws:acm-pca:us-west-2:111122223333:certificate-authority/<uuid4>
  region: us-west-2
  # Optional. An IAM role to assume before calling AWS Private CA.
  # role: arn:aws:iam::111122223333:role/pca-issuer
  # Optional. A ServiceAccount whose token is exchanged for `role` through IRSA.
  # serviceAccountRef:
  #   name: pca-issuer
  #   namespace: team-a

An AWSPCAIssuer is namespaced, and Certificates in its namespace can reference it. An AWSPCAClusterIssuer has the same spec, isn't namespaced, and Certificates in any namespace can reference it. An AWSPCAClusterIssuer uses the controller's own credentials unless it sets serviceAccountRef or secretRef, as in the examples. An AWSPCAIssuer needs its own credentials by default, as in IRSA per Issuer. See IAM for how each Issuer gets credentials.

Setting NotBefore on issued certificates

The controller sets NotBefore on issued certificates to 15 minutes before issuance time, rather than AWS Private CA's default of 1 hour, to allow for clock skew across machines. To change it, set spec.notBeforeOffset to a duration such as 30s or 1h30m, well below the certificate's duration, and at most 24 hours. For instance, if you set the offset to 1h when working with istio + ztunnel and requesting 1h certificates, ztunnel would constantly request certificates. See issuer-with-not-before-offset.yaml.

Usage with cert-manager ingress annotations

The cert-manager.io/cluster-issuer annotation cannot be used to point at an AWSPCAClusterIssuer. Instead, set cert-manager.io/issuer to the Issuer's name, with cert-manager.io/issuer-kind set to AWSPCAIssuer or AWSPCAClusterIssuer and cert-manager.io/issuer-group set to awspca.cert-manager.io. Without the kind, cert-manager sets kind: Issuer, and the controller marks the request Failed. See this issue for more information.

Supported workflows

AWS Private CA Issuer supports:

Using AWS Private CA templates

An Issuer can set a default template in spec.pcaTemplate.defaultTemplateName, from the AWS Private CA certificate templates. The field takes the template's name, the part of the ARN after :::template/. For arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen1/V1, set SubordinateCACertificate_PathLen1/V1. See issuer-with-template.yaml.

Every certificate request to that Issuer then uses the template, whatever usages the Certificate sets. A default template limits every namespace that uses the Issuer to that template.

Without a default template, the controller picks one from the Certificate:

cert-manager Certificate AWS Private CA template
isCA: true SubordinateCACertificate_PathLen0/V1
CodeSigning CodeSigningCertificate/V1
ClientAuth EndEntityClientAuthCertificate/V1
ServerAuth EndEntityServerAuthCertificate/V1
OCSPSigning OCSPSigningCertificate/V1
ClientAuth, ServerAuth EndEntityCertificate/V1
Everything else BlankEndEntityCertificate_APICSRPassthrough/V1

Troubleshooting

If an Issuer is not ready, check its Ready condition with kubectl describe, and the controller's logs, where sts:GetCallerIdentity shows the AWS identity it uses for the Issuer. See IAM for how to give the controller and its Issuers AWS credentials.

Further reading

Help & feedback

For help, please consider the following venues (in order):

Contributing

We welcome community contributions and pull requests.

See our contribution guide for more information on how to report issues, set up a development environment, and submit code.

We adhere to the Amazon Open Source Code of Conduct.

Ähnliche Projekte entdecken

Wird geladen…