2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2020-08-17 09:39:20 +01:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, go-md2man
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
2020-09-01 08:44:55 +01:00
|
|
|
, bcc
|
|
|
|
, libseccomp
|
2020-08-17 09:39:20 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oci-seccomp-bpf-hook";
|
2021-01-27 12:55:59 +00:00
|
|
|
version = "1.2.1";
|
2020-08-17 09:39:20 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "containers";
|
|
|
|
repo = "oci-seccomp-bpf-hook";
|
|
|
|
rev = "v${version}";
|
2021-01-27 12:55:59 +00:00
|
|
|
sha256 = "0zbrpv6j4gd4l36zl2dljazdm85qlqwchf0xvmnaywcj8c8b49xw";
|
2020-08-17 09:39:20 +01:00
|
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
go-md2man
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
2020-09-01 08:44:55 +01:00
|
|
|
bcc
|
2020-08-17 09:39:20 +01:00
|
|
|
libseccomp
|
|
|
|
];
|
|
|
|
|
2021-01-27 12:55:59 +00:00
|
|
|
checkPhase = ''
|
|
|
|
go test -v ./...
|
|
|
|
'';
|
|
|
|
|
2020-08-17 09:39:20 +01:00
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
substituteInPlace oci-seccomp-bpf-hook.json --replace HOOK_BIN_DIR "$out/bin"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/* -t $out/bin
|
|
|
|
install -Dm644 oci-seccomp-bpf-hook.json -t $out
|
|
|
|
installManPage docs/*.[1-9]
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-08-17 09:39:20 +01:00
|
|
|
homepage = "https://github.com/containers/oci-seccomp-bpf-hook";
|
|
|
|
description = ''
|
|
|
|
OCI hook to trace syscalls and generate a seccomp profile
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ saschagrunert ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
badPlatforms = [ "aarch64-linux" ];
|
|
|
|
};
|
|
|
|
}
|