From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 10 05:37:06 2022 Received: (at 54309) by debbugs.gnu.org; 10 Mar 2022 10:37:06 +0000 Received: from localhost ([127.0.0.1]:33399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSGAM-0004Ll-AS for submit@debbugs.gnu.org; Thu, 10 Mar 2022 05:37:06 -0500 Received: from mail-ej1-f41.google.com ([209.85.218.41]:45052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSGAK-0004LF-L5 for 54309@debbugs.gnu.org; Thu, 10 Mar 2022 05:37:05 -0500 Received: by mail-ej1-f41.google.com with SMTP id qt6so11015139ejb.11 for <54309@debbugs.gnu.org>; Thu, 10 Mar 2022 02:37:04 -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:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=ShsQiWsj1pnLHBXYwPnpaXnvtWQY7yY7tw4J+3oyHZk=; b=QNCcoTbeinNyBxuaQlDnuWwr5qfTJqPURACEYYQx4FIIXuSXwpl9LjXXU82MroQoj4 2Cx4uW7wHDIXWWiDdVA3e8F8fCWsbeKk72PSEZI4nN3SweNWu6XwtFaIK/R5TXTJzPEN EHY4oCjAGV9YHedK2Zd4sgZ8DrCTNBAGt6Qdx/UsjnTBvzdWC+6DwdnARxxrq3sKzj91 2jKZS1doFgRr41cBsMutlDTvwC03Lz3CjKDMSP4MzAop/sLDsWF/SYL/7PCF6jW0DZGq OCsPRBx/WeYYKrWYCJJKA7B+9Z0uVLB4c/1vm27T0gVE13N4c3rO/v7LHiH8bCUdhJK9 3HEQ== 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:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=ShsQiWsj1pnLHBXYwPnpaXnvtWQY7yY7tw4J+3oyHZk=; b=UUwrfkI7wzSIdIiTqysZF0zcsfVaz9J3w7zts+ezNJ3Jad7wykzd2nYii1I/InC5p2 kmuUcRSXRUIZXxUzDxZFyFratLM6DhUwXDXg3ELgO+WEMu9KVMXwQ8KS8yt/leffY21R SIlvGI5SIFb289EyPDV0DiAolGH3n/TIYJ2r+IfirfnMV4AUR2ec0/207Cp3flr48cb4 npXmrWINZfnMhT1WA1FonTmPJDTV6KWvcWE63Toy0/KQctNtJ8S+RFFQH+r2aKsro0YY 5hY82vXaLtqYWBVgG75ikVoOGztLKPyZZWuugdcEayRWs3ELomLCBQxlkUl1bLp3n4eh YiLQ== X-Gm-Message-State: AOAM530EmXbofenLoFfsdyyDJjpMCIEsuXuRB3tP4ivuhcQ4QpNNxCBd jogI6JEoPydnSIZEEGLAN3M= X-Google-Smtp-Source: ABdhPJw4TXUTlj/YjqMmox1n9lI88Oj0KGP90jAivvM/7dF/F4hvTMabyw4+F6bBt1fkwv8RStuEpA== X-Received: by 2002:a17:907:7d8e:b0:6d7:12a2:a962 with SMTP id oz14-20020a1709077d8e00b006d712a2a962mr3624752ejc.565.1646908618551; Thu, 10 Mar 2022 02:36:58 -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 ky5-20020a170907778500b006d1b2dd8d4csm1630724ejc.99.2022.03.10.02.36.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Mar 2022 02:36:57 -0800 (PST) Message-ID: Date: Thu, 10 Mar 2022 11:36:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH] services: auditd: use exclusive log directory for auditd Content-Language: en-US To: Liliana Marie Prikler , 54309@debbugs.gnu.org References: From: fesoj000 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 54309 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hi, On 3/10/22 8:12 AM, Liliana Marie Prikler wrote: > Hi, > > Am Mittwoch, dem 09.03.2022 um 22:00 +0100 schrieb fesoj000: >> 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")) > I'm not sure what the rationale behind writing auditd.conf this way is, > but note that can simply writethis as "\ > log_format = ENRICHED > freq = 1 > space_left = 5% > ..." > > Doing this, it would take up some more vertical real estate, but imho > it'd be easier to read. We might also want to make some of these > configurable later on, e.g. space_left, but that's not relevant to this > patch set. Sure, i will send a new patch later. >>   (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")))) > I think guix should already create this directory with the 700 > permissions auditd demands, to prevent any TOCTOU-style tampering. Good point.