Skip to content

Commit 2d70a2c

Browse files
committed
Fernet key rotation
TODO: Find a way to trigger it at a set interval without using a cron job.
1 parent 867af67 commit 2d70a2c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

controllers/keystoneapi_controller.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,10 +1413,19 @@ func (r *KeystoneAPIReconciler) ensureFernetKeys(
14131413

14141414
changedKeys := false
14151415

1416+
extraKey := fmt.Sprintf("FernetKeys%d", numberKeys)
1417+
//
1418+
// Fernet Key rotation
1419+
//
1420+
1421+
if false { // TODO: trigger rotation
1422+
secret.Data[extraKey] = secret.Data["FernetKeys0"]
1423+
secret.Data["FernetKeys0"] = []byte(keystone.GenerateFernetKey())
1424+
}
1425+
14161426
//
14171427
// Remove extra keys when FernetMaxActiveKeys changes
14181428
//
1419-
extraKey := fmt.Sprintf("FernetKeys%d", numberKeys)
14201429
for {
14211430
_, exists := secret.Data[extraKey]
14221431
if !exists {

0 commit comments

Comments
 (0)