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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98F5CC433DB for ; Thu, 18 Feb 2021 14:36:47 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FD9E64EB6 for ; Thu, 18 Feb 2021 14:36:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FD9E64EB6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=linux-audit-bounces@redhat.com 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-482-YlmtpX9JM0ihbCpIiEIrxw-1; Thu, 18 Feb 2021 09:36:43 -0500 X-MC-Unique: YlmtpX9JM0ihbCpIiEIrxw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CE07195D562; Thu, 18 Feb 2021 14:36:39 +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 B8B5C60864; Thu, 18 Feb 2021 14:36:38 +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 D6A0E18095CB; Thu, 18 Feb 2021 14:36:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11IDfG3w024523 for ; Thu, 18 Feb 2021 08:41:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id B09A111E5B6; Thu, 18 Feb 2021 13:41:16 +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 AB4BA11E5B4 for ; Thu, 18 Feb 2021 13:41:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9376E186E120 for ; Thu, 18 Feb 2021 13:41:13 +0000 (UTC) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [193.142.43.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-LswdWCkLOhGLS7VQK5XHbw-1; Thu, 18 Feb 2021 08:41:09 -0500 X-MC-Unique: LswdWCkLOhGLS7VQK5XHbw-1 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lCjYI-0006xj-Uv; Thu, 18 Feb 2021 14:41:07 +0100 Date: Thu, 18 Feb 2021 14:41:06 +0100 From: Florian Westphal To: Richard Guy Briggs Subject: Re: [PATCH ghak124 v3] audit: log nftables configuration change events Message-ID: <20210218134106.GC22944@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> <20210218125248.GB22944@breakpoint.cc> <20210218132843.GP3141668@madcap2.tricolour.ca> MIME-Version: 1.0 In-Reply-To: <20210218132843.GP3141668@madcap2.tricolour.ca> User-Agent: Mutt/1.10.1 (2018-07-13) 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.79 on 10.11.54.5 X-loop: linux-audit@redhat.com X-Mailman-Approved-At: Thu, 18 Feb 2021 09:32:33 -0500 Cc: Phil Sutter , Florian Westphal , LKML , Linux-Audit Mailing List , netfilter-devel@vger.kernel.org, twoerner@redhat.com, Eric Paris , tgraf@infradead.org 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.13 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 Richard Guy Briggs wrote: > Ok, can I get one more clarification on this "hierarchy"? Is it roughly > in the order they appear in nf_tables_commit() after step 3? It appears > it might be mostly already. If it isn't already, would it be reasonable > to re-order them? Would you suggest a different order? For audit purposes I think enum nf_tables_msg_types is already in the most relevant order, the lower numbers being more imporant. So e.g. NEWTABLE would be more interesting than DELRULE, if both are in same batch. > > > 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. > > Would the generation change id be useful outside the kernel? Yes, we already announce it to interested parties via nfnetlink. > What > exactly does it look like? Its just a u64 counter that gets incremented whenever there is a change. > I don't quite understand the genmask purpose. Thats an implementation detail only. When we process a transaction, changes to the ruleset are being made but they should not have any effect until the entire transaction is processed. So there are two 'generations' at any time: 1. The active ruleset 2. The future ruleset 2) is what is being changed/modified. When the transaction completes, then the future ruleset becomes the active ruleset. If the transaction has to be aborted, the pending changes are reverted and the genid/genmasks are not changed. -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit 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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E433AC433E0 for ; Thu, 18 Feb 2021 17:05:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9899064D9A for ; Thu, 18 Feb 2021 17:05:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbhBRREp (ORCPT ); Thu, 18 Feb 2021 12:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbhBRNlt (ORCPT ); Thu, 18 Feb 2021 08:41:49 -0500 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B943EC061756; Thu, 18 Feb 2021 05:41:08 -0800 (PST) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lCjYI-0006xj-Uv; Thu, 18 Feb 2021 14:41:07 +0100 Date: Thu, 18 Feb 2021 14:41:06 +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: <20210218134106.GC22944@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> <20210218125248.GB22944@breakpoint.cc> <20210218132843.GP3141668@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210218132843.GP3141668@madcap2.tricolour.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Richard Guy Briggs wrote: > Ok, can I get one more clarification on this "hierarchy"? Is it roughly > in the order they appear in nf_tables_commit() after step 3? It appears > it might be mostly already. If it isn't already, would it be reasonable > to re-order them? Would you suggest a different order? For audit purposes I think enum nf_tables_msg_types is already in the most relevant order, the lower numbers being more imporant. So e.g. NEWTABLE would be more interesting than DELRULE, if both are in same batch. > > > 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. > > Would the generation change id be useful outside the kernel? Yes, we already announce it to interested parties via nfnetlink. > What > exactly does it look like? Its just a u64 counter that gets incremented whenever there is a change. > I don't quite understand the genmask purpose. Thats an implementation detail only. When we process a transaction, changes to the ruleset are being made but they should not have any effect until the entire transaction is processed. So there are two 'generations' at any time: 1. The active ruleset 2. The future ruleset 2) is what is being changed/modified. When the transaction completes, then the future ruleset becomes the active ruleset. If the transaction has to be aborted, the pending changes are reverted and the genid/genmasks are not changed.