mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-08-21 18:55:47 +02:00
cb74a5744f
Signed-off-by: Hadi <hadi@example.fr>
28 lines
855 B
Nix
28 lines
855 B
Nix
# Vulnix scans the Nix store against the NVD CVE feed to find packages with
|
|
# known vulnerabilities.
|
|
{pkgs, ...}: {
|
|
environment.systemPackages = [pkgs.vulnix];
|
|
|
|
systemd.services.vulnix-scan = {
|
|
description = "Scan the system closure for known vulnerabilities (vulnix)";
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = "${pkgs.vulnix}/bin/vulnix --system --cache-dir /var/cache/vulnix";
|
|
CacheDirectory = "vulnix";
|
|
# vulnix exits non-zero when it finds vulnerabilities; that's expected,
|
|
# don't let systemd treat the scan itself as a failure.
|
|
SuccessExitStatus = "1 2";
|
|
};
|
|
};
|
|
|
|
systemd.timers.vulnix-scan = {
|
|
description = "Daily vulnix scan";
|
|
wantedBy = ["timers.target"];
|
|
timerConfig = {
|
|
OnCalendar = "daily";
|
|
Persistent = true;
|
|
RandomizedDelaySec = "1h";
|
|
};
|
|
};
|
|
}
|