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.133.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 87645C433EF for ; Tue, 22 Feb 2022 18:56:36 +0000 (UTC) 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-664-Gf97ssj5NcaxkauskAqTsQ-1; Tue, 22 Feb 2022 13:56:32 -0500 X-MC-Unique: Gf97ssj5NcaxkauskAqTsQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E622100C662; Tue, 22 Feb 2022 18:56:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC98480FD7; Tue, 22 Feb 2022 18:56:26 +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 E95F24A701; Tue, 22 Feb 2022 18:56:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21MIuMO1026369 for ; Tue, 22 Feb 2022 13:56:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6D61D400E124; Tue, 22 Feb 2022 18:56:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6919A40E80E5 for ; Tue, 22 Feb 2022 18:56:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1DDB7185A7A4 for ; Tue, 22 Feb 2022 18:56:22 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-V_qGns-uOv-Cfw1rfpqp0w-1; Tue, 22 Feb 2022 13:56:20 -0500 X-MC-Unique: V_qGns-uOv-Cfw1rfpqp0w-1 Received: by mail-ed1-f49.google.com with SMTP id h15so22206106edv.7 for ; Tue, 22 Feb 2022 10:56:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FxcnHTySS4p55NJcahONXMIPJosCnpLZBI1kBvTxJ9o=; b=BuSZSEQNrAxqJIOY2jP6oT5w/Xsp+geQbSmk7EFq8pYPav+okFfCJweEJWRYVIvR4Q TDiZUlyW8mwhMcQ4fE7Qq4X7XrcERc67ZxnPu+8TpbcG/IVWGODD3IT/z/7JOffDS27p 1YDbWr/ODWnMdMI0xm1GVrh0uXLBMEtmCKloIAemusc6hFNpjV7H7QQuveE8ssFSV1t0 nPefenVXzb9q5Xw+jUH7bHDkjlWqoXE/zLsJeltUXTGcMjeLnafWwGoPB/IDIAlvkXV9 BPfdwL1hecGL3arwwhBMpV5ai9Y2640k8L19Dr1X3o7V62/whSNkVcbmE5/IM8vnJTEK S4/w== X-Gm-Message-State: AOAM531B5mnD4knNnzjqawnNrvHuA6LZRH50K7UdJJGQw3viakz7yM0g QreAtuYHyoxdulgXsesebzPDTsSZBgTswPzfKn2WZNUAMw== X-Google-Smtp-Source: ABdhPJxoWEQ6qVAZLVQybdoHZBogr+NFglYdlhaYtobL0fQxf/Jr9gKvk3v4Aub939UdSl2sPm0mswtO2IpY3UG1K+w= X-Received: by 2002:a05:6402:2922:b0:40f:7241:74d4 with SMTP id ee34-20020a056402292200b0040f724174d4mr28264908edb.43.1645556178889; Tue, 22 Feb 2022 10:56:18 -0800 (PST) MIME-Version: 1.0 References: <37bcf09f68a9d711ed350d85169d4aa1abcb7775.1645140903.git.rgb@redhat.com> In-Reply-To: <37bcf09f68a9d711ed350d85169d4aa1abcb7775.1645140903.git.rgb@redhat.com> From: Paul Moore Date: Tue, 22 Feb 2022 13:56:07 -0500 Message-ID: Subject: Re: [PATCH v6] audit: log AUDIT_TIME_* records only from rules To: Richard Guy Briggs X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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.14 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 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. -- paul-moore.com -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit