nixpkgs/pkgs/tools/security/kubescape/default.nix

48 lines
1.8 KiB
Nix
Raw Normal View History

2021-10-26 13:27:47 +00:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2021-09-03 17:23:07 +00:00
buildGoModule rec {
pname = "kubescape";
2021-10-26 13:27:47 +00:00
version = "1.0.127";
2021-09-03 17:23:07 +00:00
src = fetchFromGitHub {
owner = "armosec";
repo = pname;
rev = "v${version}";
2021-10-26 13:27:47 +00:00
sha256 = "sha256-01k0FJNWrLnwOGa4JgQ/HKSJNgWAzmBUWFhdPi/yPY4=";
2021-09-03 17:23:07 +00:00
};
2021-10-26 13:27:47 +00:00
vendorSha256 = "sha256-cOxjsujlpRbdw4098eMHe2oNAJXWGjKbPeYpKt0DCp8=";
2021-09-03 17:23:07 +00:00
2021-10-26 13:27:47 +00:00
ldflags = [ "-s" "-w" "-X github.com/armosec/kubescape/clihandler/cmd.BuildNumber=v${version}" ];
2021-09-03 17:23:07 +00:00
2021-10-26 13:27:47 +00:00
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
# Running kubescape to generate completions outputs error warnings
# but does not crash and completes successfully
# https://github.com/armosec/kubescape/issues/200
installShellCompletion --cmd kubescape \
--bash <($out/bin/kubescape completion bash) \
--fish <($out/bin/kubescape completion fish) \
--zsh <($out/bin/kubescape completion zsh)
'';
2021-09-03 17:23:07 +00:00
meta = with lib; {
description = "Tool for testing if Kubernetes is deployed securely";
homepage = "https://github.com/armosec/kubescape";
2021-10-26 13:27:47 +00:00
changelog = "https://github.com/armosec/kubescape/releases/tag/v${version}";
longDescription = ''
Kubescape is the first open-source tool for testing if Kubernetes is
deployed securely according to multiple frameworks: regulatory, customized
company policies and DevSecOps best practices, such as the NSA-CISA and
the MITRE ATT&CK®.
Kubescape scans K8s clusters, YAML files, and HELM charts, and detect
misconfigurations and software vulnerabilities at early stages of the
CI/CD pipeline and provides a risk score instantly and risk trends over
time. Kubescape integrates natively with other DevOps tools, including
Jenkins, CircleCI and Github workflows.
'';
2021-09-03 17:23:07 +00:00
license = licenses.asl20;
2021-10-26 13:27:47 +00:00
maintainers = with maintainers; [ fab jk ];
2021-09-03 17:23:07 +00:00
};
}