Skip to content

Conversation

@xek
Copy link
Contributor

@xek xek commented Oct 4, 2024

As part of this work, we needed to implement more than 2 keys, since rotating 2 would expire sessions on every rotation. There are new settings and the defaults are the same as in "old-gen" Tripelo.

jira: OSPRH-9309

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@xek
Copy link
Contributor Author

xek commented Oct 4, 2024

/test all

@xek
Copy link
Contributor Author

xek commented Oct 15, 2024

/test all

@xek xek force-pushed the fernet-rotation branch from 97df3e8 to 2a84e5e Compare October 15, 2024 10:39
@xek
Copy link
Contributor Author

xek commented Oct 15, 2024

/test all

@xek xek force-pushed the fernet-rotation branch 2 times, most recently from 54fc55a to de882bc Compare October 17, 2024 09:20
@xek xek marked this pull request as ready for review October 17, 2024 09:21
@openshift-ci openshift-ci bot requested review from stuggi and viroel October 17, 2024 09:21
@xek
Copy link
Contributor Author

xek commented Oct 17, 2024

This pull request now also contains all changes needed in the keystone-operator to support variable number of keys

@dprince
Copy link
Collaborator

dprince commented Oct 17, 2024

If we land this PR please add the associated RELATED_IMAGE into the openstack-operator here: https://github.com/openstack-k8s-operators/openstack-operator/blob/main/config/default/manager_default_images.yaml

@xek xek force-pushed the fernet-rotation branch from 73e0b28 to 44f38b7 Compare October 18, 2024 13:08
@xek xek force-pushed the fernet-rotation branch from 44f38b7 to 9615b6e Compare October 18, 2024 13:26
@xek xek force-pushed the fernet-rotation branch from 9615b6e to 3bea5aa Compare October 18, 2024 14:09
@xek xek force-pushed the fernet-rotation branch from 3bea5aa to aa395f6 Compare October 18, 2024 15:09
}
rotatedAt, err := time.Parse(time.RFC3339, secret.Annotations[fernetAnnotation])

var duration int
Copy link
Contributor

@olliewalsh olliewalsh Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would move this (L1392-L1397) up so that err is checked right after setting

Add configuration for specifying the number of
fernet keys stored in the keystone secret.
More than 2 keys are needed, since rotating 2
keys would expire sessions on every rotation.

After configuration change, keys need to be
added/removed and rotated in the proper order,
to ensure that the sessions don't expire
prematurely.

Fernet key rotation is triggered in the reconcile
loop. The "rotated at" timestamp is set in the
secret annotation.

Co-Authored-By: Grzegorz Grasza <[email protected]>
@xek xek force-pushed the fernet-rotation branch from aa395f6 to c05fc7b Compare October 18, 2024 16:34
Copy link
Contributor

@olliewalsh olliewalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olliewalsh, xek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 61e711f into openstack-k8s-operators:main Oct 18, 2024
6 checks passed
@xek xek changed the title Add fernet key rotation cronjob Add fernet key rotation Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants