Repository navigation
fix: AMI scan discovers attached disk via lsblk (Nitro NVMe) — vet#32 - #39
Merged
Merged
Conversation
…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.
4 tasks
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
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.
Live-validation fix for the slice-5 remote scan script.
The bug (found by live validation)
Running
vet ami-scanagainst a real AL2023 AMI failed at mount:On Nitro instances, an EBS volume attached as
/dev/sdfsurfaces 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--deviceis a hint/log only.Verified live on the same AMI after the fix:
→ a real 1549-component CycloneDX SBOM (with AL2023
amzndistro 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 uselsblkdiscovery 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.