From patchwork Tue Jun 4 07:34:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 14219 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 198F517052; Tue, 4 Jun 2019 08:35:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id BF53717027 for ; Tue, 4 Jun 2019 08:35:20 +0100 (BST) Received: from localhost ([127.0.0.1]:47425 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY3yW-0001AG-SQ for patchwork@mira.cbaines.net; Tue, 04 Jun 2019 03:35:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY3yT-000197-DN for guix-patches@gnu.org; Tue, 04 Jun 2019 03:35:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hY3yR-0001Z8-8x for guix-patches@gnu.org; Tue, 04 Jun 2019 03:35:12 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58464) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hY3yP-0001Q3-Pg for guix-patches@gnu.org; Tue, 04 Jun 2019 03:35:10 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hY3yM-0007VF-2c for guix-patches@gnu.org; Tue, 04 Jun 2019 03:35:09 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36086] [PATCH] services: Add auditd. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 Jun 2019 07:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 36086@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155963367028790 (code B ref -1); Tue, 04 Jun 2019 07:35:03 +0000 Received: (at submit) by debbugs.gnu.org; 4 Jun 2019 07:34:30 +0000 Received: from localhost ([127.0.0.1]:43775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY3xl-0007UH-96 for submit@debbugs.gnu.org; Tue, 04 Jun 2019 03:34:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY3xh-0007U3-Rl for submit@debbugs.gnu.org; Tue, 04 Jun 2019 03:34:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:60428) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hY3xb-00068B-Og for submit@debbugs.gnu.org; Tue, 04 Jun 2019 03:34:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hY3xY-00012M-1i for guix-patches@gnu.org; Tue, 04 Jun 2019 03:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hY3xW-0005zG-Nz for guix-patches@gnu.org; Tue, 04 Jun 2019 03:34:16 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:47562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hY3xW-0005qC-Fo for guix-patches@gnu.org; Tue, 04 Jun 2019 03:34:14 -0400 Received: from localhost.localdomain (178.113.175.254.wireless.dyn.drei.com [178.113.175.254]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 5A88433603DF; Tue, 4 Jun 2019 09:34:08 +0200 (CEST) From: Danny Milosavljevic Date: Tue, 4 Jun 2019 09:34:06 +0200 Message-Id: <20190604073406.9297-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 209.51.188.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 * gnu/services/auditd.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Miscellaneous Services): Document it. --- doc/guix.texi | 24 +++++++++++++++++++ gnu/local.mk | 1 + gnu/services/auditd.scm | 53 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 gnu/services/auditd.scm diff --git a/doc/guix.texi b/doc/guix.texi index c01eb3a656..5cdd631738 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24105,6 +24105,30 @@ The Containerd package to use. @end table @end deftp +@cindex Audit +@subsubheading Auditd Service + +The @code{(gnu services auditd)} module provides the following service. + +@defvr {Scheme Variable} auditd-service-type + +This is the type of the service that runs +@url{https://people.redhat.com/sgrubb/audit/,auditd}, +a daemon that track security-relevant information on your system. + +@end defvr + +@deftp {Data Type} auditd-configuration +This is the data type representing the configuration of auditd. + +@table @asis + +@item @code{audit} (default: @code{audit}) +The audit package to use. + +@end table +@end deftp + @node Setuid Programs @section Setuid Programs diff --git a/gnu/local.mk b/gnu/local.mk index 55a8fcd361..9ab74a3e0f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -501,6 +501,7 @@ GNU_SYSTEM_MODULES = \ %D%/services.scm \ %D%/services/admin.scm \ %D%/services/audio.scm \ + %D%/services/auditd.scm \ %D%/services/avahi.scm \ %D%/services/base.scm \ %D%/services/certbot.scm \ diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm new file mode 100644 index 0000000000..1c3ee7d421 --- /dev/null +++ b/gnu/services/auditd.scm @@ -0,0 +1,53 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Danny Milosavljevic +;;; +;;; This file is 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 . + +(define-module (gnu services auditd) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services base) + #:use-module (gnu services shepherd) + #:use-module (gnu packages admin) + #:use-module (guix records) + #:use-module (guix gexp) + #:use-module (guix packages) + #:export (auditd-configuration + auditd-service-type)) + +; /etc/audit/audit.rules + +(define-configuration auditd-configuration + (audit + (package audit) + "Audit package.")) + +(define (auditd-shepherd-service config) + (let* ((audit (auditd-configuration-audit config))) + (list (shepherd-service + (documentation "Auditd allows you to audit file system accesses.") + (provision '(auditd)) + (start #~(make-forkexec-constructor + (list (string-append #$audit "/sbin/auditd")))) + (stop #~(make-kill-destructor)))))) + +(define auditd-service-type + (service-type (name 'auditd) + (extensions + (list + (service-extension shepherd-root-service-type + auditd-shepherd-service))) + (default-value (auditd-configuration))))