NixOS Turns Vulnerability Triage Into Code
The Unreasonable Effectiveness of Vex in NixOS
LLM-assisted vulnerability reports are flooding maintainers and security teams. VEX statements can help, but manual triage doesn't scale. In NixOS, configuration is code, so you can codify the conditions under which a CVE doesn't affect your system and automatically generate VEX statements. The author built nixos-vex to do exactly that, and shows how it reduced 272 Grype findings to 271 by conditionally ignoring CVE-2007-2768.
Once a CVE has been triaged and codified, the cost to re-check is close to zero (a little bit of CI overhead).
- codethief
Has anyone here tried sbomnix together with grype? How well does it work? Last time I looked into vulnerability checking for Nix, stuff seemed rather unreliable, though I'm not sure I looked into sbomnix (or it already existed at the time).
- rendaw
This was really interesting, but very hard to follow. I may be slightly outside of this space, but I would have liked a little bit more explanation. I felt like this was skipping a lot of motivations, goals, and steps.
Actually, reading it again from the bottom up, it sounds like this is the thought flow:
1. You want to know if your os is vulnerable
2. You need a vex feed (sbom? the vulnerability report itself?) for your os
3. sbomnix provides a mechanism for getting sbom from a flake, but not a full os, and that can be compared to the advisories. But here it reports a false positive.
4. (Logical jump: we can use vex as an additional layer to disable irrelevant advisories based on system config) Here's an example of adding a vex (edit: not-)vulnerability report to a package conditional on config (sshd)
5. `nixos-vex` is a module to make it easier to integrate these reports (removing the boilerplate from the example)
Maybe this is a TLDR?
- sbomnix already provides package sbom in standard format which produces a conservative set of reports (superset) for a system
- `nixos-vex` provides a mechanism for integrating conditional vulnerability reports into nix packages
- Someone (also nixos-vex?) starts adding vulnerability reports to existing modules like ssh
- Combine them to get full coverage
I guess the comparison to govulncheck was that this is also like reachability analysis, but this is completely different - reachability analysis is calculatedly correct. This requires hand […]