From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iIJ4Ha+BO2IpewAAgWs5BA (envelope-from ) for ; Wed, 23 Mar 2022 21:23:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0KRHFq+BO2JwGAEAG6o9tA (envelope-from ) for ; Wed, 23 Mar 2022 21:23:11 +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 14D7643596 for ; Wed, 23 Mar 2022 21:23:11 +0100 (CET) Received: from localhost ([::1]:47876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nX7Ve-0002yO-57 for larch@yhetil.org; Wed, 23 Mar 2022 16:23:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nX7VW-0002wq-H5 for guix-patches@gnu.org; Wed, 23 Mar 2022 16:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nX7VW-0006oA-8F for guix-patches@gnu.org; Wed, 23 Mar 2022 16:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nX7VW-0001tf-4F for guix-patches@gnu.org; Wed, 23 Mar 2022 16:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54309] [PATCHv2] 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, 23 Mar 2022 20:23: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.16480669677248 (code B ref 54309); Wed, 23 Mar 2022 20:23:02 +0000 Received: (at 54309) by debbugs.gnu.org; 23 Mar 2022 20:22:47 +0000 Received: from localhost ([127.0.0.1]:46157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7VG-0001sq-Tc for submit@debbugs.gnu.org; Wed, 23 Mar 2022 16:22:47 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:38907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nX7VG-0001sd-41 for 54309@debbugs.gnu.org; Wed, 23 Mar 2022 16:22:46 -0400 Received: by mail-ej1-f43.google.com with SMTP id r13so5157747ejd.5 for <54309@debbugs.gnu.org>; Wed, 23 Mar 2022 13:22:46 -0700 (PDT) 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=LPLsfJ4mn4rNruNfMJ1xjeVZ4Zq6wOdl77YUiF79vAo=; b=QVbsazkou81jH4QShNKn/PGxDoc8knpoREeb4RMrpDZfUcMrFpMUSOVEyQYB1BrXi3 f2YXlG6UBV/V7mQVLN7AyWzTlBpVfnH7PnqEMm11iDoveF10IlA1MvjRY+2RCsnozymP x9UJO4f5ZpLQj1IedS7j1i+PKWZ1sk3/ju4F1OxIs27lLWJgTGEhY/xDhAJAA8wCcQQV GHeGSGXMN3qlNCL+95GJaoCWkB1mVctkdKwNAeY5aSZrb3gZGMBwGQ6H+fsTKbKA01O7 X2f54S1re5aQdVZ4eZxKSkY6kAs9oaVqqcZQVpN9EDbEoGQj3dwzkNgMvNJcRbAWp62U 6JGw== 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=LPLsfJ4mn4rNruNfMJ1xjeVZ4Zq6wOdl77YUiF79vAo=; b=UlKId0xitIvS80q7uZOkaT3RG4+sdavxFGrQ9FG4iSKFOt6pDVIrq2e/VeTyLLmzp9 opLgAzSyCfnvC5fvtDzl3lqrL0COpw89H76oCd/xC/NNgoj8ltrymjpAu1db0P2lTgDd VTK6QNaltF5bsN70m1bV/TilgptOhdmhIYx0hgut0VjB4VipEYwMc0tSEQKnXaxOTWRj 01/xKLFj44cLzs6Pw+TGeHgHJHWFeJom9DQCHizeKspGnipS8YXMpbkIzyxmWUlXm+G0 vRinldOrwJet9Phw4/IdIpPb0/qdSTDETyDyUAzg+8BUo0xmdbZVx38AVZ23yhcf8fP4 QHdg== X-Gm-Message-State: AOAM5324jveZNNkJufNfl3F1QgwS6xbqz2j53mNGZqLRDCDGBYPb4jo0 h/oX29wsn1gKxdxzPHNFBW1wa4s0QPc= X-Google-Smtp-Source: ABdhPJyt4LtngF8KfsvYggMNxJD9bd5w3/4EtmiqOyeChg1HyxtFU7QucIEn+8/WKAIbrvg660cgIA== X-Received: by 2002:a17:907:96a1:b0:6df:c9e3:25e2 with SMTP id hd33-20020a17090796a100b006dfc9e325e2mr2088613ejc.138.1648066960337; Wed, 23 Mar 2022 13:22:40 -0700 (PDT) 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 da23-20020a056402177700b0041394d8173csm399230edb.31.2022.03.23.13.22.39 for <54309@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Mar 2022 13:22:40 -0700 (PDT) Message-ID: Date: Wed, 23 Mar 2022 21:22:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648066991; 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=LPLsfJ4mn4rNruNfMJ1xjeVZ4Zq6wOdl77YUiF79vAo=; b=P2mcHPB5NbwhdSqkeAXPgzSYch5Pt84QIE6vTd5TvzvRT5PyhcOrTqIKkKellIfZvNv/uO s5pjukoyWKyAlHhKjbaXGYXYl9yoAi5XJyH4MmLyVk/tShAXodv6TaLurZzxi3C5RrHEfR fBiCemnMXGwtjlvGbuLF1ml3faxUPqxtRvkgoPynWjSzAzxxVzs/AmBiZgnGjYQsZ9hXOW DX5hvk1Pl2F4QunfrHcWrhRKAon06nNamdGpVdnCly6Y9xOu33tUebSMBQJ3sipnmr9Gmj lNCYElOkvZ6PN798PYEh4+1yyWCYlc8ANUz+c5zs2klbJMjOHewaHucPTOAXpQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648066991; a=rsa-sha256; cv=none; b=hhVIIoHjh0wuKemKHeAB5sTksYixoawK/l6qtax/N7jdIEV0y9t7YRJdufoKpTs+xkbeeZ mu4AAmZG21sHEyBUzlFeQBKAakEZ+G8sZE8lc7s6hwQAZsenJnQm1AxQFquJ8N/5qFODqQ U7kth2W+mnI81MVk9tCYdobR0poBNRUqepg6nJZbhuT7x+dHjMkTz4k2L/stZPkUuBjOaQ fTl8J/L8CzPfgVevv6Gbgjm3U/mrltXMYMeluCnFED486WwMbpGNF5fqZ74gjt037dnhDI UsHtOzMCcsJAckziouXdwQms4C9w7B6gevo9MdHZswr4hi5+pLGF+lj0E9mn6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QVbsazko; 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.81 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QVbsazko; 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: 14D7643596 X-Spam-Score: 4.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: He6vKBLZmZrp Use /var/log/audit for auditd. This is the upstream default. * gnu/services/auditd.scm: add auditd-activation function and extend activation-service-type. --- gnu/services/auditd.scm | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm index abde811f51..8e3d5fd2bc 100644 --- a/gnu/services/auditd.scm +++ b/gnu/services/auditd.scm @@ -31,10 +31,15 @@ (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 +freq = 1 +space_left = 5% +space_left_action = syslog +admin_space_left_action = ignore +disk_full_action = ignore +disk_error_action = syslog +")) (define %default-auditd-configuration-directory (computed-file "auditd" @@ -50,6 +55,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)) + ;; ensure /var/log exists with default permissions + (mkdir-p "/var/log") + (mkdir-p/perm "/var/log/audit" (getpwnam "root") #o700)))) + (define (auditd-shepherd-service config) (let* ((audit (auditd-configuration-audit config)) (configuration-directory (auditd-configuration-configuration-directory config))) @@ -67,7 +80,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