Skip to content

[HLD] SSD Wipe - #2449

Open
ShauliTaragin wants to merge 1 commit into
sonic-net:masterfrom
ShauliTaragin:ssd-wipe-hld
Open

[HLD] SSD Wipe#2449
ShauliTaragin wants to merge 1 commit into
sonic-net:masterfrom
ShauliTaragin:ssd-wipe-hld

Conversation

@ShauliTaragin

@ShauliTaragin ShauliTaragin commented Jul 8, 2026

Copy link
Copy Markdown
Repo PR title state
sonic-platform-common [SED] Wipe SSD CLI GitHub issue/pull request detail
sonic-buildimage [Mellanox] [SED] Wipe SSD CLI GitHub issue/pull request detail
sonic-utilities [SED] Wipe SSD CLI GitHub issue/pull request detail

Summary

Adds the High-Level Design document for the SSD Wipe feature (config sed wipe-ssd), which securely erases the switch boot SSD in three sequential stages:

  1. Ramdisk pivot — relocate rootfs to tmpfs so the physical SSD can be unmounted while the OS keeps running.
  2. Crypto Erase (PSID Revert) — destroy the SED media encryption key via sedutil-cli (fast, key-based wipe).
  3. NVMe Block Erase — overwrite all user data blocks via nvme sanitize --sanact=0x02 (slower, NAND-level overwrite).

The feature extends the SED framework adding:

  • SedMgmtBase.wipe_ssd() + abstract get_psid()
  • ssd_erase.sh orchestrator (ramdisk pivot + crypto erase + block erase)
  • check_sed_crypto_erase_prereqs helper in the shared sed_pw_utils.sh
  • rsync added to the image (needed by the ramdisk pivot)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@benle7 benle7 left a comment

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.

LGTM

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Comment thread doc/sed/wipe_ssd_hld.md

### 7.3 CLI design

**Command:** `config sed wipe-ssd`

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.

Why is the command under "config".
This is not going to be a configuration. Its a one time execution. right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I put it under config as this feature extends the existing SED command group, which already provides the one-time config sed change-password and config sed reset-password operations. Keeping wipe-ssd in the same group provides a consistent SED management interface.

Comment thread doc/sed/wipe_ssd_hld.md
@bmridul

bmridul commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Was HLD discussed in SONiC community?

ShauliTaragin added a commit to ShauliTaragin/sonic-platform-common that referenced this pull request Aug 23, 2026
Add SedMgmtBase.wipe_ssd() and abstract get_psid() to provide
platform-agnostic support for wiping the switch SSD (crypto erase +
NVMe block erase). It will be used by the new relevant CLI.

We want to be able to securely wipe the switch SSD via SONiC CLI, for
example as part of RMA / decommission workflows.

HLD: sonic-net/SONiC#2449

Signed-off-by: Shauli Taragin <staragin@nvidia.com>
ShauliTaragin added a commit to ShauliTaragin/sonic-utilities that referenced this pull request Aug 23, 2026
Add a CLI to securely wipe the switch SSD (crypto + block erase).

The wipe-ssd command is added under the existing 'config sed' group,
using the platform chassis. It displays an irreversibility warning
prompt (bypassable with -y) and delegates to SedMgmt.wipe_ssd().

HLD: sonic-net/SONiC#2449
Depends on: sonic-net/sonic-platform-common#712

Signed-off-by: Shauli Taragin <staragin@nvidia.com>
Add the High-Level Design document for the SSD Wipe feature
(config sed wipe-ssd), which securely erases the switch boot SSD in
three sequential stages:

1. Ramdisk pivot - relocate rootfs to tmpfs so the physical SSD can be
   unmounted while the OS keeps running.
2. Crypto Erase (PSID revert) - destroy the SED media encryption key via
   sedutil-cli (fast, key-based wipe).
3. NVMe Block Erase - overwrite all user data blocks via
   nvme sanitize --sanact=0x02 (slower, NAND-level overwrite).

The feature extends the SED framework adding:

- SedMgmtBase.wipe_ssd() + abstract get_psid()
- ssd_erase.sh orchestrator (ramdisk pivot + crypto erase + block erase)
- check_sed_crypto_erase_prereqs helper in the shared sed_pw_utils.sh
- rsync added to the image (needed by the ramdisk pivot)

Builds on the SED framework from sonic-net#2171 (change/reset SED password).

Signed-off-by: Shauli Taragin <staragin@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

ShauliTaragin added a commit to ShauliTaragin/sonic-buildimage that referenced this pull request Aug 23, 2026
Support the SONiC CLI to securely wipe the SSD (crypto + block erase).

- Add ssd_erase.sh: bash orchestrator that pivots the OS to a tmpfs
  ramdisk, unmounts the boot SSD, then performs sedutil-cli PSID revert
  (crypto erase) followed by nvme sanitize --sanact=0x02 (block erase).
- Add sed_pw_utils.sh helper for SED prerequisite checks.
- Install rsync in the base image (required for the tmpfs pivot).

HLD: sonic-net/SONiC#2449
Depends on: sonic-net/sonic-platform-common#712

Signed-off-by: Shauli Taragin <staragin@nvidia.com>
@ShauliTaragin

Copy link
Copy Markdown
Author

Was HLD discussed in SONiC community?

Not yet. Presentation is in community slot tomorrow( September 1st)

ShauliTaragin added a commit to ShauliTaragin/sonic-buildimage that referenced this pull request Sep 1, 2026
Support the SONiC CLI to securely wipe the SSD (crypto + block erase).

- Add ssd_erase.sh: bash orchestrator that pivots the OS to a tmpfs
  ramdisk, unmounts the boot SSD, then performs sedutil-cli PSID revert
  (crypto erase) followed by nvme sanitize --sanact=0x02 (block erase).
- Add sed_pw_utils.sh helper for SED prerequisite checks.
- Install rsync in the base image (required for the tmpfs pivot).

HLD: sonic-net/SONiC#2449
Depends on: sonic-net/sonic-platform-common#712

Signed-off-by: Shauli Taragin <staragin@nvidia.com>
@avinothcgl

Copy link
Copy Markdown

The current design logs to journalctl on a tmpfs that does not survive the reboot that follows the wipe. For any deployment with audit or compliance requirements, the wipe operation should produce a persistent, structured sanitization report that outlives the erase.

Pre-Erase Snapshot: ssd_erase.sh should capture drive and OPAL state before any destructive operation begins. This data is unrecoverable after the PSID revert, so it must be collected in the prereq/preparation phase and held in a shell variable or temp file on the tmpfs. Fileds(Drive serial number,Drive model,Switch hostname,Chassis serial,SONiC version,Operator user, timestamp,etc )

Post-Erase Verification: after crypto_erase and block_erase both return, the drive and TPM are still queryable from the ramdisk. The script should collect Sanitize State, TPM bank state, etc

The boot SSD is wiped and the tmpfs disappears on reboot, so the report must be sent out of the box before the operator reboots. At least two independent channels syslog or printing in serial console should be supported to publish pre/post erase state .

Without a persistent sanitization report, there is no auditable proof that the wipe occurred, what it covered, or whether it succeeded. The ramdisk environment has everything needed to generate and deliver this report

@Yarden-Z

Yarden-Z commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The current design logs to journalctl on a tmpfs that does not survive the reboot that follows the wipe. For any deployment with audit or compliance requirements, the wipe operation should produce a persistent, structured sanitization report that outlives the erase.

Pre-Erase Snapshot: ssd_erase.sh should capture drive and OPAL state before any destructive operation begins. This data is unrecoverable after the PSID revert, so it must be collected in the prereq/preparation phase and held in a shell variable or temp file on the tmpfs. Fileds(Drive serial number,Drive model,Switch hostname,Chassis serial,SONiC version,Operator user, timestamp,etc )

Post-Erase Verification: after crypto_erase and block_erase both return, the drive and TPM are still queryable from the ramdisk. The script should collect Sanitize State, TPM bank state, etc

The boot SSD is wiped and the tmpfs disappears on reboot, so the report must be sent out of the box before the operator reboots. At least two independent channels syslog or printing in serial console should be supported to publish pre/post erase state .

Without a persistent sanitization report, there is no auditable proof that the wipe occurred, what it covered, or whether it succeeded. The ramdisk environment has everything needed to generate and deliver this report

The SSD erase is a general procedure to run a disk wipe and clean process.
Here we describe the overall process to ensure that disk erasure is performed and done gracefully.

The auditing process to ensure disk erasure mentioned here is one thing, other vendors/auditors might require additional data that is not depicted here. If we would like to expand this to conform with auditing requirements - then I think this is a separate feature where we define the auditing process.

One vendor might claim that the report is sent prior to reboot and another vendor will require this report remain persistent throughout the wipe process.

I believe that these 2 should not be coupled and if a customer would like to ensure erasure and the correct auditing process complacency - its on the customer's side to develop and deploy this on top of the SSD wipe functionality instead of trying to enforce a uniform approach here that is not entirely covered and not 100% defined.

@ShauliTaragin

Copy link
Copy Markdown
Author

The current design logs to journalctl on a tmpfs that does not survive the reboot that follows the wipe. For any deployment with audit or compliance requirements, the wipe operation should produce a persistent, structured sanitization report that outlives the erase.
Pre-Erase Snapshot: ssd_erase.sh should capture drive and OPAL state before any destructive operation begins. This data is unrecoverable after the PSID revert, so it must be collected in the prereq/preparation phase and held in a shell variable or temp file on the tmpfs. Fileds(Drive serial number,Drive model,Switch hostname,Chassis serial,SONiC version,Operator user, timestamp,etc )
Post-Erase Verification: after crypto_erase and block_erase both return, the drive and TPM are still queryable from the ramdisk. The script should collect Sanitize State, TPM bank state, etc
The boot SSD is wiped and the tmpfs disappears on reboot, so the report must be sent out of the box before the operator reboots. At least two independent channels syslog or printing in serial console should be supported to publish pre/post erase state .
Without a persistent sanitization report, there is no auditable proof that the wipe occurred, what it covered, or whether it succeeded. The ramdisk environment has everything needed to generate and deliver this report

The SSD erase is a general procedure to run a disk wipe and clean process. Here we describe the overall process to ensure that disk erasure is performed and done gracefully.

The auditing process to ensure disk erasure mentioned here is one thing, other vendors/auditors might require additional data that is not depicted here. If we would like to expand this to conform with auditing requirements - then I think this is a separate feature where we define the auditing process.

One vendor might claim that the report is sent prior to reboot and another vendor will require this report remain persistent throughout the wipe process.

I believe that these 2 should not be coupled and if a customer would like to ensure erasure and the correct auditing process complacency - its on the customer's side to develop and deploy this on top of the SSD wipe functionality instead of trying to enforce a uniform approach here that is not entirely covered and not 100% defined.

Additionally, I want to clarify that the current journal does survive the SSD unmount and erase. systemd-journald remains active in the ramdisk and records the operation through PSID revert, sanitize-status verification, and final completion. The operator is explicitly instructed to monitor the journal and reboot only after completion, allowing the execution record to be captured externally before reboot.
What does not survive is the local journal after reboot. Automatically generating and exporting a persistent structured audit report would be a separate auditing feature, as Yarden described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

7 participants