From patchwork Sat Nov 24 19:51:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 303 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 47E2916862; Sat, 24 Nov 2018 19:53:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id D17BD16860 for ; Sat, 24 Nov 2018 19:53:11 +0000 (GMT) Received: from localhost ([::1]:57587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQdzL-0006Cj-5w for patchwork@mira.cbaines.net; Sat, 24 Nov 2018 14:53:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQdzG-00064c-25 for guix-patches@gnu.org; Sat, 24 Nov 2018 14:53:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQdzC-00044l-So for guix-patches@gnu.org; Sat, 24 Nov 2018 14:53:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:41559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQdzC-00044H-Cu for guix-patches@gnu.org; Sat, 24 Nov 2018 14:53:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gQdzC-0001Yo-0v for guix-patches@gnu.org; Sat, 24 Nov 2018 14:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33464] [PATCH] gnu: Add lynis. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Nov 2018 19:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33464 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Marius Bakke , 33464@debbugs.gnu.org Received: via spool by 33464-submit@debbugs.gnu.org id=B33464.15430891215913 (code B ref 33464); Sat, 24 Nov 2018 19:53:01 +0000 Received: (at 33464) by debbugs.gnu.org; 24 Nov 2018 19:52:01 +0000 Received: from localhost ([127.0.0.1]:45815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQdyD-0001XG-F1 for submit@debbugs.gnu.org; Sat, 24 Nov 2018 14:52:01 -0500 Received: from vultr.systemreboot.net ([45.77.148.100]:39524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQdyB-0001X4-DC for 33464@debbugs.gnu.org; Sat, 24 Nov 2018 14:52:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=x4JMRRBb7I+Fnw3MtB7KM0ZeNVjQXwCoV1T/OiGslxM=; b=ZFxy6pBSDvifcQfcGbQ6hsPPM 2RZHu7wjJaWR1FyemPAPkdpptf1iK87SyTCMfVAIv1llDulNripY+kx7b4pAEFIGn5JQXjLpvsBxk ArhYCdGp2TiyVAVsCBFVGn08t0tiyBi+j/LAurkU7xEfgDyig5jCa9PlfDYc+duHuiqug=; Received: from [103.5.134.173] (helo=steel) by systemreboot.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gQdy6-00010C-0O; Sun, 25 Nov 2018 01:21:55 +0530 From: Arun Isaac In-Reply-To: <87y39jmwsg.fsf@fastmail.com> References: <20181122133429.16838-1-arunisaac@systemreboot.net> <87y39jmwsg.fsf@fastmail.com> Date: Sun, 25 Nov 2018 01:21:46 +0530 Message-ID: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches I have made all the suggested changes. Please find attached a new patch. From 6a39021cd2ee2ad2c74dddc7c1649e79fad97e41 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 22 Nov 2018 19:00:48 +0530 Subject: [PATCH v2] gnu: Add lynis. * gnu/packages/admin.scm (lynis): New variable. --- gnu/packages/admin.scm | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 28961ecf8..02fe3f0c5 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -2837,3 +2837,82 @@ support forum. It runs with the @code{/exec} command in most IRC clients.") (description "This package provides tools to manage clients of the Logitech Unifying Receiver.") (license license:gpl2))) + +(define-public lynis + (package + (name "lynis") + (version "2.7.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/CISOfy/lynis") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0rzc0y8lk22bymf56249jzmllki2lh0rz5in4lkrc5fkmp29c2wv")) + (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")) + #t)))) + (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 "3310aef4f2b3dd97d166c96ad0253c89c4ad390d"))) + (file-name (git-file-name "lynis-sdk" version)) + (sha256 + (base32 + "0sqsrm5wal742yrwps8bqb8a8lxd93n4b93n3kkm1b30nbs25g7y")))))) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "lynis" + (("/usr/share/lynis") + (string-append (assoc-ref outputs "out") "/share/lynis"))) + (substitute* "include/functions" + (("/usr/local/etc/lynis") + (string-append (assoc-ref outputs "out") "/etc/lynis"))) + #t)) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (install-file "lynis" (string-append out "/bin/")) + (install-file "default.prf" (string-append out "/etc/lynis")) + (for-each + (lambda (dir) + (copy-recursively dir (string-append out "/share/lynis/" dir))) + (list "db" "include" "plugins")) + (install-file "lynis.8" (string-append out "/share/man/man8")) + #t))) + (replace 'check + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "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+))) -- 2.19.1