nixpkgs/pkgs/by-name/ba/badrobot/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

47 lines
1.5 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "badrobot";
version = "0.1.3";
src = fetchFromGitHub {
owner = "controlplaneio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-mLBJLeB85QeC4PYH4FyOI8lHz1OxIJlJbqgDfXTNnhM=";
};
vendorHash = "sha256-SB7gGgm7BwMSo4ocKX4UGB+OdjVY92S5YZfOmTl4VEk=";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/controlplaneio/badrobot/cmd.version=v${version}"
];
postInstall = ''
installShellCompletion --cmd badrobot \
--bash <($out/bin/badrobot completion bash) \
--fish <($out/bin/badrobot completion fish) \
--zsh <($out/bin/badrobot completion zsh)
'';
meta = with lib; {
homepage = "https://github.com/controlplaneio/badrobot";
changelog = "https://github.com/controlplaneio/badrobot/blob/v${version}/CHANGELOG.md";
description = "Operator Security Audit Tool";
mainProgram = "badrobot";
longDescription = ''
Badrobot is a Kubernetes Operator audit tool. It statically analyses
manifests for high risk configurations such as lack of security
restrictions on the deployed controller and the permissions of an
associated clusterole. The risk analysis is primarily focussed on the
likelihood that a compromised Operator would be able to obtain full
cluster permissions.
'';
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ jk ];
};
}