AssetScriber is a shell script designed to generate Software Bill of Materials (SBOMs) for local and remote Linux systems. It uses Anchore's syft to perform the scans and is built to be as non-intrusive as possible, with a strong emphasis on running without installing any software on remote targets.
- Multiple Scan Modes: Choose between scanning a specific path, scanning for OS packages only, or performing a full system scan.
- Zero Remote Installation: To scan a remote machine, the script transfers the target filesystem to the local machine using
rsyncand scans it locally. No agent or software is installed on the remote host. - Automatic Dependency Management: Downloads
syftandjqto a local./bindirectory if they are not found on the system. It can also use pre-downloaded binaries for offline use. - Consolidated Output: Generates a detailed CycloneDX JSON SBOM for each target and a master CSV file consolidating all discovered packages.
- Network Discovery: Can use
nmapto discover other hosts on the local network and attempt to scan them. - Robust Status Reporting: Logs all actions, warnings, and skips to a
status_report.logfile, providing a clear audit trail.
The script attempts to be self-sufficient but relies on a few common tools. It will log an error and skip the relevant task if a tool is not found.
curl: (Optional) Required for the automatic download ofsyftandjq.ssh: (Required for remote scans).nmap: (Optional) Required only for the network discovery feature (-d).sshpass: (Optional) Required only for password-based authentication to remote hosts.
The script operates in one of three modes, determined by the flags you provide. These modes are mutually exclusive in what they target.
Scans a specific directory.
- Trigger:
-p, --path <path> - Example:
./asset-scriber.sh -p /var/www - Details: Scans only the
/var/wwwdirectory. You can add--os-onlyto filter the results for OS packages found within that path.
Scans the entire system but only reports packages installed by the OS package manager (e.g., rpm, deb).
- Trigger:
--os-only(used without the-pflag) - Example:
sudo ./asset-scriber.sh --os-only - Details: This is useful for getting a quick inventory of just the base system packages.
Scans the entire filesystem for all types of packages (OS, Python, Node.js, etc.).
- Trigger: No flags, or only
-cor-d. - Example:
sudo ./asset-scriber.sh - Details: This is the most comprehensive scan mode.
The selected mode applies to all remote hosts specified with the -c flag.
sudo ./asset-scriber.sh -c hosts.conf -p /etcwill scan/etcon all remote hosts.sudo ./asset-scriber.sh -c hosts.conf --os-onlywill perform an OS-only scan on all remote hosts.sudo ./asset-scriber.sh -c hosts.confwill perform a full system scan on all remote hosts.
-c, --config <file>: Specifies a configuration file of remote hosts to scan.-d, --discover: Discovers hosts on the local network. The scan mode (--os-onlyor Full) will be applied to them. The-pflag is ignored in discovery mode.-h, --help: Displays the help message.
- Disk Space: Remote scanning can consume a significant amount of local disk space because it temporarily copies the remote filesystem.
- Permissions: For full system scans or OS-only scans, the script should be run with
sudo. For remote scans, the SSH user needssudoor root access to read all files. - Offline Mode: To run without internet, place pre-downloaded
syftandjqbinaries in a./bindirectory next to the script.
All output is placed in the asset_scriber_output/ directory:
status_report.log: A detailed log of all operations.sbom_<hostname>.json: A CycloneDX JSON SBOM for each scanned host.master_asset_list.csv: The final, consolidated CSV report with the headerhostname,distro,name,version,package.