Skip to content

[DON'T- MERGE]Add the design for the API to help rotate secret. #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

reasonerjt
Copy link
Contributor

It decrypt the data with the old key and encrypt using the new key

It decrypt the data with the old key and encrypt using the new key

Signed-off-by: Daniel Jiang <[email protected]>
@reasonerjt reasonerjt requested review from a team as code owners February 19, 2025 13:03
@reasonerjt reasonerjt assigned wy65701436 and stonezdj and unassigned zyyw Feb 19, 2025
Copy link
Member

@Vad1mo Vad1mo left a comment

Choose a reason for hiding this comment

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

good thing to have

mentioned. If the API is called with `skip_oidc_secret` set to `true`, the OIDC secrets will not be usable after the secret key is
updated, and the user will need to manually update the OIDC secret via Harbor's UI.

### Implementation
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, I found an issue when testing the code.
Harbor has been using AES256-CFB to encrypt/decrypt the data, and if the user provides an incorrect key as "current_secret_key" to decrypt the data, there seems no good way to detect it. Therefore, if the user passes a wrong key when calling the API, the wrong data will be persisted and it will be very hard to recover.

This seems a bit too dangerous even though we expect it to be used only by system admin.

@reasonerjt reasonerjt changed the title Add the design for the API to help rotate secret. [DON'T- MERGE]Add the design for the API to help rotate secret. Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants