Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7125699pxb; Thu, 18 Feb 2021 02:01:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEZ+mOqGLuLzmOdk71NVUta8nfIysIWEvh9rxzuATnNiCyOmpifDVAsp9c4OwBb7MaAB5J X-Received: by 2002:a17:906:555:: with SMTP id k21mr3236723eja.148.1613642480180; Thu, 18 Feb 2021 02:01:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613642480; cv=none; d=google.com; s=arc-20160816; b=WoxiweNGu3ed7BdSgPh4/wQBt+wl9RozuDNhDvW/NfWx5xaXl782S9rW5CjgypmWPz N+OyjEhTyZu6yT5lBCrq+S7gG/yfim5vMPhqkcB7+onPTTZVFp0ly1JI4wOA6FJ6DQXh 03WCxOM+SzifvCyGv+1iz9mQ1faz39KvnPdvoWDd3otDL4YhKD380/d2HcQT8fHT3iSg rdsIhmCYZLnQGsx00DI7QuhrHifMB2/rbcxc0PAfaH+xrSmlOILzblCEIfEZO7h6eW7q kuYHNh7repXBiAj1SB/mhxYcuQzi26+1nQm5enzRowK8brAnKNiMZY1VlDaK2Ou2PKDp QIEA== 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=U6vvvJkVMh40la/n+PigWjPBY1VTIBm0qF4f/VQadS0=; b=eqTz99dvMLSrT73y07XUbzVSdWrmZIPBQ9ZBJLpNiL/qL+3yyJiMWgsLlAyzm7VO9O aPXqjI2mkusB2gBpz39rl7Wkg8qyu0HCpm2CaXh6DMNXVao9ALm1R9lebaPDQD29GNpF zwQ5hw04Xf9ytixmGpqHRxQRDQHJEzRQtGQ4B2igzCeNRXF4e5jLmUtzeYq4GDC5mMgm osWvNEmm+AoUKwS9YNcwTGoDNEUUtOVkKuup0dIKbdO+JUD5bOeWpTK8L+pOpSQYnQPT 8deb2ZsjadOSyFneMYZsMmLcavl0xY23wVWz4+R8xvULyuk+lN087rY9ewAXd1ITJw7r zzLQ== 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 jg20si3554549ejc.125.2021.02.18.02.00.55; Thu, 18 Feb 2021 02:01:20 -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 S232129AbhBRJdv (ORCPT + 99 others); Thu, 18 Feb 2021 04:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbhBRIXF (ORCPT ); Thu, 18 Feb 2021 03:23:05 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FAEBC061788; Thu, 18 Feb 2021 00:22:10 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lCeZb-0005qG-MU; Thu, 18 Feb 2021 09:22:07 +0100 Date: Thu, 18 Feb 2021 09:22:07 +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: <20210218082207.GJ2766@breakpoint.cc> References: <20210211151606.GX3158@orbyte.nwl.cc> <20210211202628.GP2015948@madcap2.tricolour.ca> <20210211220930.GC2766@breakpoint.cc> <20210217234131.GN3141668@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217234131.GN3141668@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-11 23:09, Florian Westphal wrote: > > So, if just a summary is needed a single audit_log_nfcfg() > > after 'step 3' and outside of the list_for_each_entry_safe() is all > > that is needed. > > Ok, so it should not matter if it is before or after that > list_for_each_entry_safe(), which could be used to collect that summary. Right, it won't matter. > > If a summary is wanted as well one could fe. count the number of > > transaction types in the batch, e.g. table adds, chain adds, rule > > adds etc. and then log a summary count instead. > > The current fields are "table", "family", "entries", "op". > > Could one batch change more than one table? (I think it could?) Yes. > It appears it can change more than one family. > "family" is currently a single integer, so that might need to be changed > to a list, or something to indicate multi-family. Yes, it can also affect different families. > Listing all the ops seems a bit onerous. Is there a hierarchy to the > ops and if so, are they in that order in a batch or in nf_tables_commit()? 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. > 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.