-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Security Cipher Module: Added password rotate feature and enabled Backup and Restore support for NOS Upgrades #22711
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
base: master
Are you sure you want to change the base?
Conversation
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw ms_conflict |
|
@qiluo-msft As per your comment, I have added pre/post migration scripts for Security Cipher module. |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@qiluo-msft please help me understand ms_conflict failure. I don't know why this is failing. |
|
@qiluo-msft @lguohan are there any further comments on this PR? If not, can we merge it and unblock this feature? @nmoray this is what the MS-Conflict says: I don't know what this check is for, but maybe just rebase and push again to re-run it and see if that resolves things? |
Yeah @anders-nexthop, I have already tried this option but no luck. |
…urity Cipher module. Additionally, now multiple modules of same feature type can make use of same password for generating their unique encrypted passkey. For instance, now multiple TACPLUS server can have their own passkey encrypted from the same password.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@anders-nexthop @qiluo-msft Please review the updated code and share the comments if any. |
anders-nexthop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, the rotation code is a good change.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
anders-nexthop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am approving this change, as I think this is a workable implementation and would like to see it move forward. However, please consider my point about separating encryption password handling from table registration.
@qiluo-msft can you take another look, or assign another reviewer to get more eyes on this latest version?
@bhouse-nexthop your thoughts would be welcome here given your security background.
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Thanks @anders-nexthop for the diligent review. |
|
/azp run Azure.sonic-buildimage |
|
Commenter does not have sufficient privileges for PR 22711 in repo sonic-net/sonic-buildimage |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@qiluo-msft please approve in case there are no more comments so that other dependent PRs can also be merged. |
|
@qiluo-msft will you please help in merging this PR in case there are no more comments? |
|
@qiluo-msft and @lguohan can we get this PR merged if there are no more comments? |
|
hi @qiluo-msft is this good to be merged? |
|
@qiluo-msft, please help approve if no other comments. |
|
@qiluo-msft @lguohan Besides wanting this for TACACS, there are two outstanding feature requests that are dependent on this basic infrastructure getting merged (#22276 and #22277), can we please get this reviewed by an authorized reviewer and merged up? |
|
do we have sonic-mgmt test to test this? |
|
@anders-nexthop , i will ask qiluo to take a look this PR. Thanks for your patience. |
| # Restore cipher_pass file from persistent storage | ||
| if [ -f /host/security_cipher/cipher_pass ]; then | ||
| cp /host/security_cipher/cipher_pass.json /etc/cipher_pass.json | ||
| chmod 640 /etc/cipher_pass.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| try: | ||
| with open(CIPHER_PASS_FILE, 'r') as f: | ||
| return json.load(f) | ||
| except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qiluo-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented
What I did it
Reference PR: Adding support of common security cipher module for encryption and decryption of a passkey #17201
Reference HLDs:
Now the module / application / feature who wants to use the security cipher module for encryption / decryption, it needs to first register with it by providing a callback function which will be responsible for updating the existing encrypted passkey in the CONFIG_DB table or which ever the storage media used. This way, all the registered parties will be notified and at the same time gets updated with the new password. The security cipher module keeps a list of all the callbacks and at the time of password rotation, it simply notifies and updates everyone one after the other.
How to verify it
Test Logs:
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Link to config_db schema for YANG module changes
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md