1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
7 src = fetchFromGitHub {
8 owner = "aquasecurity";
10 rev = "refs/tags/v${version}";
11 hash = "sha256-x6xCrxePB/TR7BP1kLiVFjv4pLUJu9JVh5/Y0ebOjvY=";
14 vendorHash = "sha256-d6GhZBHDSRgMVeglw8rhq5QF7gRH4hQOzTn0DZjvhiA=";
16 nativeBuildInputs = [ installShellFiles ];
21 "-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=v${version}"
25 mkdir -p $out/share/kube-bench/
26 mv ./cfg $out/share/kube-bench/
28 installShellCompletion --cmd kube-bench \
29 --bash <($out/bin/kube-bench completion bash) \
30 --fish <($out/bin/kube-bench completion fish) \
31 --zsh <($out/bin/kube-bench completion zsh)
34 doInstallCheck = true;
35 installCheckPhase = ''
36 runHook preInstallCheck
37 $out/bin/kube-bench --help
38 $out/bin/kube-bench version | grep "v${version}"
39 runHook postInstallCheck
43 homepage = "https://github.com/aquasecurity/kube-bench";
44 changelog = "https://github.com/aquasecurity/kube-bench/releases/tag/v${version}";
45 description = "Checks whether Kubernetes is deployed according to security best practices as defined in the CIS Kubernetes Benchmark";
46 mainProgram = "kube-bench";
47 license = licenses.asl20;
48 maintainers = with maintainers; [ jk ];