Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7561861pxb; Thu, 18 Feb 2021 13:30:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBpd3SJseBQgBkVU+jkrnSZiVnITbz2kcvspzNM1KrjtP3H9I46qYl0GpOGz1mUoocT0ja X-Received: by 2002:a17:906:6095:: with SMTP id t21mr5895188ejj.384.1613683848317; Thu, 18 Feb 2021 13:30:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613683848; cv=none; d=google.com; s=arc-20160816; b=nJw7v6DCx2U+ESrW6VkKZcM80Gyvltl9fOwNPjHrhd4K4THRaiRWSxbDglitY8MbSU DGV3Yh1z/40dgG7LU0WwvImHt/YnZmKIOg81S0I7/Yygqjhu67VDJcIh4BCIjCgOPAGZ IPaK5m0erlX5/f7my40SU/fg0Ci5wn0t8I1ToGuiHj45MnnJ2oZNt/HmkvYxbvmxI1+K vs0zUKN5O+/04rQVWy+Kq1YY2rhwcjQQwG7zMVSn2wiDl+DnCJ2ee+SDYfQGEEQGwEaC aQe1dt4sSbZNUHcphlIQ4ePsE9kDlIsQwp7PTlr2Dka4gsiqknIDDjr4hGaXX03yp7vh uphA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1ewdW74Ea/Q6Basd8TgHUzZo3WsqpwUIBmwyboI5wwo=; b=uLTcubu00/OSqd89RNBAZ9PsXKx20+BtodON5c5kij2TDLjjKcN30hr704T8PMG3rD z81aWjLcUscfOLjXZE3hDz4nqz6kG8eqbOFnhdEUQDEZZ1rVm2crm9CehC00iszXKhk5 YYZfvXzj1v1SvLL+WTr5oGbg95MwgfMvPP2/oFdL+cT5JaM1weLyq/6lNcYWQ872Ph2S YgePlGOBjkF9gWjgj6sy39slB9CtaRpu1GyT3iiWoJz2/5t4PI3agqwhnP1XAPqQghnE TR+mUpTkr8ANjnw+P0ujs4miIn0ssDSwxi2BKGZhRWvfEuii7InDAxOnwyG6omDOAYu5 gZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HJEsFV1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si4392371edt.571.2021.02.18.13.30.24; Thu, 18 Feb 2021 13:30:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HJEsFV1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbhBRVVs (ORCPT + 99 others); Thu, 18 Feb 2021 16:21:48 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37974 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbhBRVVr (ORCPT ); Thu, 18 Feb 2021 16:21:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613683220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=1ewdW74Ea/Q6Basd8TgHUzZo3WsqpwUIBmwyboI5wwo=; b=HJEsFV1Inv0jpVxgr1x8Hu/mDxNNzl7wTQMJYhFxZXSOcyPP+Jqq4PVMWWGv07FT+GNrBd 8r8pIWr0Wn0FVurXggWnuOaFPoxoXgB2CYfz1PeEiECnPC2kAkj+oAqSkVRzm/v1kGQTHX HZb8hwFK2DA6huJRRD7RXP4iOps9gIk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-116-NgMDP51xMAC2331K9yM1qA-1; Thu, 18 Feb 2021 16:20:16 -0500 X-MC-Unique: NgMDP51xMAC2331K9yM1qA-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 75171EC1A1; Thu, 18 Feb 2021 21:20:15 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0CFD85D9C2; Thu, 18 Feb 2021 21:20:03 +0000 (UTC) Date: Thu, 18 Feb 2021 16:20:01 -0500 From: Richard Guy Briggs To: Florian Westphal Cc: Phil Sutter , LKML , Linux-Audit Mailing List , netfilter-devel@vger.kernel.org, twoerner@redhat.com, Eric Paris , tgraf@infradead.org Subject: Re: [PATCH ghak124 v3] audit: log nftables configuration change events Message-ID: <20210218212001.GQ3141668@madcap2.tricolour.ca> References: <20210211151606.GX3158@orbyte.nwl.cc> <20210211202628.GP2015948@madcap2.tricolour.ca> <20210211220930.GC2766@breakpoint.cc> <20210217234131.GN3141668@madcap2.tricolour.ca> <20210218082207.GJ2766@breakpoint.cc> <20210218124211.GO3141668@madcap2.tricolour.ca> <20210218125248.GB22944@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210218125248.GB22944@breakpoint.cc> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-02-18 13:52, Florian Westphal wrote: > Richard Guy Briggs wrote: > > On 2021-02-18 09:22, Florian Westphal wrote: > > > > It seems I'd need to filter out the NFT_MSG_GET_* ops. > > > > > > No need, the GET ops do not cause changes and will not trigger a > > > generation id change. > > > > Ah, so it could trigger on generation change. Would GET ops be included > > in any other change > > No, GET ops are standalone, they cannot be part of a transaction. > If you look at > > static const struct nfnl_callback nf_tables_cb[NFT_MSG_MAX] = { > > array in nf_tables_api.c, then those ops with a '.call_batch' can > appear in transaction (i.e., can cause modification). > > The other ones (.call_rcu) are read-only. > > If they appear in a batch tehy will be ignored, if the batch consists of > such non-modifying ops only then nf_tables_commit() returns early > because the transaction list is empty (nothing to do/change). Ok, one little inconvenient question: what about GETOBJ_RESET? That looks like a hybrid that modifies kernel table counters and reports synchronously. That could be a special case call in nf_tables_dump_obj() and nf_tables_getobj(). Will that cause a storm per commit? > > such that it would be desirable to filter them out > > to reduce noise in that single log line if it is attempted to list all > > the change ops? It almost sounds like it would be better to do one > > audit log line for each table for each family, and possibly for each op > > to avoid the need to change userspace. This would already be a > > significant improvement picking the highest ranking op. > > I think i understand what you'd like to do. Yes, that would reduce > the log output a lot. Coded, testing... - 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