2016-01-05 16:00:02 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, libseccomp
|
|
|
|
, perl
|
|
|
|
, which
|
|
|
|
}:
|
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "syscall_limiter";
|
2018-08-09 21:44:00 +02:00
|
|
|
version = "2017-01-23";
|
2016-01-05 16:00:02 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-02-18 11:39:01 +01:00
|
|
|
owner = "vi";
|
|
|
|
repo = "syscall_limiter";
|
|
|
|
rev = "481c8c883f2e1260ebc83b352b63bf61a930a341";
|
|
|
|
sha256 = "0z5arj1kq1xczgrbw1b8m9kicbv3vs9bd32wvgfr4r6ndingsp5m";
|
2016-01-05 16:00:02 +01:00
|
|
|
};
|
|
|
|
|
2018-08-09 21:44:00 +02:00
|
|
|
buildInputs = [ libseccomp ];
|
2016-01-05 16:00:02 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -v limit_syscalls $out/bin
|
|
|
|
cp -v monitor.sh $out/bin/limit_syscalls_monitor.sh
|
|
|
|
substituteInPlace $out/bin/limit_syscalls_monitor.sh \
|
|
|
|
--replace perl ${perl}/bin/perl \
|
|
|
|
--replace which ${which}/bin/which
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Start Linux programs with only selected syscalls enabled";
|
2017-02-18 11:39:01 +01:00
|
|
|
homepage = https://github.com/vi/syscall_limiter;
|
|
|
|
license = licenses.mit;
|
2016-01-05 16:00:02 +01:00
|
|
|
maintainers = with maintainers; [ obadz ];
|
2017-02-18 11:39:01 +01:00
|
|
|
platforms = platforms.linux;
|
2016-01-05 16:00:02 +01:00
|
|
|
};
|
|
|
|
}
|