From patchwork Wed Mar 9 21:00:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fesoj000 X-Patchwork-Id: 37712 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 4072127BBEA; Wed, 9 Mar 2022 21:01:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 08DC027BBE9 for ; Wed, 9 Mar 2022 21:01:13 +0000 (GMT) Received: from localhost ([::1]:51232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nS3Qm-0003M0-60 for patchwork@mira.cbaines.net; Wed, 09 Mar 2022 16:01:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nS3Qd-0003L6-1Y for guix-patches@gnu.org; Wed, 09 Mar 2022 16:01:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nS3Qc-0004rn-LZ for guix-patches@gnu.org; Wed, 09 Mar 2022 16:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nS3Qc-0001hp-KH for guix-patches@gnu.org; Wed, 09 Mar 2022 16:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54309] [PATCH] services: auditd: use exclusive log directory for auditd References: In-Reply-To: Resent-From: fesoj000 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Mar 2022 21:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54309@debbugs.gnu.org Received: via spool by 54309-submit@debbugs.gnu.org id=B54309.16468596294276 (code B ref 54309); Wed, 09 Mar 2022 21:01:02 +0000 Received: (at 54309) by debbugs.gnu.org; 9 Mar 2022 21:00:29 +0000 Received: from localhost ([127.0.0.1]:60895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS3Q5-00016e-7B for submit@debbugs.gnu.org; Wed, 09 Mar 2022 16:00:29 -0500 Received: from mail-ej1-f52.google.com ([209.85.218.52]:44577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS3Q3-0000zI-Cq for 54309@debbugs.gnu.org; Wed, 09 Mar 2022 16:00:27 -0500 Received: by mail-ej1-f52.google.com with SMTP id qt6so7748790ejb.11 for <54309@debbugs.gnu.org>; Wed, 09 Mar 2022 13:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject :content-language:to:content-transfer-encoding; bh=0ambC4f9Ik2fWvZgzZLWC8Ln/L3Ydgc070oSo5/Z/Pg=; b=VyXw1pDb265IvGL3/ny7+uKlSd0S3XB2wJ/P+knuQG+R8Osh2l8f+mauDdvJp1qkMO oIRfLVQESyoCHhcN3RNOHEB057mpbHrx//7pk/8GqXTCw1sXfPt75gngRBd/ThphG0Ko w+X+NzUKRhDD70OSErbPgQlQ2fTHaV0/z2uiT02iZ+U2urkUE1sBGYuZJFjTvwB2cNBX nlc8S2bhOyvhYxAviVF3EpGSM/mguAVKJKdZ8MTwJmz2YaJcDkisEez664upksrxGMXD Ezy/7I3MWkemai8Ges5+GTBOS6DFstmKB2/EFwNZ85uEErcjxQ4Zgs5gJbbcjmcB3sP5 CqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:content-language:to:content-transfer-encoding; bh=0ambC4f9Ik2fWvZgzZLWC8Ln/L3Ydgc070oSo5/Z/Pg=; b=MPBpk1l69Ps/ONW2oABNqlwCYmB0eVPSZYwwEKKn48eigxR1SFTqskfYLx+2H6AhsY QukXEL23k9scbXc+nSbhmyVPV+2KgJqoWqJP3CI704gdzpAutPADFA/bnxloE3keTwqn PzCeMvktIz8ZLXZK8N6eeghtfpBESTQC4OYKBcL4xjH8CcOVTlRoaQ1J3yYjbI5hASQx qt9HEzy9t5XPG1uN4KV2SIpaHVS5vTeElXNL+xEghGNRUJebsIUPYmvEjpj1BtA+Geni dxcxeHeurgSxzbfmiNrfsOZcfTXgSlXoLG6YgZFYYyuD5NE42c6iihLxxiPDfxP7TL5Y 4JQg== X-Gm-Message-State: AOAM5318TmvtdUGaf2K07PIYZ28xJABSj69tAXJCkPSNadGEXfli6si7 hdQhaiz1ZaT6J5ylF662DVpb8kGxXTk= X-Google-Smtp-Source: ABdhPJy/3OH/N/9/0wrrqHTqS4cwtSxg4wz1FuuTwwzfb+6lz8lJG8BQg7NnS8N8fe6vO3h1HHjOcw== X-Received: by 2002:a17:906:2a85:b0:6ce:36bd:bcd9 with SMTP id l5-20020a1709062a8500b006ce36bdbcd9mr1467307eje.318.1646859621301; Wed, 09 Mar 2022 13:00:21 -0800 (PST) Received: from ?IPV6:2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5? (p200300eeaf2f0e00c2f9c2bbbf951fc5.dip0.t-ipconnect.de. [2003:ee:af2f:e00:c2f9:c2bb:bf95:1fc5]) by smtp.gmail.com with ESMTPSA id yy18-20020a170906dc1200b006d6e5c75029sm1091377ejb.187.2022.03.09.13.00.20 for <54309@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 13:00:20 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 22:00:21 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 From: fesoj000 Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 Use the upstream default log file for auditd. * gnu/services/auditd.scm: add auditd-activation function and extend activation-service-type. --- gnu/services/auditd.scm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm index abde811f51..c88e974adb 100644 --- a/gnu/services/auditd.scm +++ b/gnu/services/auditd.scm @@ -31,10 +31,9 @@ (define-module (gnu services auditd) %default-auditd-configuration-directory)) (define auditd.conf - (plain-file "auditd.conf" "log_file = /var/log/audit.log\nlog_format = \ -ENRICHED\nfreq = 1\nspace_left = 5%\nspace_left_action = \ -syslog\nadmin_space_left_action = ignore\ndisk_full_action = \ -ignore\ndisk_error_action = syslog\n")) + (plain-file "auditd.conf" "log_format = ENRICHED\nfreq = 1\nspace_left = 5% \ +\nspace_left_action = syslog\nadmin_space_left_action = ignore\ +\ndisk_full_action = ignore\ndisk_error_action = syslog\n")) (define %default-auditd-configuration-directory (computed-file "auditd" @@ -50,6 +49,12 @@ (define-record-type* (default audit)) (configuration-directory auditd-configuration-configuration-directory)) ; file-like +(define (auditd-activation config) + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/log/audit")))) + (define (auditd-shepherd-service config) (let* ((audit (auditd-configuration-audit config)) (configuration-directory (auditd-configuration-configuration-directory config))) @@ -67,7 +72,9 @@ (define auditd-service-type (extensions (list (service-extension shepherd-root-service-type - auditd-shepherd-service))) + auditd-shepherd-service) + (service-extension activation-service-type + auditd-activation))) (default-value (auditd-configuration (configuration-directory %default-auditd-configuration-directory)))))