diff options
author | Orivej Desh <orivej@gmx.fr> | 2017-12-17 04:32:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-17 04:32:36 +0000 |
commit | d6b27ad35f8d615a0e43c887532aa205bc14e50c (patch) | |
tree | a9050658373f33db1183dd23bb54954aae994943 /pkgs/tools | |
parent | a76896ea2cbf66131721082ee94328e140158652 (diff) | |
parent | eda63dfabb1e8eb9ca28ed1fe41a6b8639f303d3 (diff) | |
download | nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar.gz nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar.bz2 nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar.lz nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar.xz nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.tar.zst nixlib-d6b27ad35f8d615a0e43c887532aa205bc14e50c.zip |
Merge pull request #32419 from ryneeverett/init-lynis
lynis: init at 2.5.7
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/security/lynis/default.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/tools/security/lynis/default.nix b/pkgs/tools/security/lynis/default.nix new file mode 100644 index 000000000000..5e13674bb77a --- /dev/null +++ b/pkgs/tools/security/lynis/default.nix @@ -0,0 +1,38 @@ +{ stdenv, makeWrapper, fetchFromGitHub, gawk, perl }: + +stdenv.mkDerivation rec { + pname = "lynis"; + version = "2.5.7"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "CISOfy"; + repo = "${pname}"; + rev = "${version}"; + sha256 = "19rfkiri73bi43i4yxpqrxjzpqn5rfrkq2picja5filjv14hbyly"; + }; + + nativeBuildInputs = [ makeWrapper perl ]; + + postPatch = '' + grep -rl '/usr/local/lynis' ./ | xargs sed -i "s@/usr/local/lynis@$out/share/lynis@g" + # Don't use predefined binary paths. See https://github.com/CISOfy/lynis/issues/468 + perl -i -p0e 's/BIN_PATHS="[^"]*"/BIN_PATHS=\$\(echo \$PATH\ | sed "s\/:\/ \/g")/sm;' include/consts + ''; + + installPhase = '' + mkdir -p $out/share/lynis + cp -r include db default.prf $out/share/lynis/ + mkdir -p $out/bin + cp -a lynis $out/bin + wrapProgram "$out/bin/lynis" --prefix PATH : ${stdenv.lib.makeBinPath [ gawk ]} + ''; + + meta = with stdenv.lib; { + description = "Security auditing tool for Linux, macOS, and UNIX-based systems"; + homepage = "https://cisofy.com/lynis/"; + license = licenses.gpl3; + platforms = platforms.unix; + maintainers = [ maintainers.ryneeverett ]; + }; +} |