Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1644374ybg; Thu, 4 Jun 2020 15:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK2gVGf4fYEm4NxUI01QBcw1/Uc+/9qk+EFN2NDu1bDp8VC69t22/5sQIRvIDj7tU52BaR X-Received: by 2002:a17:906:370a:: with SMTP id d10mr5734381ejc.433.1591309493728; Thu, 04 Jun 2020 15:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591309493; cv=none; d=google.com; s=arc-20160816; b=A+NM3naWCuXCn1TYQUmHaG7KvKmmMzmarxAQ2cwANr853BavO2p89KgODweCWOzQtO 0GiVlbn7jPQ7Oj4ElpO2MaLkzl/OfCTkuZjeUCsWVRcC6OO0rNCZDHKMsNTyO5vbtGik hzfgFxnEp6zRQRc1vlCeiFUIIpGmEgoqqDvtXIgW3nBYidUA8qsWJIxJe3P641mam47O FmzVM9+muz3qK6FyBei1pq4jVsx8KG8aiSvpybhETFUle9yajH3edjm/bt+hVWAB2Z2d 6adcd4D0b1Kznh1Rw3/Zq2yJEZK5/OZzDMCnw3VaG9LzRxgrc5arsavu2OatNKssRxjP qeWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=SsOiww58zMB8TiRbvx8d+FF7JBDwRx5PHUOX+iIdx7A=; b=ZsRdAkwnMC+5LWujBW3DPTSkP8nPL5d9AVUzBqjLbjRtbNKo8j5MmJ/E1QnZOZlcBR k1A92oYDUM4nJK//To4s8+zH4/IERMjWw1SfiLCkGZY6mvfL/N1neXq05KHTlpXL7MxO /PK7gaziBYw7e3nwLbKTc8dIfqUE0x9Vs9qW4KqRChhlhxFwgcuQ9jwb0jWTDWT1eTNF Nxl9t6+Si+MB27aL5mWM43qWev9IyWmA0rgfvBKyPVhQhVbqL2Ya3KIcK29a5RV/ago1 1RdiFzfMOrJJGwbmkYtKo5mUUDdrn8XJrMOldw0M1DeL6G6ijT2OxvtiiCsFN/rVGdea Pkng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dTfjL6bW; 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 k1si2287979ejb.562.2020.06.04.15.24.31; Thu, 04 Jun 2020 15:24:53 -0700 (PDT) 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=dTfjL6bW; 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 S1729011AbgFDSwO (ORCPT + 99 others); Thu, 4 Jun 2020 14:52:14 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30583 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728986AbgFDSwO (ORCPT ); Thu, 4 Jun 2020 14:52:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591296732; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SsOiww58zMB8TiRbvx8d+FF7JBDwRx5PHUOX+iIdx7A=; b=dTfjL6bW+YDGfmAWij/vn7mPaiCpzJVPlyQEW+ujq76Dp5dJ8nfcqGCyDJQr+IfhAKnu/x 1NnQtIPMWx5qllxgL+gfbn5CfIOp4Ta+eDOR5QpfahV9ArMe5DL+Yh4Z8E3h7DFq0uw1rL ZdXwXruZmTJ7j7bt/uIqFY3A0cmdsks= 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-30-11_TenfrO4GLK4lbkdXN-A-1; Thu, 04 Jun 2020 14:52:08 -0400 X-MC-Unique: 11_TenfrO4GLK4lbkdXN-A-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 2F9008DFFD0; Thu, 4 Jun 2020 18:52:07 +0000 (UTC) Received: from x2.localnet (ovpn-112-220.phx2.redhat.com [10.3.112.220]) by smtp.corp.redhat.com (Postfix) with ESMTP id 170915D9D3; Thu, 4 Jun 2020 18:51:56 +0000 (UTC) From: Steve Grubb To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , netfilter-devel@vger.kernel.org, Paul Moore , 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 Date: Thu, 04 Jun 2020 14:51:54 -0400 Message-ID: <2190308.cDvYnDs5iT@x2> Organization: Red Hat In-Reply-To: <20200604175756.d3x5fy4k4urilgbp@madcap2.tricolour.ca> References: <530434533.t1QJnzVmUA@x2> <20200604175756.d3x5fy4k4urilgbp@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, June 4, 2020 1:57:56 PM EDT Richard Guy Briggs wrote: > > > diff --git a/kernel/auditsc.c b/kernel/auditsc.c > > > index 468a23390457..3a9100e95fda 100644 > > > --- a/kernel/auditsc.c > > > +++ b/kernel/auditsc.c > > > @@ -75,6 +75,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > > > #include "audit.h" > > > > > > @@ -136,9 +137,26 @@ struct audit_nfcfgop_tab { > > > }; > > > > > > static const struct audit_nfcfgop_tab audit_nfcfgs[] = { > > > - { AUDIT_XT_OP_REGISTER, "register" }, > > > - { AUDIT_XT_OP_REPLACE, "replace" }, > > > - { AUDIT_XT_OP_UNREGISTER, "unregister" }, > > > + { AUDIT_XT_OP_REGISTER, "xt_register" > > > > }, > > > > > + { AUDIT_XT_OP_REPLACE, "xt_replace" > > > }, + { AUDIT_XT_OP_UNREGISTER, "xt_unregister" > > > }, + { AUDIT_NFT_OP_TABLE_REGISTER, > > > "nft_register_table"> > > }, > > > > > + { AUDIT_NFT_OP_TABLE_UNREGISTER, "nft_unregister_table" > > > }, + { AUDIT_NFT_OP_CHAIN_REGISTER, > > > "nft_register_chain"> > > }, > > > > > + { AUDIT_NFT_OP_CHAIN_UNREGISTER, "nft_unregister_chain" > > > }, + { AUDIT_NFT_OP_RULE_REGISTER, > > > "nft_register_rule"> > > }, > > > > > + { AUDIT_NFT_OP_RULE_UNREGISTER, "nft_unregister_rule" > > > > }, > > > > > + { AUDIT_NFT_OP_SET_REGISTER, "nft_register_set" > > > > }, > > > > > + { AUDIT_NFT_OP_SET_UNREGISTER, "nft_unregister_set" > > > > }, > > > > > + { AUDIT_NFT_OP_SETELEM_REGISTER, "nft_register_setelem" > > > }, + { AUDIT_NFT_OP_SETELEM_UNREGISTER, > > > "nft_unregister_setelem" }, + { AUDIT_NFT_OP_GEN_REGISTER, > > > "nft_register_gen" }, + { > > > AUDIT_NFT_OP_OBJ_REGISTER, "nft_register_obj" }, + > > > { AUDIT_NFT_OP_OBJ_UNREGISTER, "nft_unregister_obj" > > > }, + { AUDIT_NFT_OP_OBJ_RESET, "nft_reset_obj" > > > }, + { AUDIT_NFT_OP_FLOWTABLE_REGISTER, > > > "nft_register_flowtable" }, + { > > > AUDIT_NFT_OP_FLOWTABLE_UNREGISTER, "nft_unregister_flowtable" }, + > > > { AUDIT_NFT_OP_INVALID, "nft_invalid" > > > > }, > > > > > }; > > > > I still don't like the event format because it doesn't give complete > > subject information. However, I thought I'd comment on this string > > table. Usually it's sufficient to log the number and then have the > > string table in user space which looks it up during interpretation. > > That is a good idea that would help reduce kernel cycles and netlink > bandwidth, but the format was set in 2011 so it is a bit late to change > that now: > fbabf31e4d48 ("netfilter: create audit records for x_tables > replaces") Nothing searches/interprets that field name. So, you can redefine it by renaming it. Or just go with what you have. My preference is push that to user space. But not a showstopper "as is". -Steve