Skip to content

fix: AMI scan discovers attached disk via lsblk (Nitro NVMe) — vet#32 - #39

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/nitro-nvme-device-discovery
Jun 25, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/nitro-nvme-device-discovery

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Live-validation fix for the slice-5 remote scan script.

The bug (found by live validation)

Running vet ami-scan against a real AL2023 AMI failed at mount:

special device /dev/sdfp1 does not exist

On Nitro instances, an EBS volume attached as /dev/sdf surfaces as an NVMe device (/dev/nvme1n1). The remote script guessed partitions from the requested name (${DEV}1 / ${DEV}p1), which doesn't exist on Nitro.

The fix

The remote script now discovers the freshly-attached disk via lsblk — the whole-disk (TYPE=disk) with no mountpoint and no mounted partitions (i.e. not the running root disk) — and mounts its largest partition read-only. The requested --device is a hint/log only.

Verified live on the same AMI after the fix:

scanning /dev/nvme1n1p1 (requested /dev/sdf)  →  mount → syft → Success

→ a real 1549-component CycloneDX SBOM (with AL2023 amzn distro metadata) uploaded to S3, then full teardown verified clean. vet#32's pipeline is now live-proven end to end.

Test

Regression assertion in ssm_scanner_test.go: the script must use lsblk discovery and must not name-guess partitions from the requested device. Full suite green.

Bonus confirmation from the same live run: on the pre-fix failure, vet's deferred release still detached + deleted the scan volume (zero leak) — the slice-4 teardown guarantee, proven against real AWS.

Note: gofmt flags internal/sign/sign.go on the current toolchain — pre-existing drift, untouched here.

…t#32

Live validation against a real AL2023 AMI found the remote mount failing with
"special device /dev/sdfp1 does not exist": on Nitro instances an EBS volume
attached as /dev/sdf surfaces as an NVMe device (/dev/nvme1n1), so the script's
${DEV}1/${DEV}p1 name-guessing was wrong.

The remote script now discovers the freshly-attached disk via lsblk (the
unmounted whole-disk that isn't the running root) and mounts its largest
partition read-only; the requested --device is a hint/log only. Re-run confirmed
live: "scanning /dev/nvme1n1p1 (requested /dev/sdf)" -> mount -> syft -> Success,
producing a 1549-component CycloneDX SBOM.

Regression test asserts the script uses lsblk discovery and does not name-guess
partitions from the requested device.
@scttfrdmn
scttfrdmn merged commit b7cb256 into main Jun 25, 2026
2 checks passed
@scttfrdmn
scttfrdmn deleted the fix/nitro-nvme-device-discovery branch June 25, 2026 23:06
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.

1 participant