From 952afb7da9a4b563f4e6478aec73f304827c2777 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 4 Apr 2021 04:04:20 +0200 Subject: feat(tools): add rust-crates-advisory We have a bunch of crates in `third_party/rust-crates`; it would be great if we could check them for existing CVEs. This tool does that, it takes the rust security advisory database, parses the applicable CVEs, and cross-checks them against the actual crate versions we list in our package database. The dumb parser we wrote is tested against all entries in the database, so we will notice when upstream breaks their shit. Checking the semver stuff is easy enough with the semver crate. If an advisory matches, it prints the whole thing and fails the build. Change-Id: I9e912c43d37a685d9d7a4424defc467a171ea3c4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2818 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: sterni --- users/Profpatsch/nixpkgs-rewriter/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'users/Profpatsch/nixpkgs-rewriter/default.nix') diff --git a/users/Profpatsch/nixpkgs-rewriter/default.nix b/users/Profpatsch/nixpkgs-rewriter/default.nix index ff414862fa..9dac018441 100644 --- a/users/Profpatsch/nixpkgs-rewriter/default.nix +++ b/users/Profpatsch/nixpkgs-rewriter/default.nix @@ -5,7 +5,6 @@ let ; inherit (depot.users.Profpatsch.lib) debugExec - eprintf ; bins = depot.nix.getBins pkgs.coreutils [ "head" "shuf" ] @@ -41,7 +40,7 @@ let "importas" "-ui" "file" "fileName" "importas" "-ui" "from" "fromLine" "importas" "-ui" "to" "toLine" - "if" [ eprintf "%s-%s\n" "$from" "$to" ] + "if" [ depot.tools.eprintf "%s-%s\n" "$from" "$to" ] (debugExec "adding lib") bins.sed "-e" "\${from},\${to} \${1}" @@ -98,7 +97,7 @@ let "pipeline" [ bins.shuf ] "pipeline" [ bins.head "-n" "1000" ] bins.xargs "-I" "{}" "-n1" - "if" [ eprintf "instantiating %s\n" "{}" ] + "if" [ depot.tools.eprintf "instantiating %s\n" "{}" ] "nix-instantiate" "$1" "-A" "{}" ]; -- cgit 1.4.1