From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1054BC433F5 for ; Wed, 2 Mar 2022 17:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646241116; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AtWzC/9fyI9tuCiVUjazOwkNxlDTVN857JZFctMjlzQ=; b=E5PJ4Xo5PyIeOyT6q60A5jTfi4Oa9ShgTEa0GIK0Bkj5/25uLBdVNHvjb1lwzorpexe7gv sWrYwwMO8zUk1tWWVay4uOF1z67TDgEE5tYHUE5qgpQzEfMpVR7TIGo2XulGEeM7O21Qao OkJ+il4Ef8GC68RIyW76JPwR3iQkoZE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-495-7KdCBW0FNXir-LVMExkSlg-1; Wed, 02 Mar 2022 12:11:50 -0500 X-MC-Unique: 7KdCBW0FNXir-LVMExkSlg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 306541006AA7; Wed, 2 Mar 2022 17:11:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C34B341FA; Wed, 2 Mar 2022 17:11:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 22EA21809C98; Wed, 2 Mar 2022 17:11:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 222HBfCr022766 for ; Wed, 2 Mar 2022 12:11:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id A3E1D8379D; Wed, 2 Mar 2022 17:11:41 +0000 (UTC) Received: from x2.localnet (unknown [10.22.17.120]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EE27838C1; Wed, 2 Mar 2022 17:11:36 +0000 (UTC) From: Steve Grubb To: "'linux-audit@redhat.com'" Subject: Re: Alert when auditd is stopped Date: Wed, 02 Mar 2022 12:11:35 -0500 Message-ID: <3755499.tdWV9SEqCh@x2> Organization: Red Hat In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: linux-audit@redhat.com Cc: "MAUPERTUIS, PHILIPPE" X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, On Wednesday, March 2, 2022 10:51:57 AM EST MAUPERTUIS, PHILIPPE wrote: > During an audit, we had a question about stopping auditd. > What will be the best way either to get an alert when auditd is stopped ? Since by now everything probably uses systemd, I think you can add an OnFailure= clause to the auditd.service file that starts a one shot service of that you write which sends you the alert however you need it sent. > Is it possible to forbid altogether to stop auditd ? The intended systemd configuration does not allow stopping auditd by dbus. It is intended to be controlled by the service command. The stop script sends a signal to auditd. So, removing the script won't work since any root user can send the TERM or KILL signal. I don't think systemd can limit signals received by a daemon. But it can restart a daemon if it fails. Auditd places an ignore on all signals except the ones it expects such as TERM. The KILL and STOP signals cannot be blocked. > Can we still stop auditd when the rules are made immutable ? Yes. The rules are in the kernel. Making them immutable tells the kernel not to accept any more rules. It doesn't affect auditd. -Steve -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit