about summary refs log tree commit diff
path: root/third_party/rust-crates/default.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2021-04-04T02·04+0200
committerProfpatsch <mail@profpatsch.de>2021-05-17T23·00+0000
commit952afb7da9a4b563f4e6478aec73f304827c2777 (patch)
tree2e219a08f2e8b0ff19c79fcb95c1b542c9f08906 /third_party/rust-crates/default.nix
parent72924facaebb9cf37d9cfd1da43335d5fe51fb6e (diff)
feat(tools): add rust-crates-advisory r/2595
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 <mail@tazj.in>
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'third_party/rust-crates/default.nix')
-rw-r--r--third_party/rust-crates/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/rust-crates/default.nix b/third_party/rust-crates/default.nix
index 3d96c54bd5..66db9331c5 100644
--- a/third_party/rust-crates/default.nix
+++ b/third_party/rust-crates/default.nix
@@ -283,4 +283,31 @@ with depot.third_party.rust-crates;
     sha256 = "1zgl8l15i19lzp90icgwyi6zqdd31b9vm8w129f41d1zd0hs7ayq";
     dependencies = [ log serde ];
   };
+
+  semver-parser = buildRustCrate {
+    pname = "semver-parser";
+    version = "0.7.0";
+    crateName = "semver-parser";
+    edition = "2015";
+    sha256 = "1da66c8413yakx0y15k8c055yna5lyb6fr0fw9318kdwkrk5k12h";
+    dependencies = [ ];
+  };
+
+  semver = buildRustCrate {
+    pname = "semver";
+    version = "0.10.0";
+    crateName = "semver";
+    edition = "2015";
+    sha256 = "0pbkdwlpq4d0hgdrymm2rcw31plni2siwd882gbcbscjvyvrrrqa";
+    dependencies = [ semver-parser ];
+  };
+
+  toml = buildRustCrate {
+    pname = "toml";
+    version = "0.5.8";
+    crateName = "toml";
+    sha256 = "1vwjwmwsy83pbgvvm11a6grbhb09zkcrv9v95wfwv48wjm01wdj4";
+    edition = "2018";
+    dependencies = [ serde ];
+  };
 }