Facilitate a webhook integration for leveraging the STACKIT DNS alongside its API to act as a DNS01 ACME Issuer with cert-manager.
Upgrading from v0.x?
v1.0.0introduces breaking security and authentication changes (including namespace-scoped Secret RBAC by default and removal of legacy bearer token authentication). See Migrating from v0.x to v1.0.0 below.
helm repo add stackit-cert-manager-webhook https://stackitcloud.github.io/stackit-cert-manager-webhook
helm install stackit-cert-manager-webhook --namespace cert-manager stackit-cert-manager-webhook/stackit-cert-manager-webhookBy default, the Helm chart does not grant cluster-wide Kubernetes Secret read permissions. Use stackitSaAuthentication.secretAccessScope to match your cluster model:
secretAccessScope |
Kubernetes RBAC Created | Allowed Dynamic Secret Lookup (serviceAccountSecretRef) |
Recommended Use Case |
|---|---|---|---|
webhook (default) |
Namespace Role (get on secrets in webhook namespace) |
Only ClusterIssuers or Issuers in the webhook namespace (cert-manager) |
Single-tenant clusters using a ClusterIssuer with a Secret in cert-manager |
issuer |
ClusterRole (get on secrets) |
Issuers may only read Secrets in their own namespace (serviceAccountSecretNamespace must match the Issuer namespace) |
Multi-tenant clusters where each namespace manages its own STACKIT project Secret |
none |
None (no secret-reader Role/ClusterRole) |
Disabled (any serviceAccountSecretRef is rejected) |
WIF, DefaultAuth environment variables, or mounted static Service Account key |
(Note: When using secretAccessScope=webhook with a ClusterIssuer, the webhook must be installed in the same namespace as cert-manager's --cluster-resource-namespace, which defaults to cert-manager.)
The STACKIT webhook requires authentication against the STACKIT DNS API. Depending on your cluster architecture and security policies, configure one of the methods below.
The webhook will explicitly fail if multiple mutually exclusive solver authentication fields (serviceAccountSecretRef, serviceAccountKeyPath, useWorkloadIdentityFederation) are set on the same Issuer. When none of those fields are specified, the webhook uses the STACKIT SDK's automatic DefaultAuth chain.
Multi-Tenant Security Note: Pod-level credentials (
DefaultAuthenvironment variables,stackitSaAuthentication.enabled=true, or pod-level Workload Identity Federation) are shared by the webhook Pod and can be used by anyIssuerreferencing the solver. In untrusted multi-tenant clusters, keepstackitSaAuthentication.enabled=false, do not attach ambient credentials to the webhook Pod, and use Option A withstackitSaAuthentication.secretAccessScope=issuer.
This method fetches the Service Account JSON directly from a Kubernetes Secret per challenge. Cross-namespace Secret access is strictly blocked: an Issuer can only reference a Secret in its own namespace.
-
Install the Webhook with
issuerScope (for multi-namespaceIssuers): (Skip--set stackitSaAuthentication.secretAccessScope=issuerif you only use aClusterIssuerwith Secrets incert-manager.)helm upgrade --install stackit-cert-manager-webhook stackit-cert-manager-webhook/stackit-cert-manager-webhook \ --namespace cert-manager \ --set stackitSaAuthentication.secretAccessScope=issuer
-
Create the Secret containing the SA JSON in the Issuer's namespace:
kubectl create secret generic stackit-tenant-a-auth \ -n tenant-a \ --from-file=sa.json=/path/to/tenant-a-sa.json
-
Configure the Issuer:
serviceAccountSecretNamespacedefaults to theIssuer's namespace when omitted (and must match it if specified).apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: letsencrypt-prod namespace: tenant-a spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: mail@example.com privateKeySecretRef: name: letsencrypt-prod solvers: - dns01: webhook: solverName: stackit groupName: acme.stackit.de config: projectId: <STACKIT PROJECT ID> serviceAccountSecretRef: stackit-tenant-a-auth serviceAccountSecretKey: sa.json
When no explicit authentication field is set in the Issuer's config, the webhook delegates credential discovery to the STACKIT Go SDK's DefaultAuth flow (checking Workload Identity Federation env vars, STACKIT_SERVICE_ACCOUNT_KEY, STACKIT_SERVICE_ACCOUNT_KEY_PATH, etc.). Because dynamic Secret lookup is not needed, you can disable Secret RBAC completely with secretAccessScope=none.
-
Deploy the Webhook with Credentials Exposed as Environment Variables (or Mounted via
stackitSaAuthentication.enabled=true):kubectl create secret generic stackit-sa-authentication \ -n cert-manager \ --from-file=sa.json=/path/to/global-sa.json helm upgrade --install stackit-cert-manager-webhook stackit-cert-manager-webhook/stackit-cert-manager-webhook \ --namespace cert-manager \ --set stackitSaAuthentication.enabled=true \ --set stackitSaAuthentication.secretAccessScope=none
(Enabling
stackitSaAuthentication.enabled=truemounts the Secret at/var/run/secrets/stackit/sa.jsonand setsSTACKIT_SERVICE_ACCOUNT_KEY_PATHautomatically. Alternatively, pass SDK environment variables viaextraEnv.) -
Configure the
ClusterIssuer(onlyprojectIdrequired):apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-prod spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: mail@example.com privateKeySecretRef: name: letsencrypt-prod solvers: - dns01: webhook: solverName: stackit groupName: acme.stackit.de config: projectId: <STACKIT PROJECT ID>
If you mount one or more Service Account key files under /var/run/secrets/stackit/ and want to select a specific file path in the ClusterIssuer/Issuer:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: mail@example.com
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- dns01:
webhook:
solverName: stackit
groupName: acme.stackit.de
config:
projectId: <STACKIT PROJECT ID>
serviceAccountKeyPath: /var/run/secrets/stackit/sa.json(Note: serviceAccountKeyPath must reside within /var/run/secrets/stackit/.)
If your cluster supports Workload Identity Federation (e.g., SKE clusters), you can avoid long-lived keys by projecting a short-lived federated token into the webhook container.
-
Annotate the Webhook ServiceAccount and Disable Secret RBAC:
# values.yaml serviceAccount: annotations: workload-identity.stackit.cloud/service-account-email: "my-sa@sa.stackit.cloud" stackitSaAuthentication: secretAccessScope: none
-
Configure the
ClusterIssuer: Either omit auth fields to letDefaultAuthpick up the projected WIF environment automatically, or explicitly enforce WIF:apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt-prod spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: mail@example.com privateKeySecretRef: name: letsencrypt-prod solvers: - dns01: webhook: solverName: stackit groupName: acme.stackit.de config: projectId: <STACKIT PROJECT ID> useWorkloadIdentityFederation: true
| Key | Type | Default | Description |
|---|---|---|---|
projectId |
string | "" |
Required. The unique identifier for the STACKIT project. |
apiBasePath |
string | "https://dns.api.stackit.cloud" |
Base URL for the STACKIT DNS API. Must match https://dns.api([.<region>]).stackit.cloud. |
serviceAccountSecretRef |
string | "" |
Name of the Kubernetes Secret containing the STACKIT Service Account JSON. |
serviceAccountSecretKey |
string | "sa.json" |
Key within the Secret mapped to the Service Account JSON (when serviceAccountSecretRef is set). |
serviceAccountSecretNamespace |
string | <issuer-or-webhook-namespace> |
Namespace of the Secret. Must match the Issuer namespace (or webhook namespace for ClusterIssuer). |
serviceAccountKeyPath |
string | "" |
File path to a mounted Service Account JSON key inside the webhook container. Must be within /var/run/secrets/stackit/. |
useWorkloadIdentityFederation |
bool | false |
Explicitly enforces STACKIT Workload Identity Federation authentication. |
acmeTxtRecordTTL |
int32 | 60 |
TTL (in seconds) for the ACME TXT challenge record. |
| Variable | Description |
|---|---|
STACKIT_SERVICE_ACCOUNT_BASE_URL |
Optional custom token endpoint URL for exchanging Service Account assertions (replaces the removed serviceAccountBaseUrl solver config field). |
STACKIT_SERVICE_ACCOUNT_KEY / STACKIT_SERVICE_ACCOUNT_KEY_PATH |
Used automatically by SDK DefaultAuth when no explicit solver auth option is set. |
STACKIT_FEDERATED_TOKEN_FILE / STACKIT_SERVICE_ACCOUNT_EMAIL |
Used automatically by SDK DefaultAuth / Workload Identity Federation. |
- Cluster-wide
SecretRBAC removed by default (stackitSaAuthentication.secretAccessScope: webhook):- Previously, the Helm chart always created a
ClusterRoleable to readSecretsacross all namespaces. - In
v1.0.0, the defaultsecretAccessScopeiswebhook(creates a namespace-scopedRolein the webhook's namespace only). - Action required:
- If you have namespaced
Issuers in other namespaces usingserviceAccountSecretRef, upgrade Helm with--set stackitSaAuthentication.secretAccessScope=issuer. - If you use WIF,
DefaultAuth, or a mounted static Service Account key (stackitSaAuthentication.enabled=true), you can disable Secret RBAC completely with--set stackitSaAuthentication.secretAccessScope=none.
- If you have namespaced
- Previously, the Helm chart always created a
- Cross-namespace
Secretreferences are blocked:- A namespaced
Issuercan no longer read aSecretfrom a different namespace (includingcert-manager). Move theSecretinto theIssuer's own namespace (withsecretAccessScope=issuer), or switch to aClusterIssuerwith itsSecretincert-manager.
- A namespaced
- Legacy static Bearer Token authentication removed (
authTokenSecretRef,authTokenSecretKey,authTokenSecretNamespace,STACKIT_AUTH_TOKEN):- Long-lived static bearer tokens are no longer supported by STACKIT IAM/DNS and have been removed.
- Action required: Create a STACKIT Service Account key JSON (or configure SKE Workload Identity Federation) and replace
authTokenSecretRefwithserviceAccountSecretRef(orDefaultAuth/ WIF).
serviceAccountBaseUrlremoved fromIssuersolverconfig:- To prevent credential assertion exfiltration via untrusted
Issuers, custom token endpoints can no longer be set inIssuerYAML. - Action required: Remove
serviceAccountBaseUrlfrom yourIssuer/ClusterIssuermanifests. If you need a custom token endpoint (e.g., internal testing), setSTACKIT_SERVICE_ACCOUNT_BASE_URLon the webhook Deployment via HelmextraEnv:extraEnv: - name: STACKIT_SERVICE_ACCOUNT_BASE_URL value: "https://service-account.api.stackit.cloud/token"
- To prevent credential assertion exfiltration via untrusted
- Strict validation on
apiBasePathandserviceAccountKeyPath:apiBasePathonly accepts official STACKIT DNS endpoints (https://dns.api.stackit.cloudorhttps://dns.api.<region>.stackit.cloud).serviceAccountKeyPathmust be under/var/run/secrets/stackit/.
- Default
acmeTxtRecordTTLlowered:- Default
acmeTxtRecordTTLchanged from600to60seconds (introduced inv0.5.0).
- Default
- Webhook PKI private key rotation policy changed to
Always:- The webhook's internal CA and serving certificates (
pki.caCertificateandpki.servingCertificate) now defaultprivateKey.rotationPolicytoAlways(previouslyNever) and expose configurableduration,renewBefore, andprivateKey.rotationPolicyunderpki.*in Helmvalues.yaml.
- The webhook's internal CA and serving certificates (
# BEFORE (v0.x - no longer supported)
config:
projectId: <STACKIT PROJECT ID>
authTokenSecretRef: stackit-cert-manager-webhook
authTokenSecretKey: auth-token
authTokenSecretNamespace: my-namespace
# AFTER (v1.0.0 - with Helm `--set stackitSaAuthentication.secretAccessScope=issuer` for tenant namespaces)
config:
projectId: <STACKIT PROJECT ID>
serviceAccountSecretRef: stackit-sa-secret # Secret in `my-namespace` containing key `sa.json`
serviceAccountSecretKey: sa.json# Helm values.yaml (v1.0.0)
stackitSaAuthentication:
enabled: true
secretAccessScope: none
secretName: stackit-sa-authentication
fileName: sa.json# ClusterIssuer solver config (v1.0.0 - DefaultAuth picks up mounted key automatically)
config:
projectId: <STACKIT PROJECT ID>make testmake coveragemake lintRuns the official cert-manager Go solver test suite in memory against the STACKIT API:
TEST_ZONE_NAME="example.com" make test-e2e-conformanceFollow the comprehensive guide available here.
Spins up a local Kind cluster, installs cert-manager, builds and deploys the webhook, and executes Kuttl integration tests covering both single-tenant (DefaultAuth) and multi-tenant (dynamic SA fetching & cross-tenant isolation) flows against Let's Encrypt Staging:
make test-e2e-local \
PROJECT_ID="<your-project-id>" \
ZONE_NAME="<your-test-zone>" \
AUTH_KEY_PATH="<path-to-sa-key.json>"Follow the comprehensive guide available here.
- Update
versionandappVersionindeploy/stackit/Chart.yamland regenerate chart documentation viamake helm-docs. - Merge changes into
main—.github/workflows/publish-chart.yamlautomatically packages and publishes the updated Helm chart to GitHub Pages. - Push a semantic version tag (
vX.Y.Z) onmain—.github/workflows/release.yamlruns GoReleaser to build, sign (Cosign), generate SBOMs, and publish multi-arch container images (ghcr.io/stackitcloud/stackit-cert-manager-webhook) and GitHub Release artifacts.