Skip to content

Commit 7fe5368

Browse files
weltekialexellis
authored andcommitted
Add note on rotating the IAM issuer key
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 1c9351b commit 7fe5368

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

docs/openfaas-pro/iam/overview.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Add a certificate bundle to OpenFaaS components for use with an internal certifi
224224

225225
Create a secret that contains the CA bundle in the OpenFaaS namespace:
226226

227-
```
227+
```bash
228228
kubectl create secret generic \
229229
-n openfaas \
230230
ca-bundle \
@@ -237,6 +237,34 @@ Update the OpenFaaS chart and add a reference to the Kubernetes secret with the
237237
caBundleSecretName: ca-bundle
238238
```
239239

240+
## Rotate the IAM issuer key
241+
242+
The OpenFaaS IAM issuer has a single key that is used to sign JWT access tokens. It is recommended to regularly rotate this key. To rotate the signing key simply generate a new key and update the `issuer-key` secret in the `openfaas` namespace.
243+
244+
```bash
245+
# Generate a key
246+
openssl ecparam -genkey -name prime256v1 -noout -out issuer.key
247+
248+
# Delete the old signing key secret
249+
kubectl delete secret issuer-key
250+
251+
# Recreate the secret with the new key
252+
kubectl -n openfaas \
253+
create secret generic issuer-key \
254+
--from-file=issuer.key=./issuer.key
255+
```
256+
257+
Restart the OpenFaaS gataway and OIDC plugin:
258+
259+
```bash
260+
kubectl rollout restart deploy/oidc-plugin -n openfaas
261+
kubectl rollout restart deploy/gateway -n openfaas
262+
```
263+
264+
!!! warning
265+
266+
All existing OpenFaaS API and function access tokens will immediately become invalid after rotating the signing key.
267+
240268
## FAQ
241269

242270
* What Identity Providers are supported?

0 commit comments

Comments
 (0)