Skip to content

feat: rotate password for admin user from nvswitch#1609

Open
narasimhan321 wants to merge 1 commit into
NVIDIA:mainfrom
narasimhan321:nv/nvos-password-rotation
Open

feat: rotate password for admin user from nvswitch#1609
narasimhan321 wants to merge 1 commit into
NVIDIA:mainfrom
narasimhan321:nv/nvos-password-rotation

Conversation

@narasimhan321
Copy link
Copy Markdown
Contributor

@narasimhan321 narasimhan321 commented May 12, 2026

Description

  • Makes use of RMS API to rotate the default admin password and persists to vault.
  • Implement the rotate password logic to switch state machine init state.

Type of Change

    • Add - Complete rotate password state in switch state machine

Related Issues (Optional)

https://jirasw.nvidia.com/browse/RCKMANAGER-503

Testing

  • cargo unit test
  • 36x1 testing pending

Additional Notes

Flow

flowchart LR
    A[SwitchId + rack_id] --> N[NewNodeInfo]
    B[BMC MAC + BMC IP] --> BE[BmcEndpoint]
    C[NVOS MAC/IP] --> HE[HostEndpoint]
    D[Current NVOS credentials] --> HE
    BE --> N
    HE --> N
    N --> NS[NodeSet]
    NS --> REQ[UpdateSwitchSystemPasswordRequest]
    E[target username: admin] --> REQ
    F[target password from expected_switch.nvos_password] --> REQ

Loading

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 12, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@narasimhan321 narasimhan321 marked this pull request as ready for review May 12, 2026 23:08
@narasimhan321 narasimhan321 requested a review from a team as a code owner May 12, 2026 23:08
@github-actions
Copy link
Copy Markdown

@Matthias247
Copy link
Copy Markdown
Contributor

can you add a few more details to the commit message that describe what exactly this is doing?

@narasimhan321 narasimhan321 changed the title feat: switch admin password rotation to switch state machine feat: rotate password for admin user from nvswitch May 13, 2026
@narasimhan321
Copy link
Copy Markdown
Contributor Author

can you add a few more details to the commit message that describe what exactly this is doing?

Updated the Title and description of the PR to reflect the functionality of this PR

@narasimhan321 narasimhan321 added the rack lifecycle Issues that relate to managing the lifecycle of a full rack (compute, switches and powershelves) label May 14, 2026
@narasimhan321 narasimhan321 force-pushed the nv/nvos-password-rotation branch from f99f0a6 to becb288 Compare May 14, 2026 12:46
@vinodchitraliNVIDIA
Copy link
Copy Markdown
Contributor

Is there CM api to rotate password ?

.push_back(response);
}

pub async fn queue_update_switch_system_password_response(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any idea why its queue_ ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

switch_system_password_responses looks good !


let key = CredentialKey::SwitchNvosAdmin { bmc_mac_address };

if let Ok(Some(Credentials::UsernamePassword { .. })) =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This code is still required !


let current_credentials = match current_credentials {
Some(Credentials::UsernamePassword { username, password }) => {
if username == NVOS_ADMIN_USERNAME && password == target_password {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lets take this user name from expected_switch table

{
(Some(username), Some(password)) => (username, password),
_ => {
let target_password = match expected_switch.nvos_password.clone() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ARe we taking password to be changed from expected_switch ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It should site wide unique password stored in vault for now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes its reading from expetced_switch instead from vault. will change this to read from vault.
Now persisting the initial vault password was part of site exploration ?

@narasimhan321
Copy link
Copy Markdown
Contributor Author

Is there CM api to rotate password ?

looked at component-manager and it has credential reads and endpoint construction but no password rotation support.


use carbide_uuid::switch::SwitchId;
use forge_secrets::credentials::{CredentialKey, Credentials};
use librms::protos::rack_manager as rms;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We need to rework this PR to make sure the state machine is calling component manager APIs and not RMS directly ... otherwise it will cause failures in the non-RMS deployments.

The non-RMS implementation in component manager should just be NOP

@zhaozhongn zhaozhongn self-requested a review May 17, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rack lifecycle Issues that relate to managing the lifecycle of a full rack (compute, switches and powershelves)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants