Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
versionCheckHook,
|
|
}:
|
|
|
|
buildGoModule (finalAttrs: {
|
|
pname = "kube-bench";
|
|
version = "0.13.0";
|
|
|
|
__darwinAllowLocalNetworking = true; # required for tests
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aquasecurity";
|
|
repo = "kube-bench";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-5P8kF8k25E7dezhQ7oKKlu/6y9Ofq3nAeenAI7IOBwE=";
|
|
};
|
|
|
|
vendorHash = "sha256-vueIQbsF34lkmIFpH8DiOSjxEBevxxiJLd0L/sQwJBE=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/aquasecurity/kube-bench/cmd.KubeBenchVersion=v${finalAttrs.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)
|
|
'';
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
doInstallCheck = true;
|
|
versionCheckProgramArg = "version";
|
|
|
|
meta = {
|
|
homepage = "https://github.com/aquasecurity/kube-bench";
|
|
changelog = "https://github.com/aquasecurity/kube-bench/releases/tag/v${finalAttrs.version}";
|
|
description = "Checks whether Kubernetes is deployed according to security best practices as defined in the CIS Kubernetes Benchmark";
|
|
mainProgram = "kube-bench";
|
|
license = lib.licenses.asl20;
|
|
maintainers = with lib.maintainers; [ jk ];
|
|
};
|
|
})
|