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 2CF28C433EF for ; Tue, 22 Feb 2022 19:03:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645556588; 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=GCPGAU6q7Y1ixO80PrdN9piI514CcLFMWgmVUdN/4/U=; b=cT9UUwE574tojm0gqXW2oea2HS+d8mGyQ7MlRRzXZYCxgmrlF7dsEjjG/8TFRNMz8XLqjH W2TPzSsjPsf6nmtIbw5V9//vrVaPCejRz/TL2Ic/NkeLpmSF5gT2n0Xi5qFqVEzTC+NCUB ijowcYPb9+FAOWj9BH5k8hZ7liXBrts= 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-111-Ot6BdeSsMYGyZ14zjzodrQ-1; Tue, 22 Feb 2022 14:03:05 -0500 X-MC-Unique: Ot6BdeSsMYGyZ14zjzodrQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67AB0501E5; Tue, 22 Feb 2022 19:03:01 +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 3B8CD60BE5; Tue, 22 Feb 2022 19:03:00 +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 D69C31809CB2; Tue, 22 Feb 2022 19:02:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21MJ2vHU026795 for ; Tue, 22 Feb 2022 14:02:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5908810016F4; Tue, 22 Feb 2022 19:02:57 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.22.50.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 214DD10013D6; Tue, 22 Feb 2022 19:02:55 +0000 (UTC) Date: Tue, 22 Feb 2022 14:02:53 -0500 From: Richard Guy Briggs To: Paul Moore Subject: Re: [PATCH v6] audit: log AUDIT_TIME_* records only from rules Message-ID: References: <37bcf09f68a9d711ed350d85169d4aa1abcb7775.1645140903.git.rgb@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: linux-audit@redhat.com Cc: Eric Paris , Linux-Audit Mailing List 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.79 on 10.5.11.12 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-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 2022-02-22 13:56, Paul Moore wrote: > On Tue, Feb 22, 2022 at 11:45 AM Richard Guy Briggs wrote: > > AUDIT_TIME_* events are generated when there are syscall rules present > > that are not related to time keeping. This will produce noisy log > > entries that could flood the logs and hide events we really care about. > > > > Rather than immediately produce the AUDIT_TIME_* records, store the data > > in the context and log it at syscall exit time respecting the filter > > rules. > > > > Note: This eats the audit_buffer, unlike any others in show_special(). > > > > Please see https://bugzilla.redhat.com/show_bug.cgi?id=1991919 > > > > Fixes: 7e8eda734d30 ("ntp: Audit NTP parameters adjustment") > > Fixes: 2d87a0674bd6 ("timekeeping: Audit clock adjustments") > > Signed-off-by: Richard Guy Briggs > > --- > > Changelog: > > v2: > > - rename __audit_ntp_log_ to audit_log_ntp > > - pre-check ntp before storing > > - move tk out of the context union and move ntp logging to the bottom of audit_show_special() > > - restructure logging of ntp to use ab and allocate more only if more > > - add Fixes lines > > v3 > > - move tk into union > > - rename audit_log_ntp() to audit_log_time() and add tk > > - key off both AUDIT_TIME_* but favour NTP > > v4 > > - drop tk goto in favour of ntp if clause > > - add comments to clarify calling function buffer expectations > > v5 > > - hold my nose and swallow the audit_buffer in audit_log_time() > > v6 > > - declare audit_log_time() and ntp_name as static > > > > kernel/audit.h | 4 +++ > > kernel/auditsc.c | 85 ++++++++++++++++++++++++++++++++++++------------ > > 2 files changed, 69 insertions(+), 20 deletions(-) > > Merged into audit/next. Thank you. > paul-moore.com - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit