Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2248646pxb; Thu, 11 Feb 2021 07:54:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqvzsKCR55xilVH0StmiARsOyoW2uWohQjswLXcHLmhePOYVTSGaAplDtxwKfhj7Qbl4Oz X-Received: by 2002:a17:906:d8b5:: with SMTP id qc21mr8717484ejb.62.1613058894863; Thu, 11 Feb 2021 07:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613058894; cv=none; d=google.com; s=arc-20160816; b=s9y4D4o9d70fXkC9G3AeS5JLiOGn6CePX7cg4h41C0AnWB/qsjOivwjRrVGp3Xic4d 7+VtVYJubxpJG5UEkL5d9J4n2SXroyL9pLZPaFOaY27Q4g7DFWKjQiKYZDZ61n/ZT50X aON+6I3gGvr/YSmPN3UP/2XS8hbQ53wOnddhPUxB/7l641i7kQYIDpZ+O8O6zrNrKBzp IOh9uMSN6eanJQhi9NmewqksNIZ18dYVsKAegjkG3dZFIGcr0zsudm3t8HKBNvq8LOiz n4Tb5jWW0pMMssgqsi3YfY5fh230+oylL6zX5cNEIZjA+RgMN8tdXiUQGVhg+ogvsLiG 0Q1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=GEk26/PA3PQbzt55MRuHmsrvGPtw+Xz9j9M8kFnhM3w=; b=GDKRtefjoNESNTWT/8wPoH4WJs8byTBTJCbp9eTQsv4KfJuctDzTt+p0Nxxu/ejJP3 d+vJh/ZxFRJ3iRVXbXQeXMvfWjZcc/U6y6Sc6ZuDoLgtmDig+SFMDriIWpvemgF1fkCZ h2JphkCdmT8wWMRJ31MziFkDWuNJydqH05k8ix669s2NFBx+IE5Gc3jR4KHPuaKpImvW c99qV+kNP9hR80HGyIQNfudyOBWsmGyOFaqw63ZgkcnHdQ/q1s8GdseVXdLKlPXWh4C1 jQfwBisBgjeeci9BKc/nO9TzLxVBk4bSn6D/7Ggl2BFWIfw5oDPM5jbRS+KMWmV2z8Rn Uuag== 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 u8si3989184edv.94.2021.02.11.07.54.29; Thu, 11 Feb 2021 07:54:54 -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 S231513AbhBKPxm (ORCPT + 99 others); Thu, 11 Feb 2021 10:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbhBKPRm (ORCPT ); Thu, 11 Feb 2021 10:17:42 -0500 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 921D7C0613D6; Thu, 11 Feb 2021 07:16:19 -0800 (PST) Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.94) (envelope-from ) id 1lADhO-0002Ym-8N; Thu, 11 Feb 2021 16:16:06 +0100 Date: Thu, 11 Feb 2021 16:16:06 +0100 From: Phil Sutter To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , netfilter-devel@vger.kernel.org, Paul Moore , sgrubb@redhat.com, omosnace@redhat.com, fw@strlen.de, twoerner@redhat.com, eparis@parisplace.org, tgraf@infradead.org Subject: Re: [PATCH ghak124 v3] audit: log nftables configuration change events Message-ID: <20210211151606.GX3158@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Richard Guy Briggs , Linux-Audit Mailing List , LKML , netfilter-devel@vger.kernel.org, Paul Moore , sgrubb@redhat.com, omosnace@redhat.com, fw@strlen.de, twoerner@redhat.com, eparis@parisplace.org, tgraf@infradead.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jun 04, 2020 at 09:20:49AM -0400, Richard Guy Briggs wrote: > iptables, ip6tables, arptables and ebtables table registration, > replacement and unregistration configuration events are logged for the > native (legacy) iptables setsockopt api, but not for the > nftables netlink api which is used by the nft-variant of iptables in > addition to nftables itself. > > Add calls to log the configuration actions in the nftables netlink api. As discussed offline already, these audit notifications are pretty hefty performance-wise. In an internal report, 300% restore time of a ruleset containing 70k set elements is measured. If I'm not mistaken, iptables emits a single audit log per table, ipset doesn't support audit at all. So I wonder how much audit logging is required at all (for certification or whatever reason). How much granularity is desired? I personally would notify once per transaction. This is easy and quick. Once per table or chain should be acceptable, as well. At the very least, we should not have to notify once per each element. This is the last resort of fast ruleset adjustments. If we lose it, people are better off with ipset IMHO. Unlike nft monitor, auditd is not designed to be disabled "at will". So turning it off for performance-critical workloads is no option. Cheers, Phil