From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aLcjK/v+KGJUPgEAgWs5BA (envelope-from ) for ; Wed, 09 Mar 2022 20:24:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oAV9I/v+KGJZtAAAG6o9tA (envelope-from ) for ; Wed, 09 Mar 2022 20:24:43 +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 0E31BC65D for ; Wed, 9 Mar 2022 20:24:43 +0100 (CET) Received: from localhost ([::1]:40808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nS1vN-0004NS-HV for larch@yhetil.org; Wed, 09 Mar 2022 14:24:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nS1sq-0002IO-Sd for guix-patches@gnu.org; Wed, 09 Mar 2022 14:22:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nS1so-0006Hz-DV for guix-patches@gnu.org; Wed, 09 Mar 2022 14:22:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nS1so-0006O2-7v for guix-patches@gnu.org; Wed, 09 Mar 2022 14:22:02 -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: Wed, 09 Mar 2022 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54309@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164685370324521 (code B ref -1); Wed, 09 Mar 2022 19:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Mar 2022 19:21:43 +0000 Received: from localhost ([127.0.0.1]:60743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS1sU-0006NR-Sz for submit@debbugs.gnu.org; Wed, 09 Mar 2022 14:21:43 -0500 Received: from lists.gnu.org ([209.51.188.17]:56126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nS1sT-0006NK-Gy for submit@debbugs.gnu.org; Wed, 09 Mar 2022 14:21:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nS1sS-00026F-Tt for guix-patches@gnu.org; Wed, 09 Mar 2022 14:21:41 -0500 Received: from [2a00:1450:4864:20::532] (port=35419 helo=mail-ed1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nS1sR-0006BI-EH for guix-patches@gnu.org; Wed, 09 Mar 2022 14:21:40 -0500 Received: by mail-ed1-x532.google.com with SMTP id y22so4201493eds.2 for ; Wed, 09 Mar 2022 11:21:38 -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=i5me75jnCPmiT9VgvhVk5APEI7DnC7QfwKXc1wjYv5M=; b=eSCjHOFnqxaBWUZtZtAK3tz8qvqFafDbeQgaiJP13dr71tqXp4+yvKaH2KhrOguLBq j3jhaKO4hu8BDoQz7OwXzd9cGmTQXC7xy3dYEEOze1VqP8IZRyzXuz+nf29dT8B9vRlv G6agWu4RRE+KefljqOG4dpPBvMr8TXMPqR2AisMqfnt/ur6Hg+uQDzPKfqSY2bynvkmS giY6Y0PiKXFdZsKoYCCqMfGVsPbKX2ZWh8wKlOYu6z7vV6Dn371qaxPOcjdbhys7/0la F+vjYbJZ5j0ZFjYApVolaxEDBIF6yn0zXGSNMyVD968RUZuMx0kWkN2RdFy8LoWb2sh9 XHYA== 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=i5me75jnCPmiT9VgvhVk5APEI7DnC7QfwKXc1wjYv5M=; b=bG/cGVsv/QnELyPCYMbgnERdvviEDyQd9eGwroQseh3XQAvx0n7D5kBc6BOO99dM12 at3wnJrnomYPyhlCqYwBYr+Z/Fy6nLUfd2NBZCVShwpvzkGGEe87OUYfST9ekpBOkcv2 gew+ATtGmE69Jc2Cl0msvJDmrQd1SNjYYe/WYKUxJXIee7cwrUn/t0WZ01M0nO8V9Zxo bTkA7vJI7gCAjlwyHcBEt8m0q1FIsbNlCrZbWf9vpxvjh6e62AMJuV98rZhVyujtD3CV M+vHGCDno2/03UaR9v3LygyQD26d66nNqfnchq6nB3tTchDVlZBmAHZpEgUtJ970J1SL jaqg== X-Gm-Message-State: AOAM532ksBgXRSbJVasIYWbMHQalidZCqrZQDLtpyRk2xpZHAWS0FfeJ Y5YtpAP15CWtHh8xWwDtAsycQqFhEuo= X-Google-Smtp-Source: ABdhPJw0yOcVJnmuOBx/KAIs8XK1ukjCMDo0P4Y7XXuzQE4BOoVV6yKOTOINGaO9uWGt2BhqyyO5qg== X-Received: by 2002:a50:8d0e:0:b0:416:7dfc:9f93 with SMTP id s14-20020a508d0e000000b004167dfc9f93mr951791eds.93.1646853697689; Wed, 09 Mar 2022 11:21:37 -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 g23-20020a17090670d700b006ccfd4163f7sm1036525ejk.206.2022.03.09.11.21.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Mar 2022 11:21:37 -0800 (PST) Message-ID: Date: Wed, 9 Mar 2022 20:21:37 +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-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::532 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=fesoj000@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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=1646853883; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=i5me75jnCPmiT9VgvhVk5APEI7DnC7QfwKXc1wjYv5M=; b=fmGt1PGrJ+UDYXY3IP9a0kRK+6FUP2Sp2rsCpk0mn8lf4WSUmU82fwzI9agaDWoo20TKzY Eaj1YWoYnsIvU3bXxTGFddi+J4AjYzCQyAdGD2B4B5YX5QWATMEgrzQguWNXhrqujRZmU/ RllUKshYuiI9THVcEKsK2aw424ytLhh4Hs8skWTNlf8FwIYxNzD3VNIx/2RrlGwKgvQxlk ybb+lsjj0YPyLcZpuij45EZnbeuRof37JdVP5X23j+lKJUJu79XBz26sskDSyRJqbHTho9 VcmYyh17Wj3/LW+3JkghMELyMGayrhpy9MdiowXo4fpwePFo7aunEHISwHJ/bw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646853883; a=rsa-sha256; cv=none; b=eqnebuvwlxGF8Rq0ia/l/JnHNCPmxEY3z+RVlOwJMtfz0gtMWK/lwf+hREZRz/sfQqPhJk yKEvJlC0k2QLIth6I0Es4p71ccXzhZqPLFLalfXVLJEQ5lpWSYMH3BuvUhcXscAq9otqjs k/fJVpEzndoc+DrQZSU62xq847p+zPGt69q7zW9cNFKB8T2TspFKCtDAfBI8BJaO1JA3nG F7xoICOpYOH7fXaOg709OM4MlPyaIhjKow9xaaf2G1To+WmnrR1sQO/bjp/TfYew7De4sW 4apLwlaLW6xcM+r3Wg7MYJpYz71xZJXwM5FdnoBg1CzmwKspnDXQY/+E8j4KYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eSCjHOFn; 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.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eSCjHOFn; 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: 0E31BC65D X-Spam-Score: 4.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: x2QVevkRIelu Currently auditd writes logs to /var/log/audit.log. This is a problem because auditd changes the permissions of the directory audit.log lives in to 700. /var/log usually has 755, this is assumed by some services. postgresql for example, fails when used together with auditd. On redhat for example, auditd uses /var/log/audit/ as its log directory. This change mirrors this behaviour. * gnu/services/auditd.scm: add auditd-activation function and extend activation-service-type. --- gnu/services/auditd.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gnu/services/auditd.scm b/gnu/services/auditd.scm index abde811f51..8478581999 100644 --- a/gnu/services/auditd.scm +++ b/gnu/services/auditd.scm @@ -31,7 +31,7 @@ (define-module (gnu services auditd) %default-auditd-configuration-directory)) (define auditd.conf - (plain-file "auditd.conf" "log_file = /var/log/audit.log\nlog_format = \ + (plain-file "auditd.conf" "log_file = /var/log/audit/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")) @@ -50,6 +50,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 +73,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