-
Notifications
You must be signed in to change notification settings - Fork 86
NC | CLI | List Accounts When Decrypt Access Keys Fails #8781
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
Merged
shirady
merged 1 commit into
noobaa:master
from
shirady:nc-list-accounts-missing-master-key
Feb 17, 2025
Merged
NC | CLI | List Accounts When Decrypt Access Keys Fails #8781
shirady
merged 1 commit into
noobaa:master
from
shirady:nc-list-accounts-missing-master-key
Feb 17, 2025
Conversation
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
naveenpaul1
reviewed
Feb 13, 2025
9e9c365
to
a35f4f9
Compare
romayalon
reviewed
Feb 16, 2025
src/test/unit_tests/jest_tests/test_nc_account_invalid_mkm_integration.test.js
Show resolved
Hide resolved
f4dc8ff
to
6b029e9
Compare
romayalon
reviewed
Feb 17, 2025
6b029e9
to
bfa4dba
Compare
romayalon
approved these changes
Feb 17, 2025
1. In account list add additional option of return_encrypted_on_decryption_error and we will neither return the secret_key nor the encrypted_secret_key in case of failure of access keys decryption. 2. In the function get_identity_config_data add a case in try-catch clause for the decryption failure and add the property of decryption_err in case there was failure of access keys decryption that is related to INVALID_MASTER_KEY and remove the encrypted_secret_key property (added a helper function for that). 3. Small refactors in file test_nc_account_invalid_mkm_integration.test.js so we can add additional account and rename the file master_keys.json for the test. Signed-off-by: shirady <[email protected]>
bfa4dba
to
6f63da5
Compare
@romayalon , yes, I fixed the wrong link in the PR description, thanks. |
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.
Explain the changes
return_encrypted_on_decryption_error
and we will neither return thesecret_key
nor theencrypted_secret_key
in case of failure of access keys decryption.get_identity_config_data
add a case in try-catch clause for the decryption failure and add the property ofdecryption_err
in case there was failure of access keys decryption that is related toINVALID_MASTER_KEY
and remove theencrypted_secret_key
property (added a helper function for that).test_nc_account_invalid_mkm_integration.test.js
so we can add additional account and rename the filemaster_keys.json
for the test.Issues:
Testing Instructions:
Automatic Tests:
Please run:
sudo npx jest test_nc_account_invalid_mkm_integration.test.js -t 'cli with renamed master key file'
npx jest test_config_fs.test.js -t 'remove_encrypted_secret_key'
Manual Tests
sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /Users/buckets/ --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>
Note: before creating the account need to give permission to the
new_buckets_path
:chmod 777 /Users/buckets/
.master_key.json
:sudo mv /etc/noobaa.conf.d/master_keys.json /etc/noobaa.conf.d/temp_master_keys.json
sudo node src/cmd/manage_nsfs account list --wide --show_secrets
(should not fail, but you will see the propertyencrypted_secret_key
anddecryption_err
).sudo node src/cmd/manage_nsfs account status --name <account-name> --show_secrets
(will fail - we didn't handle this case).Before this fix we had this error (added partial output):