summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2018-11-22 19:00:48 +0530
committerArun Isaac <arunisaac@systemreboot.net>2018-11-30 12:28:31 +0530
commit4d26987dcbc31f4f6a3c524b22af7d3dac52f39a (patch)
tree34a4c28361791b544e03b8a73d0aa136e0dc6ca1 /gnu
parent6878890c42c7cb5b394f505731b798899e155c38 (diff)
gnu: Add lynis.
* gnu/packages/admin.scm (lynis): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/admin.scm79
1 files changed, 79 insertions, 0 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 2f611432c7f..94bf6900cef 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -2871,3 +2871,82 @@ support forum. It runs with the @code{/exec} command in most IRC clients.")
2871 (description "This package provides tools to manage clients of the 2871 (description "This package provides tools to manage clients of the
2872Logitech Unifying Receiver.") 2872Logitech Unifying Receiver.")
2873 (license license:gpl2))) 2873 (license license:gpl2)))
2874
2875(define-public lynis
2876 (package
2877 (name "lynis")
2878 (version "2.7.0")
2879 (source
2880 (origin
2881 (method git-fetch)
2882 (uri (git-reference
2883 (url "https://github.com/CISOfy/lynis")
2884 (commit version)))
2885 (file-name (git-file-name name version))
2886 (sha256
2887 (base32
2888 "0rzc0y8lk22bymf56249jzmllki2lh0rz5in4lkrc5fkmp29c2wv"))
2889 (modules '((guix build utils)))
2890 (snippet
2891 '(begin
2892 ;; Remove proprietary plugins. As of now, all plugins supplied with
2893 ;; lynis are proprietary. In the future, if free plugins are
2894 ;; provided, whitelist them from deletion.
2895 (for-each delete-file (find-files "plugins"))
2896 #t))))
2897 (build-system gnu-build-system)
2898 (native-inputs
2899 `(;; For tests
2900 ("lynis-sdk"
2901 ,(origin
2902 (method git-fetch)
2903 (uri (git-reference
2904 (url "https://github.com/CISOfy/lynis-sdk")
2905 (commit "3310aef4f2b3dd97d166c96ad0253c89c4ad390d")))
2906 (file-name (git-file-name "lynis-sdk" version))
2907 (sha256
2908 (base32
2909 "0sqsrm5wal742yrwps8bqb8a8lxd93n4b93n3kkm1b30nbs25g7y"))))))
2910 (arguments
2911 `(#:phases
2912 (modify-phases %standard-phases
2913 (replace 'configure
2914 (lambda* (#:key inputs outputs #:allow-other-keys)
2915 (substitute* "lynis"
2916 (("/usr/share/lynis")
2917 (string-append (assoc-ref outputs "out") "/share/lynis")))
2918 (substitute* "include/functions"
2919 (("/usr/local/etc/lynis")
2920 (string-append (assoc-ref outputs "out") "/etc/lynis")))
2921 #t))
2922 (delete 'build)
2923 (replace 'install
2924 (lambda* (#:key outputs #:allow-other-keys)
2925 (let ((out (assoc-ref outputs "out")))
2926 (install-file "lynis" (string-append out "/bin/"))
2927 (install-file "default.prf" (string-append out "/etc/lynis"))
2928 (for-each
2929 (lambda (dir)
2930 (copy-recursively dir (string-append out "/share/lynis/" dir)))
2931 (list "db" "include" "plugins"))
2932 (install-file "lynis.8" (string-append out "/share/man/man8"))
2933 #t)))
2934 (replace 'check
2935 (lambda* (#:key inputs #:allow-other-keys)
2936 (copy-recursively (assoc-ref inputs "lynis-sdk") "../lynis-sdk")
2937 (setenv "LANG" "en_US.UTF-8")
2938 (let ((lynis-dir (getcwd)))
2939 (with-directory-excursion "../lynis-sdk"
2940 (substitute* "config"
2941 (("\\.\\./lynis") lynis-dir))
2942 (substitute* "unit-tests/tests-language-translations.sh"
2943 (("\\.\\./lynis") lynis-dir))
2944 (invoke "sh" "lynis-devkit" "run" "unit-tests"))))))))
2945 (home-page "https://cisofy.com/lynis/")
2946 (synopsis "Security auditing tool")
2947 (description "Lynis is a security auditing tool. It performs an in-depth
2948security scan and runs on the system itself. The primary goal is to test
2949security defenses and provide tips for further system hardening. It will also
2950scan for general system information, vulnerable software packages, and
2951possible configuration issues.")
2952 (license license:gpl3+)))