Export an SBOM of a server
Write a CycloneDX or SPDX package inventory, inspect incomplete scans, and hand the sensitive file to another scanner.
At the end, you will have the server's package inventory as CycloneDX or SPDX JSON, written to a file or to stdout.
The file holds the server's package inventory. Treat it as sensitive and keep it under administrator control.
Before you start
- Use a Linux server with the shld binary installed. The export does not need the agent service.
- Use shld
v0.1.0-pilot.20261110.3or later, the first release tag that containsshld sbom. Runshld versionto check; older binaries do not have the command. - Choose a private output path when you write a file.
- Install another scanner when you want a second review.
Steps
- Export the server inventory as CycloneDX 1.6 JSON.
shld sbom --root / --output inventory.json
The command writes inventory.json with mode 0600. Each package entry includes its package URL, version, and manifest or install path within the selected root. Run shld sbom without --output to write the CycloneDX document to stdout instead. To export another directory, give its path to shld sbom --root.
- Select an SPDX 2.3 JSON document when the receiving tool needs SPDX.
shld sbom --root / --format spdx --output inventory.spdx.json
- Review stderr for packages without an expressible package URL. shld skips those packages and counts them in a warning.
- Send the file to another scanner only after you review its contents.
grype sbom:inventory.json
The export needs no agent, state directory, or network. shld sends no inventory off the server.
If something goes wrong
- Exit
0means the scan completed and the export finished. - Exit
1means an invocation or input/output error stopped the export. Check the command and the output path, then run it again. - Exit
2means the inventory is incomplete. shld still writes the SBOM, and stderr names affected paths and reasons. Review those paths before you hand the file to another scanner. - A package lacks an expressible package URL. shld skips that package and reports the count on stderr.
- The output path is a symlink. shld refuses the target. Choose a regular private path.