Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7311930pxb; Thu, 18 Feb 2021 07:00:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL2RGf6ksI9twCJd6K+cl/CtMGywO9Ifs3FybcGpp/gNOveCOynidp2LtxuajyWbWHe/WM X-Received: by 2002:a17:906:3915:: with SMTP id f21mr1582616eje.295.1613660453981; Thu, 18 Feb 2021 07:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613660453; cv=none; d=google.com; s=arc-20160816; b=HqgxfAHx2Jn26gf6xjHARO3EhUZE7h1Hq9H176c98CUCcKbXb8wjW2d1Zm9O2wmz15 +UMtKOfCrzIIW20wqzZBi8zOB4DsajwThiluxfrODm+Np7wrdsMbDGj4x/W4YoSEysiP 9ltRcvlDrFnAFpvoG6CJn47rZtiVVOJF7y86tSVnKeuiAvY84ZNcHmeo0WVZyRe5yMqR 8UmBWd4S4/vvGU6txK4sfztDIm8DflpasIXILHkhSXbHd6wEIguyjBfYuH5DMxPWL0YD rqQIjVw9Wo2EPldEae2LuQx4i4Na62+CSE0p/+gqNp3nGVudabhMFteZGh0Gy5YPCFGZ 6OpQ== 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; bh=WK1xzf4wQ8L1SkVi+YfVrkFtauM6MvKojNGg/P//hXk=; b=XHyXSD18nFY9ZlaFQopm0wxCB1A5rWfcQ6htNMXpHpPAvSL0iP5EzXLTXByxctyvng Ile1OaL4La9c1Rl8sxLDdIz2yxUaJ0yXUNQ81utSGcjT8Gqi3fcUPAfUQBPX4MUZTx4Y J8+5gHiMuXTx//hwUacgzPGJhlkJ2jG9M5aV3LZgnoFKmUHRzAIc9BnhpEHLqZQ253RQ EKly63Dc69x/f+FpdTfYr6wDhVu7kK6DJP4X4ZByEWYhhO1Z48LiRDF5hrrHxxK+sXQ0 lCsxVhrPQeN6qoZK6WEP/4HYmAzR5YEMYC30e3QmvMEbCwKPqmhZIsWr3RocnQ7Uwahh 0qBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si3575743ejk.711.2021.02.18.07.00.27; Thu, 18 Feb 2021 07:00:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbhBRO4N (ORCPT + 99 others); Thu, 18 Feb 2021 09:56:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbhBRMyQ (ORCPT ); Thu, 18 Feb 2021 07:54:16 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C760AC061788; Thu, 18 Feb 2021 04:52:50 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lCinY-0006mx-FH; Thu, 18 Feb 2021 13:52:48 +0100 Date: Thu, 18 Feb 2021 13:52:48 +0100 From: Florian Westphal To: Richard Guy Briggs Cc: Florian Westphal , 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: <20210218125248.GB22944@breakpoint.cc> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210218124211.GO3141668@madcap2.tricolour.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Richard Guy Briggs wrote: > On 2021-02-18 09:22, Florian Westphal wrote: > > No. There is a hierarchy, e.g. you can't add a chain without first > > adding a table, BUT in case the table was already created by an earlier > > transaction it can also be stand-alone. > > Ok, so there could be a stand-alone chain mod with one table, then a > table add of a different one with a "higher ranking" op... Yes, that can happen. > > > 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). > 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.