loongshield rpm verifies installed package files against a remote SPDX SBOM. The command is intended for operators and integrators; verification internals are documented separately.
The built-in default URL template targets the OpenAnolis / Alibaba Cloud Linux SBOM service. If your packages come from another repository, pass --sbom-url explicitly.
loongshield rpm --verify <package> [options]
- Reads the installed package version, release, and architecture from the RPM database.
- Builds an SBOM URL from the configured template.
- Downloads the SPDX JSON SBOM.
- Hashes installed files and compares them with SBOM checksums.
-v,--verify <package>--sbom-url <template>--verify-config--verbose--log-level <trace|debug|info|warn|error>-h,--help
{name}{version}{release}{arch}{name_first}
Default template:
https://anas.openanolis.cn/api/data/SBOM/RPMs/{name_first}/{name}-{version}-{release}.{arch}.rpm.spdx.json
For Fedora, local mirrors, private RPM repos, or any non-Anolis source, override the template with --sbom-url.
- Stable within a major release: documented flags, documented exit codes, and the documented URL template variable names.
- Human-readable verification output, mismatch wording, and verbose log formatting are not machine-readable APIs.
- The built-in SBOM URL template is a convenience default and may change between compatible releases. Automation that needs a fixed remote source should pass
--sbom-urlexplicitly. - If a release changes documented CLI behavior or template variables incompatibly, it should use a new major version.
0: all verified files matched.1: package lookup, network, parse, or runtime error.2: checksum mismatches were found.
loongshield rpm --verify bash
loongshield rpm --verify nginx --verify-config
loongshield rpm --verify curl --sbom-url "http://localhost:8080/{name}.json"- This command requires an installed RPM package and network access to the SBOM source.
- The default template is ecosystem-specific; it is not a generic lookup service for every RPM distribution.
- Packages without published SBOMs will usually fail with a fetch error such as HTTP 404.
- Config files are skipped by default unless
--verify-configis set.
- Verification design: ../design/rpm-verification-design.md