From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wC6TD6knKmKQvgAAgWs5BA (envelope-from ) for ; Thu, 10 Mar 2022 17:30:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GMP5DKknKmIhQgAA9RJhRA (envelope-from ) for ; Thu, 10 Mar 2022 17:30:33 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D23293EC6A for ; Thu, 10 Mar 2022 17:30:32 +0100 (CET) Received: from localhost ([::1]:54248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSLgM-0003cj-Rq for larch@yhetil.org; Thu, 10 Mar 2022 11:30:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSLfv-0003cT-Cv for guix-patches@gnu.org; Thu, 10 Mar 2022 11:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSLfv-0004Mm-3G for guix-patches@gnu.org; Thu, 10 Mar 2022 11:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSLfu-0008Lz-VS for guix-patches@gnu.org; Thu, 10 Mar 2022 11:30: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: Thu, 10 Mar 2022 16:30: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.164692977832054 (code B ref 54309); Thu, 10 Mar 2022 16:30:02 +0000 Received: (at 54309) by debbugs.gnu.org; 10 Mar 2022 16:29:38 +0000 Received: from localhost ([127.0.0.1]:35349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSLfV-0008Kw-Sm for submit@debbugs.gnu.org; Thu, 10 Mar 2022 11:29:38 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:45869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSLfU-0008Kf-0i for 54309@debbugs.gnu.org; Thu, 10 Mar 2022 11:29:36 -0500 Received: by mail-wm1-f51.google.com with SMTP id k29-20020a05600c1c9d00b003817fdc0f00so3715976wms.4 for <54309@debbugs.gnu.org>; Thu, 10 Mar 2022 08:29:35 -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=2XLRdKwdlMymofDXtAQhcpWE05SxVzV11tRAFLlpFNo=; b=Fu98BkXdx3qew0dCzKNFUAhcsnBRC7MOMAi05Gz0dbQwu2DRQljKbZfKlffLAc/cMd 9wnGHl33sk4fVBoU1Cfvmb/dGIJ3UPD4lZkDDlBmrYwgwSbMqjVH0eQTbS+oewsAACIt UkoKBfoV5sH4BF92jfq5HYbtE5ZF0TKrzEhY+SA/SuicuhUw85h8XajhYgjupH+/dtXT EZqv56CaVjn1a5hdzkRdhuVvGxta8Y4dNHCgwxBfJbLVAWxio5ICAZiNcueApWhs6iqz pfpTVcndau8b4xmos/01Q74REnxnaKUis0tG26j/lguMz9PFZK/3j6PxaxtpjSW5GbYV ZCfg== 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=2XLRdKwdlMymofDXtAQhcpWE05SxVzV11tRAFLlpFNo=; b=dWOlwjb5uMRdP7hsMsCxN2ssTQYEM8wRpyrnDLNwsuksvnab+dw9yHn0w00ED+1ZaU TFwMfUGOgtcxe1bUI4WwwzCTJMKV9/D5uREG3USQeEd0ts53oagNzB+14/eCYUQUSwzi aVUrhwPJj73theT7EYDDwIiZtyEOR3cN+sFNq59Dt2jTyQEgY7Nf7m1RUWbMqeUp6Q4+ Qwx6qA6LvfOIw54ycb1YsknRjSt4FEX5fuuT/yV+RffsbM6gW+RyuOGwp+MHuJjhT+6u CZx8wZZj/Lm29Y4uQAgaym6CZlhH4Yoi+hp4V/Ww8YHt460A83RTwTHcy5CDxZxzsFhD exmg== X-Gm-Message-State: AOAM533PJ9tchgq0CvFwmio7TXWWfn31w7MXX1Fuwwcp3lfDp7FwId4s evYSjOWFpWDGxsSZjHmm3xXpgBgH86U= X-Google-Smtp-Source: ABdhPJz66gsJHLp5/2Wozo3EfNHEDj7WKH438fUTdVxEh+0sfzdKVFYcHJN370oX/wWGyEsC2Lzzqg== X-Received: by 2002:a05:600c:3483:b0:380:edaf:d479 with SMTP id a3-20020a05600c348300b00380edafd479mr12414534wmq.20.1646929770033; Thu, 10 Mar 2022 08:29:30 -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 r188-20020a1c2bc5000000b00387c81c32e7sm8569828wmr.8.2022.03.10.08.29.29 for <54309@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Mar 2022 08:29:29 -0800 (PST) Message-ID: <8b52d7e5-314d-406e-87b7-cdc087dc7826@gmail.com> Date: Thu, 10 Mar 2022 17:29:28 +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 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646929832; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2XLRdKwdlMymofDXtAQhcpWE05SxVzV11tRAFLlpFNo=; b=hLEtGLENeTXTaM5olVPlGQOUPuWwZOzhDUuxEI5Ep/Mu2lX+UJLE5BLJfTKDAHHaMGvEZc 6dUsc5i+f7UPfYU4OM7Vodvnz4WBgXX+1S9+RC5oQEG3gCSpgggQwcJtHC7jRkf94EhFP7 Mqn62pKHWF26CsxP0MjSioZ5h/DMBO9sHsb0FLTZTTlgJvIMK/3Tt6tcNyxnpwzzCkpe/H Bh5U3RsS0Nq+ZYP6AHPNTmSLh3HlGlZcL087S3CFhm3dGKZJpxgOQp1/DUmqa01EWhcfgs G28hBWHnW7T01dsvmV7oPcx5l3ATJFEcGCWGQx2Ht78VieXEnzFrlrTqANAXCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646929832; a=rsa-sha256; cv=none; b=QMGuaByvePl7lass+yei6DJTk6sO5Acu33YBgppdjCMGbC4zJKSeGTybnpxw6O9BpbIrpY BYDfk2bXVZ+Sf+0TcyUjB6SvFWlptCXoF7VG019NxjPNcAzZt2U29pcIk+Q77IqzSQohWg ow5NM3NMcg4VWqvrsZFs8hUIFvxSlFZH4sbeSjpziaS5YyZmp/1JpZuZu1yoRgfh8SNZ3J dM+tBZjjeFGC/uDPy2ALF+w9jdGRQMw8rFw81yID3smpro2po9oFA92j6EOmOa4wcdZLej 4DTAw6hkTYgMTJi3oF7mhrUokaYuPrgHMSA+q20MuFwCSOg9dV7vk2paHQkNjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Fu98BkXd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.50 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Fu98BkXd; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D23293EC6A X-Spam-Score: 5.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: i3zIEEx4XpSX Use /var/log/audit for auditd. This is the upstream default. Further, rework the config file generated by auditd-service-type. Only write values which diverge from the upstream default. * gnu/services/auditd.scm: add auditd-activation function and extend activation-service-type. --- gnu/services/auditd.scm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm index abde811f51..1eb0ed291b 100644 --- a/gnu/services/auditd.scm +++ b/gnu/services/auditd.scm @@ -31,10 +31,10 @@ (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" "\ +space_left = 5% +space_left_action = syslog +")) (define %default-auditd-configuration-directory (computed-file "auditd" @@ -50,6 +50,14 @@ (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)) + (let ((var-log-audit "/var/log/audit")) + (mkdir-p var-log-audit) + (chmod var-log-audit #o700))))) + (define (auditd-shepherd-service config) (let* ((audit (auditd-configuration-audit config)) (configuration-directory (auditd-configuration-configuration-directory config))) @@ -67,7 +75,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))))) -- 2.34.0