From f703baafe48f3b38980784356831802b73bc23ef Mon Sep 17 00:00:00 2001 From: nik gaffney Date: Sun, 14 Apr 2024 15:43:05 +0200 Subject: [PATCH] Put in earplugs --- channel/zzkt/packages/lynis.scm | 184 ++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 channel/zzkt/packages/lynis.scm diff --git a/channel/zzkt/packages/lynis.scm b/channel/zzkt/packages/lynis.scm new file mode 100644 index 0000000..8fd7c0e --- /dev/null +++ b/channel/zzkt/packages/lynis.scm @@ -0,0 +1,184 @@ +;;; GNU Guix --- Functional package management for G->NU +;;; Copyright © 2012-2024 Ludovic Courtès +;;; Copyright © 2013 Cyril Roelandt +;;; Copyright © 2014, 2015, 2016, 2018, 2019, 2020 Mark H Weaver +;;; Copyright © 2014, 2015-2018, 2020-2023 Eric Bavier +;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer +;;; Copyright © 2015 Alex Sassmannshausen +;;; Copyright © 2015 Eric Dvorsak +;;; Copyright © 2016, 2017, 2020 Leo Famulari +;;; Copyright © 2016 Pjotr Prins +;;; Copyright © 2016, 2017, 2023 Ricardo Wurmus +;;; Copyright © 2016-2023 Efraim Flashner +;;; Copyright © 2016 Peter Feigl +;;; Copyright © 2016 John J. Foerch +;;; Copyright © 2016, 2017 Nikita +;;; Copyright © 2016–2022 Tobias Geerinckx-Rice +;;; Copyright © 2016 John Darrington +;;; Copyright © 2017 Ben Sturmfels +;;; Copyright © 2017 Ethan R. Jones +;;; Copyright © 2017 Christine Lemmer-Webber +;;; Copyright © 2017, 2018, 2020 Marius Bakke +;;; Copyright © 2018, 2019 Arun Isaac +;;; Copyright © 2018 Pierre-Antoine Rouby +;;; Copyright © 2018 Rutger Helling +;;; Copyright © 2018 Pierre Neidhardt +;;; Copyright © 2019 Brett Gilio +;;; Copyright © 2019,2020 Björn Höfling +;;; Copyright © 2019 Jakob L. Kreuze +;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2019 Alex Griffin +;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant +;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe +;;; Copyright © 2020 Oleg Pykhalov +;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen +;;; Copyright © 2020, 2021, 2022 Michael Rohleder +;;; Copyright © 2020 Vincent Legoll +;;; Copyright © 2020 Morgan Smith +;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer +;;; Copyright © 2021, 2023 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2021 Stefan Reichör +;;; Copyright © 2021 qblade +;;; Copyright © 2021 Hyunseok Kim +;;; Copyright © 2021 David Larsson +;;; Copyright © 2021 WinterHound +;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 muradm +;;; Copyright © 2021 pineapples +;;; Copyright © 2021 Petr Hodina +;;; Copyright © 2021 Artyom V. Poptsov +;;; Copyright © 2022 Wamm K. D. +;;; Copyright © 2022 Roman Riabenko +;;; Copyright © 2022 Petr Hodina +;;; Copyright © 2022 Andreas Rammhold +;;; Copyright © 2022 ( +;;; Copyright © 2022, 2023 Matthew James Kraai +;;; Copyright © 2022 jgart +;;; Copyright © 2023 Juliana Sims +;;; Copyright © 2023 Lu Hui +;;; Copyright © 2023 Yovan Naumovski +;;; Copyright © 2023 Alexey Abramov +;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2023 Tobias Kortkamp +;;; Copyright © 2023 Jaeme Sifat +;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Tomás Ortín Fernández +;;; Copyright © 2024 dan +;;; +;;; This file is not (yet) part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +;; as seen near +;; https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/admin.scm#n4740 + + +;; lynis 3.1.1 +;; https://github.com/CISOfy/lynis/commit/60afce6d8110ee9e88ac9e9d0e0346b1cf222b5e + +;; lynis-sdk 3.1.1 +;; https://github.com/CISOfy/lynis-sdk/commit/f4f885f1f049f59940487a6ffc2d53806c729d12 + +(define-module (zzkt packages lynis) + #:use-module (guix) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu)) + +(define-public lynis + (package + (name "lynis") + ;; Also update the ‘lynis-sdk’ input to the commit matching this release. + (version "3.1.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/CISOfy/lynis") + (commit "60afce6d8110ee9e88ac9e9d0e0346b1cf222b5e"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "05bh16i916xz9w8p8fz8flzj9ayyzg7wpbi7q61ylrlahhc03nqd")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Remove proprietary plugins. As of now, all plugins supplied with + ;; lynis are proprietary. In the future, if free plugins are + ;; provided, whitelist them from deletion. + (for-each delete-file (find-files "plugins")))))) + (build-system gnu-build-system) + (native-inputs + `(;; For tests + ("lynis-sdk" + ,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/CISOfy/lynis-sdk") + (commit "f4f885f1f049f59940487a6ffc2d53806c729d12"))) + (file-name (git-file-name "lynis-sdk" version)) + (sha256 + (base32 "09d98wmvan7nlchm056kls5xm939d1231pwsvlp4q2aznz8cmg42")))))) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + ;; XXX Remove after fixing . + (lambda* (#:key source #:allow-other-keys) + (mkdir "source") + (chdir "source") + (copy-recursively source "." + #:keep-mtime? #t))) + (replace 'configure + (lambda _ + (substitute* "lynis" + (("/usr/share/lynis") + (string-append #$output "/share/lynis"))) + (substitute* "include/functions" + (("/usr/local/etc/lynis") + (string-append #$output "/etc/lynis"))))) + (delete 'build) + (replace 'install + (lambda _ + (install-file "lynis" (string-append #$output "/bin/")) + (install-file "default.prf" (string-append #$output "/etc/lynis")) + (for-each + (lambda (dir) + (copy-recursively + dir (string-append #$output "/share/lynis/" dir))) + (list "db" "include" "plugins")) + (install-file "lynis.8" + (string-append #$output "/share/man/man8")))) + (replace 'check + (lambda _ + (copy-recursively #$(this-package-native-input "lynis-sdk") + "../lynis-sdk") + (setenv "LANG" "en_US.UTF-8") + (let ((lynis-dir (getcwd))) + (with-directory-excursion "../lynis-sdk" + (substitute* "config" + (("\\.\\./lynis") lynis-dir)) + (substitute* "unit-tests/tests-language-translations.sh" + (("\\.\\./lynis") lynis-dir)) + (invoke "sh" "lynis-devkit" "run" "unit-tests")))))))) + (home-page "https://cisofy.com/lynis/") + (synopsis "Security auditing tool") + (description "Lynis is a security auditing tool. It performs an in-depth +security scan and runs on the system itself. The primary goal is to test +security defenses and provide tips for further system hardening. It will also +scan for general system information, vulnerable software packages, and +possible configuration issues.") + (license license:gpl3+)))