about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/threatest/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/threatest/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/threatest/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/threatest/default.nix b/nixpkgs/pkgs/tools/security/threatest/default.nix
new file mode 100644
index 000000000000..e32ffb52bd04
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/threatest/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+}:
+
+buildGoModule rec {
+  pname = "threatest";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "DataDog";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-xluKQXFa06ng9bs+sBkoFLeyYtQAcej4VFLMeTST6zA=";
+  };
+
+  proxyVendor = true;
+  vendorHash = "sha256-UQ3GPSv7P4+oMvcu4eFlosnw0TQxG33ptlMTQA/5Lkw=";
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  postInstall = ''
+    installShellCompletion --cmd threatest \
+      --bash <($out/bin/threatest completion bash) \
+      --fish <($out/bin/threatest completion fish) \
+      --zsh <($out/bin/threatest completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "Framework for end-to-end testing threat detection rules";
+    homepage = "https://github.com/DataDog/threatest";
+    changelog = "https://github.com/DataDog/threatest/releases/tag/v${version}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}