Skip to content

Commit 2e00f64

Browse files
authored
Merge pull request #144 from stackitcloud/documentation/remove_token_auth
docs: update README to remove mentions of token authentication options due to its deprecation.
2 parents 7f2af19 + 054ff2a commit 2e00f64

File tree

1 file changed

+17
-26
lines changed

1 file changed

+17
-26
lines changed

README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,11 @@ helm install stackit-cert-manager-webhook --namespace cert-manager stackit-cert-
2222

2323
## Usage
2424

25-
1. ***Initiation of STACKIT Authentication Token Secret:***
25+
1. ***Initiation of STACKIT Service Account Secret:***
2626
```bash
2727
kubectl create secret generic stackit-sa-authentication \
2828
-n cert-manager \
29-
--from-literal=auth-token=<STACKIT AUTH TOKEN>
30-
```
31-
Or alternatively we can utilize the STACKIT service account path authentication:
32-
```
33-
kubectl create secret generic stackit-sa-authentication \
34-
-n cert-manager \
35-
--from-literal=sa.json='{
29+
--from-literal=sa.json='{
3630
"id": "4e1fe486-b463-4bcd-9210-288854268e34",
3731
"publicKey": "-----BEGIN PUBLIC KEY-----\nPUBLIC_KEY\n-----END PUBLIC KEY-----",
3832
"createdAt": "2024-04-02T13:12:17.678+00:00",
@@ -80,14 +74,7 @@ helm install stackit-cert-manager-webhook --namespace cert-manager stackit-cert-
8074
projectId: <STACKIT PROJECT ID>
8175
```
8276

83-
For diverse project architectures where zones are spread across varying projects, necessitating distinct
84-
authentication tokens per project, the Issuer configuration becomes pertinent. This approach inherently
85-
tethers namespaces to individual projects.
86-
```bash
87-
kubectl create secret generic stackit-cert-manager-webhook \
88-
--namespace=default \
89-
--from-literal=auth-token=<STACKIT AUTH TOKEN>
90-
```
77+
For diverse project architectures where zones are spread across varying projects, use an Issuer (namespaces are separate):
9178
```yaml
9279
apiVersion: cert-manager.io/v1
9380
kind: Issuer
@@ -107,10 +94,21 @@ helm install stackit-cert-manager-webhook --namespace cert-manager stackit-cert-
10794
groupName: acme.stackit.de
10895
config:
10996
projectId: <STACKIT PROJECT ID>
110-
authTokenSecretNamespace: default
11197
```
112-
*Note:* Ensure the creation of an authentication token secret within the namespace linked to the issuer.
113-
The secret must be vested with permissions to access zones in the stipulated project configuration.
98+
*Note on service accounts and namespaces:*
99+
- Issuer-per-namespace (recommended for isolation): create a STACKIT service-account key (sa.json) for each STACKIT project you need to manage and place that key in a Kubernetes Secret in the same namespace as the Issuer. This means one sa.json (one SA key) per Issuer/namespace when the Issuers target different STACKIT projects.
100+
Example (create a secret in the Issuer namespace):
101+
```bash
102+
kubectl create secret generic stackit-sa-authentication \
103+
-n <issuer-namespace> \
104+
--from-literal=sa.json='{"id":"...","credentials":{...}}'
105+
```
106+
Ensure the webhook can read the secret in that namespace (create the secret where the Issuer lives).
107+
- Alternative (single SA key for multiple projects): you can grant the service account broader permissions at folder or organization level so one sa.json can manage zones across multiple projects. This is more convenient but grants wider access — evaluate security and follow least-privilege principles.
108+
- Tradeoffs:
109+
- Per-namespace/per-project SA keys: better isolation and least privilege, easier to rotate keys per project.
110+
- Folder/org-level SA key: lower operational overhead (single key), but larger blast radius if compromised.
111+
114112
3. ***Demonstration of Ingress Integration with Wildcard SSL/TLS Certificate Generation***
115113
Given the preceding configuration, it is possible to exploit the capabilities of the Issuer or ClusterIssuer to
116114
dynamically produce wildcard SSL/TLS certificates in the following manner:
@@ -181,20 +179,13 @@ spec:
181179
config:
182180
projectId: string
183181
apiBasePath: string
184-
authTokenSecretRef: string
185-
authTokenSecretKey: string
186-
authTokenSecretNamespace: string
187182
serviceAccountKeyPath: string
188183
serviceAccountBaseUrl: string
189184
acmeTxtRecordTTL: int64
190185
```
191186

192187
- projectId: The unique identifier for the STACKIT project.
193188
- apiBasePath: The base path for the STACKIT DNS API. (Default: https://dns.api.stackit.cloud)
194-
- authTokenSecretRef: The reference to the secret containing the STACKIT authentication token. (Default:
195-
stackit-cert-manager-webhook)
196-
- authTokenSecretKey: The key within the secret containing the STACKIT authentication token. (Default: auth-token)
197-
- authTokenSecretNamespace: The namespace of the secret containing the STACKIT authentication token. (Default: cert-manager)
198189
- serviceAccountKeyPath: The path to the service account key file. The file must be mounted into the container.
199190
- serviceAccountBaseUrl: The base URL for the STACKIT service account API. (Default: https://service-account.api.stackit.cloud/token)
200191
- acmeTxtRecordTTL: The TTL for the ACME TXT record. (Default: 600)

0 commit comments

Comments
 (0)