mon/AuthMonitor: provide command to rotate the key for a user credential#58121
Merged
mon/AuthMonitor: provide command to rotate the key for a user credential#58121
Conversation
6a4ef0e to
be4b9ef
Compare
Member
Author
|
jenkins test make check |
Member
Author
|
jenkins test api |
Member
Author
|
jenkins test make check |
rzarzynski
reviewed
Jun 20, 2024
qa/workunits/cephtool/test.sh
Outdated
| ceph auth get-or-create client.admin2 mon 'allow *' | ||
| ceph auth get client.admin2 >> keyring1 | ||
| env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2 >> keyring2 | ||
| diff -au keyring1 keyring2 |
qa/workunits/cephtool/test.sh
Outdated
| diff -au keyring1 keyring2 | ||
| # rotate itself | ||
| env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth rotate client.admin2 >> keyring3 | ||
| expect_false diff -au keyring1 keyring3 |
Contributor
There was a problem hiding this comment.
Yeah, secret should be different...
| # rotate itself | ||
| env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth rotate client.admin2 >> keyring3 | ||
| expect_false diff -au keyring1 keyring3 | ||
| expect_false env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2 |
Contributor
There was a problem hiding this comment.
... so we shouldn't be able to operate using the old one.
| expect_true env CEPH_KEYRING=keyring3 ceph -n client.admin2 auth get client.admin2 | ||
| expect_true ceph auth get client.admin2 >> keyring4 | ||
| expect_true diff -au keyring3 keyring4 | ||
| rm keyring[1234] |
Contributor
There was a problem hiding this comment.
I would love to see a check ensuring the only thing that got changed is the secret itself; particularly that the caps are untouched.
Member
Author
There was a problem hiding this comment.
diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh
index d024ce6912d4..266f133c6037 100755
--- a/qa/workunits/cephtool/test.sh
+++ b/qa/workunits/cephtool/test.sh
@@ -613,14 +613,20 @@ function test_auth()
ceph auth get-or-create client.admin2 mon 'allow *'
ceph auth get client.admin2 >> keyring1
env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2 >> keyring2
- diff -au keyring1 keyring2
+ # they are the same:
+ expect_true diff -au keyring1 keyring2
# rotate itself
env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth rotate client.admin2 >> keyring3
- expect_false diff -au keyring1 keyring3
+ # only the key has changed:
+ diff -au keyring1 keyring3 | grep -E '^[-+][^-+]' | expect_false grep -v key
+ # the key in keyring1 no longer works:
expect_false env CEPH_KEYRING=keyring1 ceph -n client.admin2 auth get client.admin2
+ # the key in keyring3 should work:
expect_true env CEPH_KEYRING=keyring3 ceph -n client.admin2 auth get client.admin2
+ # now verify the key from `auth get` matches what rotate produced:
expect_true ceph auth get client.admin2 >> keyring4
expect_true diff -au keyring3 keyring4
+ expect_true ceph auth rm client.admin2
rm keyring[1234]
# (almost) interactive mode
Add command to rotate the permanent key of an entity. This avoids the need to delete / recreate the key when it is compromised, lost, or just scheduled for rotation. Fixes: https://tracker.ceph.com/issues/66509 Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
rzarzynski
approved these changes
Jun 22, 2024
| expect_true env CEPH_KEYRING=keyring3 ceph -n client.admin2 auth get client.admin2 | ||
| expect_true ceph auth get client.admin2 >> keyring4 | ||
| expect_true diff -au keyring3 keyring4 | ||
| rm keyring[1234] |
Member
Author
|
This PR is under test in https://tracker.ceph.com/issues/66609. |
Member
Author
This was referenced Jun 24, 2024
6 tasks
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jun 26, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
6 tasks
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jun 30, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jun 30, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 1, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 1, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 1, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a cephclient api support to rotate the cephx keys genrated by cephclient Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 9, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a new flag `--cephx-key-rotation` to rotate the cephx keys genrated by external python script, If we enable it new ceph user wil be created with `-rotated` added to the suffix Signed-off-by: parth-gr <partharora1010@gmail.com>
6 tasks
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 9, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a new flag `--cephx-key-rotation` to rotate the cephx keys genrated by external python script, If we enable it new ceph user wil be created with `-rotated` added to the suffix Signed-off-by: parth-gr <partharora1010@gmail.com>
parth-gr
added a commit
to parth-gr/rook
that referenced
this pull request
Jul 9, 2025
Ceph has a new ceph auth rotate command currently present in ceph:main. More: ceph/ceph#58121 Add a new flag `--cephx-key-rotation` to rotate the cephx keys genrated by external python script, If we enable it new ceph user wil be created with `-rotated` added to the suffix Signed-off-by: parth-gr <partharora1010@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e