A QNX 8.0 image for QEMU, plus three files that describe it:
sbom.json, a CycloneDX 1.6 SBOM in which every file points back to the buildfile line that put it in the image;sbom.manifest, the list of hashes that the device checks itself against;vex.json, the image's known CVEs, each marked by whether the device actually loads the vulnerable code./proc//ctl and use them as evidence in VEX.qemu-system-x86_64, ssh, Python 3.10 or newergit clone https://github.com/emilhuseyn/qbom.git
cd qbom
sudo apt install -y python3-venv # Ubuntu 24.04 does not ship it by default
python3 -m venv ~/qbom-venv && . ~/qbom-venv/bin/activate
pip install .
qbom --version
You should see qbom 0.1.0. qbom is plain Python with no dependencies. The repository also holds sbomd, the resource manager that runs on the target, and two small demo programs.
Set up the SDP and an SSH key for the target's root user:
source ~/qnx800/qnxsdp-env.sh
[ -f ~/.ssh/id_ed25519 ] || ssh-keygen -q -t ed25519 -N '' -f ~/.ssh/id_ed25519
Build sbomd and the demo pump controller with qcc:
make -C target/sbomd
qcc -Vgcc_ntox86_64 -O2 -Wall -o demo/pumpd/pumpd demo/pumpd/pumpd.c -lz -lslog2
mkqnximage reads extra files and boot commands from local/snippets. Put both programs in the IFS, and start them after the file systems are mounted:
mkdir -p ~/qbom-vm/local/snippets && cd ~/qbom-vm
cat > local/snippets/ifs_files.custom <<EOF
[perms=0555] sbomd=$OLDPWD/target/sbomd/build/x86_64/sbomd
[perms=0555] pumpd=$OLDPWD/demo/pumpd/pumpd
[type=link] /usr/libexec/sshd-auth=/system/bin/sshd-auth
EOF
echo 'bin/sshd-auth=usr/libexec/sshd-auth' > local/snippets/system_files.custom
cat > local/snippets/post_start.custom <<'EOF'
/proc/boot/sbomd -d -i 10
waitfor /dev/sbom/status 5
/proc/boot/pumpd &
EOF
mkqnximage --type=qemu --arch=x86_64 --hostname=qbom --ssh-ident=$HOME/.ssh/id_ed25519.pub --build
The sshd in QNX 8.0 is OpenSSH 10. It starts a separate sshd-auth helper, so the snippets add it.
Boot the image. The command below uses QEMU's user-mode network, which needs no bridge, and forwards the target's SSH port to 2222 on the host:
qemu-system-x86_64 -daemonize -pidfile output/qemu.pid -display none -serial file:console.log \
-m 1G -smp 2 --enable-kvm -cpu host -drive file=output/disk-qemu.vmdk,if=ide \
-netdev user,id=n0,hostfwd=tcp:127.0.0.1:2222-:22 -device virtio-net-pci,netdev=n0 \
-kernel output/ifs.bin
alias target='ssh -q -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@127.0.0.1'
target uname -a
QNX qbom 8.0.0 2026/06/05-16:26:03EDT x86pc x86_64
mkqnximage leaves the buildfiles it used in output/build: ifs.build for the IFS, and system.build for the system partition. qbom reads both, the same way mkifs and mkqnx6fsimg do:
qbom build ifs=output/build/ifs.build system=output/build/system.build \
--ifs-image ifs=output/ifs.bin --mount system=/system --cwd . \
--name qbom-demo --version 0.1 -o sbom.json --spdx sbom.spdx.json
qbom: 202 files, 85 packages, 37 started at boot, 3 unresolved NEEDED, 0 warnings
Here is pumpd in sbom.json, shortened:
{
"type": "file",
"bom-ref": "file:ifs:/proc/boot/pumpd",
"name": "/proc/boot/pumpd",
"hashes": [{"alg": "SHA-256", "content": "dda4c54d7b609518ea6443c8d3ac3c70515a652b29d650457255a87867efba98"}],
"properties": [
{"name": "qbom:buildfile", "value": "output/build/ifs.build:197"},
{"name": "qbom:host-path", "value": "/home/you/qbom/demo/pumpd/pumpd"},
{"name": "qbom:hash", "value": "as-built"},
{"name": "qbom:sha256.source", "value": "56312647461c258cb11f85069e4f8c01fc3fa78b8327357c0ac1b930101aa724"},
{"name": "qbom:elf.needed", "value": "libz.so.2,libslog2.so.1,libc.so.6,libgcc_s.so.1"},
{"name": "qbom:started-by", "value": "system:/system/etc/startup/post_startup.sh:9 (shell)"}
]
}
The two hashes differ. The first is what the IFS stores, and the second is the file qcc wrote.
Three options matter on a real image:
--ifs-image: mkifs strips debug data from ELF files, so the IFS does not hold the host file's bytes. qbom reads the built IFS back with the SDP's dumpifs and records the stored hash. The host file's hash stays in the SBOM as provenance.--mount system=/system: paths in a partition buildfile, absolute ones too, are relative to where the partition is mounted.--cwd: mkqnximage writes host paths relative to its own directory."37 started at boot" counts more than the IFS boot script. The script runs /proc/boot/startup.sh, and that runs post_startup.sh, and so on. qbom follows those shell scripts. Each program says which file and line started it (the qbom:started-by property):
qbom started sbom.json | grep -E 'sshd|sbomd|pumpd'
/system/bin/sshd ifs:/proc/boot/startup.sh:63 (shell)
/proc/boot/sbomd system:/system/etc/startup/post_startup.sh:7 (shell)
/proc/boot/pumpd system:/system/etc/startup/post_startup.sh:9 (shell)
If your image boots with SLM (mkqnximage --slm=yes), qbom reads the SLM configuration instead. Each component is recorded with its file, line and dependencies, for example ifs:/proc/boot/slm.cfg:101 (slm ssh), ssh after network-init.
sbomd is already running: post_start started it. It is a resource manager with three names:
target ls -l /dev/sbom
-rw------- 1 root root 0 2026-11-03 22:04 expected
-r--r--r-- 1 root root 0 2026-11-03 22:04 inventory
-r--r--r-- 1 root root 0 2026-11-03 22:04 status
Give it the build's manifest. The manifest is in sha256sum format, so you can read it with any text tool:
qbom manifest sbom.json > sbom.manifest
target 'cat > /dev/sbom/expected' < sbom.manifest
target cat /dev/sbom/status
OK 192
One line in the manifest looks different: #present /proc/boot/procnto-smp-instr. procnto runs in place from the IFS, and its pages change while it runs. Hashing it would report a drift every time, so sbomd checks only that it exists.
sbomd re-checks every 10 seconds (-i 10) and writes each change of state to slog2:
target slog2info -b sbomd
sbomd: manifest loaded, 192 entries
sbomd: OK, 192 files match
Append one line to a binary in the system partition, and start a program that no SBOM lists:
target 'echo "# patched" >> /system/bin/curl'
qcc -Vgcc_ntox86_64 -o miner miner.c # any small program
target 'cat > /data/home/root/miner; chmod +x /data/home/root/miner; /data/home/root/miner &' < miner
sleep 12; target cat /dev/sbom/status
DRIFT 1
changed /system/bin/curl expected 00b2913917104ba5... actual a5f71a584d6b8297...
The status file shows only files. The inventory also lists what each process runs and maps. Compare it with the SBOM on the host:
target cat /dev/sbom/inventory > inv.json
qbom verify sbom.json inv.json; echo "exit $?"
qbom-demo 0.1: 192 files checked on qbom, 24 processes
CHANGED /system/bin/curl content differs from the build
UNKNOWN-PROCESS /data/home/root/miner pid 790552 runs a binary the SBOM does not list
exit 2
Exit code 2 means drift, so a test bench can fail on it.
The QNX open-source repository at repo.oss.qnx.com carries curl, OpenSSL, libxml2 and hundreds more as apk packages. Install a few into a directory on the host, with the repository's signing key:
apkroot() { # apkroot DIR PACKAGES...
local R=$1; shift
mkdir -p $R/etc/apk/keys $R/lib/apk/db $R/var/cache/apk $R/tmp
curl -so $R/etc/apk/keys/qnxosd.rsa.pub https://repo.oss.qnx.com/keys/qnxosd.rsa.pub
for v in 8.0.5 8.0.4 8.0.3; do echo https://repo.oss.qnx.com/$v/core; echo https://repo.oss.qnx.com/$v/extra; done \
> $R/etc/apk/repositories
for v in qnx-io-sock qnx-crypto qnx-io-sock-dev; do apk --root $R --arch x86_64 --initdb -U -q add --virtual $v; done
apk --root $R --arch x86_64 --no-scripts add "$@"
}
apkroot ~/apkroot libcurl curl libxml2 # goes into the image
apkroot ~/apkdev curl-dev # headers and link libraries, stays on the host
The virtual packages stand in for parts of the SDP that the packages depend on and the image already has. The release directories are incremental, so list all three.
Build the demo uplink, which sends pumpd's telemetry with libcurl, and add it to ifs_files.custom and post_start.custom like pumpd:
D=~/apkdev
qcc -Vgcc_ntox86_64 -O2 -I$D/usr/include -L$D/usr/lib -Wl,-rpath-link,$D/usr/lib \
-o $OLDPWD/demo/uplinkd/uplinkd $OLDPWD/demo/uplinkd/uplinkd.c -lcurl -lslog2
Put them in the system partition the way QNX lays them out (the root's usr/ is /system), rebuild, boot, and build the SBOM with the package database:
python3 $OLDPWD/demo/apkroot_to_build.py ~/apkroot > local/snippets/system_files.custom.apk
mkqnximage --build
qbom build ifs=output/build/ifs.build system=output/build/system.build --ifs-image ifs=output/ifs.bin \
--mount system=/system --cwd . --apk-installed ~/apkroot/lib/apk/db/installed \
--apk-map /usr=/system --apk-map /etc=/system/etc --apk-map /lib/apk=/system/lib/apk -o sbom.json
warning: output/build/system.build:341: /system/lib/libcurl.so.12 belongs to apk libcurl 8.23.0-r0 by the
database, but the image takes it from ${QNX_TARGET}/x86_64/usr/lib/libcurl.so.12
The system partition already has a lib/libcurl.so.12. mkqnx6fsimg keeps the first entry for a path, so the package's copy never reached the disk. qbom checks each file against the checksum in the apk database and names the real source. A scanner that trusts the database would report libcurl 8.23.0. Ask the program instead: the demo's uplinkd prints its libcurl version, and it is the SDP's.
There is a second rule. LD_LIBRARY_PATH from the IFS puts /proc/boot first, so a libcrypto there wins over one in /system/lib. qbom resolves each NEEDED entry in that order, as ldqnx does.
To run the ports, give them their own directory and start the program with its own path:
python3 $OLDPWD/demo/apkroot_to_build.py --prefix opt/qports ~/apkroot > local/snippets/system_files.custom.apk
# in post_start.custom:
LD_LIBRARY_PATH=/system/opt/qports/lib:/proc/boot:/system/lib /proc/boot/uplinkd &
Build the SBOM with --apk-map /usr=/system/opt/qports --apk-map /etc=/system/opt/qports/etc. qbom reads the LD_LIBRARY_PATH= in front of the command and resolves that program's libraries with it. On the device:
uplinkd: started, http://10.0.2.2:8088/telemetry every 15 s, libcurl/8.23.0 OpenSSL/3.6.3 zlib/1.3.1.zlib-ng ...
The image now holds two copies of libssl.so.3. Ask qbom which one can run, and add the device's inventory:
target cat /dev/sbom/inventory > inv.json
qbom why sbom.json libssl.so.3 --inventory inv.json
/system/lib/libssl.so.3 (com.qnx.qnx800.target.security.crypto.openssl3 ..., sdp; system.build:340)
nothing started at boot runs it or needs it
device no process had it mapped
/system/opt/qports/lib/libssl.so.3 (libssl3 3.6.3-r0, apk; system.build:379)
started system:/system/etc/startup/post_startup.sh:11 (shell) LD_LIBRARY_PATH=/system/opt/qports/lib:/proc/boot:/system/lib
runs /proc/boot/uplinkd
needs /system/opt/qports/lib/libcurl.so.12
needs /system/opt/qports/lib/libssl.so.3
mapped pid 294933 /proc/boot/uplinkd
The static answer, from the buildfiles, and the device's answer, from /proc, agree.
qbom vex sbom.json --inventory inv.json -o vex.json --openvex openvex.json
qbom report sbom.json --vex vex.json --inventory inv.json -o report.html
qbom asks NVD about the open-source packages only. QNX SDP components are listed in the SBOM but never scored. Every verdict carries its evidence. Here is the same image with the ports from the 8.0.3 and the 8.0.5 repositories (NVD as of 4 Nov 2026):
8.0.3 ports | 8.0.5 ports | |
package/CVE pairs | 238 | 66 |
loaded by a running process ( | 164 | 47 |
libcurl, loaded by uplinkd | 43 | 0 |
libxml2, nothing loads it | 15, not affected | 9, not affected |
An in_triage statement names the process:
/system/opt/qports/lib/libssl.so.3 mapped by pid 294933 /proc/boot/uplinkd
A not_affected statement says why, and when that was true:
code_not_reachable: no process maps /system/opt/qports/lib/libxml2.so.16.1.3
(inventory 2026-11-03T22:38:27Z on qbom)
With the naive layout from the previous step, every libcurl CVE becomes not_affected / code_not_present: the package's files are not in the image. The SDP's own libcurl runs instead, and its vendor assesses it.
Put two checks in CI and on the test bench:
qbom build ... --strict # exit 1 if a host file or a NEEDED library is missing from the image
qbom verify sbom.json inv.json # exit 2 if the device drifted from the build
qbom diff old/sbom.json new/sbom.json -o diff.json
--strict catches an image that will not run before you flash it. For example, a program whose library is not in the image shows up as missing library: /system/opt/qports/bin/iconv needs libintl.so.8, not in the image. Keep sbom.json, sbom.spdx.json and vex.json with each release.
You now ship an SBOM that names the buildfile line behind every file. The device checks itself against it. The VEX says which CVEs sit in code that runs, with the process that runs it as evidence.
Next steps:
qbom mcp sbom.json --vex vex.json --inventory inv.json.demo/run-demo.sh to repeat this whole codelab in one command.