···11+{22+ lib,33+ pkgs,44+ ...55+}:66+77+{88+ name = "owasp dep-scan test";99+1010+ meta.maintainers = with lib; [1111+ maintainers.ethancedwards81212+ teams.ngi1313+ ];1414+1515+ nodes.machine = {1616+ environment.systemPackages = with pkgs; [1717+ dep-scan1818+ jq1919+ ];2020+2121+ # code repo to scan for vulnerabilites, could be anything2222+ # I just happened to pick the source of the package2323+ environment.etc."dep-scan-source".source = pkgs.fetchFromGitHub {2424+ owner = "owasp-dep-scan";2525+ repo = "dep-scan";2626+ tag = "v6.0.0b3";2727+ hash = "sha256-GdrFsECcBZ2J47ojM33flqOtrY3avchGpsZk6pt8Aks=";2828+ };2929+3030+ # we need to download the database before the vm starts, otherwise3131+ # the program will try to download them at runtime.3232+ # https://github.com/owasp-dep-scan/dep-scan/issues/4433333+ environment.etc."vdb/data.index.vdb6".source = pkgs.fetchurl {3434+ url = "https://huggingface.co/datasets/AppThreat/vdb/resolve/72377024f9742c6e700a113fc7059b18f738081c/app-2y/data.index.vdb6";3535+ hash = "sha256-/9RIL6KVwmUmcKteOhWlnzjtZzGUbmRzua5o4Z8Mu9I=";3636+ };3737+ environment.etc."vdb/data.vdb6".source = pkgs.fetchurl {3838+ url = "https://huggingface.co/datasets/AppThreat/vdb/resolve/72377024f9742c6e700a113fc7059b18f738081c/app-2y/data.vdb6";3939+ hash = "sha256-6gCftnjal9ZMXV+25fVANdJRuI/CN083OOnc8yA5TTw=";4040+ };4141+ environment.etc."vdb/vdb.meta".source = pkgs.fetchurl {4242+ url = "https://huggingface.co/datasets/AppThreat/vdb/resolve/72377024f9742c6e700a113fc7059b18f738081c/app-2y/vdb.meta";4343+ hash = "sha256-i0oI3ODrmm8PF9UGJ9gy9QzQ0SKjLo9DdqYX/kqoHak=";4444+ };4545+ environment.variables = {4646+ VDB_HOME = "/tmp/vdb";4747+ # the cache will try to auto refresh if the age is met (requires internet access)4848+ VDB_AGE_HOURS = 999999;4949+ };5050+ };5151+5252+ testScript =5353+ { nodes, ... }:5454+ ''5555+ start_all()5656+5757+ # vdb needs to be copied to tmp as it needs to write to dir5858+ # and etc is RO5959+ machine.succeed('cp -rL /etc/vdb /tmp/vdb')6060+ machine.succeed('depscan --src /etc/dep-scan-source --reports-dir /tmp/reports')6161+ machine.succeed('jq . /tmp/reports/*.json')6262+ '';6363+}
+3
pkgs/by-name/de/dep-scan/package.nix
···55 writableTmpDirAsHomeHook,66 makeWrapper,77 cdxgen,88+ nixosTests,89}:9101011python3Packages.buildPythonApplication rec {···6867 ]6968 }"7069 ];7070+7171+ passthru.tests = { inherit (nixosTests) dep-scan; };71727273 meta = {7374 description = "Security and risk audit tool based on known vulnerabilities, advisories, and license limitations for project dependencies";