Skip to content

About

USI (Uniform Software Identifier): an open notation and daily dictionary to name installed software and match it to CVEs. Mirrors Package URL, converts every NVD CPE name.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

USI — Uniform Software Identifier

USI names software, operating systems, firmware and hardware by what was built and which version, so that an inventory item can be matched to vulnerability data.

usi:<type>:<namespace>:<release>:<name>[:<version>][?<qualifiers>]

usi:-:-:-:curl:8.18.0                                 curl 8.18.0 as its publisher releases it
usi:deb:ubuntu:26.04:curl:8.18.0-1ubuntu2.8           the Ubuntu 26.04 package
usi:rpm:rhel:10:curl:8.12.1-9.el10_3                  the RHEL 10 package
usi:deb:debian:12:vim:2:9.0.1378-2+deb12u2          epochs need no escaping
usi:pypi:-:-:pycrypto:2.6.1                           a PyPI module
usi:-:-:-:fortios:7.4.3?hw=fortinet_fortigate_60f     a system on an appliance
usi:-:dell_latitude_7440:-:bios:1.14.0                firmware numbered per hardware model
usi:deb:*:*:libtimedate-perl:2.3300-2                 a pattern: distribution unknown

Why not CPE 2.3: the vendor field is unstable (acquisitions, typos, several vendors for one product), and CPE cannot name a distribution package, whose version and security status differ from the publisher's release.

Why not only Package URL: PURL names packages. It has no type for a product as its publisher numbers it, an operating system, a hardware model or its firmware. USI covers those and mirrors PURL exactly for packages: every USI of a package type converts to one PURL and back without loss.

Two levels

Observed identifier Product identifier
Type deb, rpm, pypi, appx, … -
Rule copy the installation record named once by the USI registry
Computed by any tool, no dictionary the registry

The dictionary links the two with typed relations (derived_from, source_package, rebuild_of, cpe, …) instead of a vendor field.

Status

Early draft. What exists: the identifier and its canonical form, the type table, the Package URL mirror (checked against PURL's own test cases), a CPE 2.3 projection, deb / rpm / apk version ordering (checked against the real tools) a resolver for Linux inventories, and a first dictionary: a daily synchronisation of distribution package indexes, the winget index and the NVD CPE dictionary, with a search command.

Product names have a status. A reviewed name was decided by a person in registry/products/ and never changes. Every other name is provisional: assigned by automatic rules from the NVD dictionary and winget, usable today, but a review may replace it. A replaced name is never reused and keeps leading to its product (registry/products/renamed.yaml), so an identifier written with it stays valid. Most names are provisional today; the search site and the static files show the status of each one.

Layout

Path Content
spec/semantics.md, grammar.abnf, projections.md The specification
spec/types.json Normative type table (generated from the PURL type definitions)
spec/vectors/ Conformance vectors: identifiers, projections, PURL tests, version ordering
registry/namespaces/ One file per distribution: os-release ID, release granularity, PURL vendor
registry/rules/origins.yaml Markers of third-party repositories
src/usi/ Reference implementation
registry/sources.yaml Public package indexes and feeds read by the daily synchronisation
tools/purl_types.py Regenerates the type table from the PURL specification
tools/vercmp_conformance.py Checks version ordering against dpkg, rpm and apk in containers

Use

pip install -e .[dev]
pytest

usi parse     "usi:deb:debian:12:vim:2:9.0.1378-2+deb12u2"
usi to-purl   "usi:rpm:rhel:10:curl:8.12.1-9.el10_3"
usi from-purl "pkg:deb/ubuntu/curl@8.18.0-1ubuntu2.8?distro=ubuntu-26.04"
usi match     "usi:deb:*:*:libtimedate-perl:2.3300-2" "usi:deb:debian:12:libtimedate-perl:2.3300-2"
usi to-cpe    "usi:-:-:-:firefox_esr:140.5.0?arch=x64&lang=fr"

usi sync                                    # read the public sources, update out/usi.sqlite
usi serve                                   # search site on http://127.0.0.1:8765/
usi search curl --version 8.5.0-2ubuntu10.6 --os Ubuntu --os-version 24.04
usi search "7-Zip 24.09 (x64 edition)" --version 24.9.0.0
usi export                                  # static site and files in out/site

Scan a machine

usi scan lists the identifiers of the software installed on the machine it runs on, as JSON or as a CycloneDX 1.6 SBOM (--format cyclonedx; the USI is a property of each component, next to its Package URL).

  • Linux (dpkg, rpm, apk): every package gets its identifier from the package database and /etc/os-release alone, with no dictionary.
  • Windows: the system with its full build number (usi:-:-:-:windows_11_24h2:10.0.26100.2033?arch=x64), the installed updates (usi:patch:microsoft:-:KB5044284), the Store packages, and the applications of the "Uninstall" registry keys. An application is only known by its display name, so naming it takes the dictionary: --db out/usi.sqlite, --data out/site, or --online (the public static files; only file numbers are requested, never names).

The output never contains the machine name or a user name. Without --online, nothing leaves the machine.

Single-file executables, which need neither Python nor the dictionary, are attached to each version release (.github/workflows/binaries.yml); build one locally with python tools/build_binary.py (requires pyinstaller).

Search site

usi serve opens a page where you type a product or package name the way you would say it ("firefox", "adobe reader", "openssl"). It proposes identifiers, lists the versions the dictionary knows for the one you pick, and builds the final identifier, also from a version typed by hand. Versions of PyPI, npm and Go packages are read from their registry on demand.

The same page works with no server at all: usi export writes it with the dictionary as static files (out/site), ready for GitHub Pages or any file host.

Static files

usi export spreads each table over small JSON files. The file of a key is the first hexadecimal digits of the SHA-256 of the key, so one request answers one question, from any language:

data/v1/manifest.json              format, date, digits per table, release names of each distribution
data/v1/<table>/<hex>.json.gz      {key: value}, gzip-compressed
data/v1/search/<ab>.json.gz        products with a word starting with "ab"
Table Key Value
cpe CPE 2.3 formatted name [usi, deprecated]
pair vendor:product [product name, namespace]
name name reduced to letters and digits product names
meta product (usi:-:-:-:curl) [label, class, NVD names, in winget]
ver product versions, updates per build, packages built from each version
cpen product CPE vendor/product patterns, CPE names per version
pkg deb:*:curl, gem:-:rails, npm:@angular:core versions per distribution release, product it belongs to
kb KB5044284 builds it brings, updates it replaces

Example in Python: hashlib.sha256(b"KB5044284").hexdigest()[:2] gives the file of kb to read (manifest.json says 2 digits for that table). Files are gzip-compressed, which keeps the site far below the 1 GB limit of GitHub Pages.

Daily update

usi sync is meant to run every day. The dictionary is append-only: a version that leaves a repository index stays in the dictionary. .github/workflows/daily.yml runs it on a schedule, then usi export; it publishes the full dictionary and the conversion table (cpe-usi.tsv.gz) as release assets, and deploys the search site to GitHub Pages without committing the data, so the history of the repository does not grow with it.

Data policy

This repository holds human decisions and public facts only. It never contains a string observed in an inventory. Inventory exports, resolved rows and provisional identifiers belong to a private overlay outside the repository.

Licence

Apache-2.0 for the whole repository: specification, tables, registry, vectors and code (LICENSE). spec/types.json and spec/vectors/purl.json derive from the Package URL specification, MIT (NOTICE, LICENSES/).

About

USI (Uniform Software Identifier): an open notation and daily dictionary to name installed software and match it to CVEs. Mirrors Package URL, converts every NVD CPE name.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages