From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 EN0FCBXVKWIIHQAAgWs5BA (envelope-from ) for ; Thu, 10 Mar 2022 11:38:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id /JyLBBXVKWJD5wAAauVa8A (envelope-from ) for ; Thu, 10 Mar 2022 11:38:13 +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 8EE172C6C7 for ; Thu, 10 Mar 2022 11:38:12 +0100 (CET) Received: from localhost ([::1]:51618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSGBO-0003GS-UM for larch@yhetil.org; Thu, 10 Mar 2022 05:38:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSGBF-0003Cx-Vz for guix-patches@gnu.org; Thu, 10 Mar 2022 05:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSGBF-00089D-Ml for guix-patches@gnu.org; Thu, 10 Mar 2022 05:38:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSGBF-0004NN-Kr for guix-patches@gnu.org; Thu, 10 Mar 2022 05:38:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54309] [PATCH] services: auditd: use exclusive log directory for auditd Resent-From: fesoj000 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Mar 2022 10:38:01 +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: Liliana Marie Prikler , 54309@debbugs.gnu.org Received: via spool by 54309-submit@debbugs.gnu.org id=B54309.164690862616729 (code B ref 54309); Thu, 10 Mar 2022 10:38:01 +0000 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 Content-Language: en-US References: From: fesoj000 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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=1646908692; 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=ShsQiWsj1pnLHBXYwPnpaXnvtWQY7yY7tw4J+3oyHZk=; b=OkjSpNNvgUucGPKXgAXm43t1Mhk+4+OM8U/tjESIpgYsChw/1/xsgeH6R8nj1Uw+lReF3T rpbWFMk/FgYdL0h5MJjHeg/O+OFSdL4hN+ADcLotZJ819BQYOTf/ZYbFptXUgDhMdU2uGg QN1RK84TGLt4DTtMa+YyCuxUU2F8Mb64oZpdRJRZqZUzwFb9gTC9rbyFLkLp9SquiptarC oSrariUqEWUZHbK1F+J3MNZq7+T1S7qbQKm3kHN9O8nm3adKn33uN8nmV9GJl+oLdI7Puk U4gaxb5pA5qfGw1tGrcpRlDhFVsNviXclvhYEcBnEzuTB+rUm+js+1lpqugUYQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646908692; a=rsa-sha256; cv=none; b=CG9xgbOkzNwrfLHV35vNqLkev2icCXBzzApnKx/iV0HX600BDlSDsRxcP8AnicqS9NFHSQ eUvje9oiqej+Ow4KPAGsWninc36EB4KNNxKmLGPPqluIpTbDTWChA6VxZxB5lB6FBikfy+ +WHUhUcI/rqTyVpxxRZco0hL7vf0VvGkogLv0/uaUUlTxF/LhxqpN8AsVcycKJe3oRae8y mP1FN1lpPpWaqEHzbnpO24UWpaxeZ4l/uscA5IWHICNouxigjAPNLymSx3xQfwgeZjYSih oewkJqYib3yGEKGYQpiT/G/qDveB0mn+PTruYaa9c45OLgAonATWKnfGjMyY+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QNCcoTbe; 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: 4.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QNCcoTbe; 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: 8EE172C6C7 X-Spam-Score: 4.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: nf19RqBNIV6x 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.