mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-30 09:37:59 +03:00
kube-bench: init at 0.6.8
This commit is contained in:
parent
a5c867d9fe
commit
c8cc2dee7e
48
pkgs/tools/security/kube-bench/default.nix
Normal file
48
pkgs/tools/security/kube-bench/default.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "kube-bench";
|
||||
version = "0.6.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aquasecurity";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-uqjF2WtsGMzA/JDS93BSQNuBJorMIJha9qPHJkIbjQo=";
|
||||
};
|
||||
vendorSha256 = "sha256-/LSgIfLBsGRSyz9gExgLKAjO+RF/C8CkxSvwx2jZjoI=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=v${version}"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/kube-bench/
|
||||
mv ./cfg $out/share/kube-bench/
|
||||
|
||||
installShellCompletion --cmd kube-bench \
|
||||
--bash <($out/bin/kube-bench completion bash) \
|
||||
--fish <($out/bin/kube-bench completion fish) \
|
||||
--zsh <($out/bin/kube-bench completion zsh)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
$out/bin/kube-bench --help
|
||||
$out/bin/kube-bench version | grep "v${version}"
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/aquasecurity/kube-bench";
|
||||
changelog = "https://github.com/aquasecurity/kube-bench/releases/tag/v${version}";
|
||||
description = "Checks whether Kubernetes is deployed according to security best practices as defined in the CIS Kubernetes Benchmark";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ jk ];
|
||||
};
|
||||
}
|
@ -16048,6 +16048,8 @@ with pkgs;
|
||||
|
||||
krew = callPackage ../development/tools/krew { };
|
||||
|
||||
kube-bench = callPackage ../tools/security/kube-bench { };
|
||||
|
||||
kube-hunter = callPackage ../tools/security/kube-hunter { };
|
||||
|
||||
kubeaudit = callPackage ../tools/security/kubeaudit { };
|
||||
|
Loading…
Reference in New Issue
Block a user