Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp139348ybt; Tue, 23 Jun 2020 17:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDJwpKtbGuvUr1mg7xWS3eHhEvM1d75d8HbUPLqypWb3LiDKQO3rbjM9sZWrCGzZ0t3Duj X-Received: by 2002:a50:e881:: with SMTP id f1mr23434878edn.98.1592958958457; Tue, 23 Jun 2020 17:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592958958; cv=none; d=google.com; s=arc-20160816; b=tvImVF1WuwfwyAAM3QyaqUYYrI1FPnPfS7LV9PhiHM4RfxvWYmGIMeEOmr49WwhuVg D3k2A1OGsQ34TL32pzwdwinGEyYdTfBalfZGYd46ZCtZYe2tQih2TMCYlKBbJzahUN5/ UWNiXK037gtrxIER09blP7heseAFSkPXvW+hNkbiugFNUsEZCCvEsXyX65esNeU1sevB hkzp13H77yxPDaIXThRpJVJpyeSEf8rqp4rAOIC2lBmUzz9vFpyGwX28d0j5E05fn5/V 5+v6pSO3IptnHHUxF7JquO+5ezlbfqKNzYrFh8WzAu2g5ClwJc7TlzPAvit+SlQ8O7OS DbHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+/TMyKbqoSzMGZ/AAiVOjNfJfvqMvVU1A+eHQRRA5RQ=; b=q9rD01F2/XFUe+88HR2xjs3XfSyB2fSx8y/4vz2SLIsPhaoS6ZW4cIKR1rCDNBliRU +C4Vf6R4iBE/uQLW4PPeTJJNtYfWpr5veC7+ACjzxkKI9IfUEhcD/NdnrP1N99Kanpcc HP95oThYEs/xz87bQwb1JNjG7GJ9pX/inTKLvRSS9loxwqW8zBMGnuQ8WqZcZ/F46RNA WJK0fw37OkUoil0Pi1sv5TaDfeaSFyYSdGCflzEEQlPA7rCFQc8gt+Y7xTEABZ5sCnwg QsxHmICER5zhWqtpID6mH3ZLES3elJtxoVRkuqmslSfDM8/sK+UECpwVJC/Mhv9tIJQu mbTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=Il6fK4QN; 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 l6si5113686ejx.493.2020.06.23.17.35.34; Tue, 23 Jun 2020 17:35:58 -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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=Il6fK4QN; 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 S2388154AbgFXAfJ (ORCPT + 99 others); Tue, 23 Jun 2020 20:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387757AbgFXAfI (ORCPT ); Tue, 23 Jun 2020 20:35:08 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7E3C061573 for ; Tue, 23 Jun 2020 17:35:08 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id w7so182782edt.1 for ; Tue, 23 Jun 2020 17:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+/TMyKbqoSzMGZ/AAiVOjNfJfvqMvVU1A+eHQRRA5RQ=; b=Il6fK4QN3tYHRegbTX3T3xxgdNRK5bhnoaFX2nMUJ+Y1ejGKz2mICnpBctazU0eFYI +6WYLhCDE5IutdeL6ipgrxuodVn0WCfWMCh+6ZjduvztoIRvdYwvs+tLmVdloyVBKiKd Xd+vTYw8xNdYoCfPjbV2eezQeBcRSM44RaXGj8NkQxehNrlsHYyXRmkwpyHmy1siSgO6 ZFYlVPr2FiXxrnQJ36LJoAm40RFBS9bsdAG8NX38Q6o9LJ9GpiteFIUbzRViVzxjz2QG dtjlJa9eIfNen/2eoSRu75VwCM/b6Rv/nw0czAWfLNCBBqW2ylJSvPSws70uAz6eaETU GddA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+/TMyKbqoSzMGZ/AAiVOjNfJfvqMvVU1A+eHQRRA5RQ=; b=ZODDk4ompdzQTFDIYgj+JXGaa9nfAVbvG0ZUcCDv+9Ylkm6mEIP5WGV6kb+0Z2WC2q 9I0NRYoI4U0PCx47LmD/SYI/dIphGVPTTYzdZ3lGhM3bwqRULS8L5pXMGWuYY+Oxs5Ho gtMP29BOujD2lYzdjVQE9fpBnhKin9l8sxy5V7ypamBv8FLvIS1or0K+iwY/9S/Ecziy iIPcDTkvfRi0hN670ZEWqNo2AGd2KvPrS6zfE9VUQOiR8pzD8mUTZ+z0KttWl2d/24wh kbSj8x68RB5GhScNUX20ACLaO62CpBaHwhoQy44h+3p2DtbnMZYn+hOQZxPFo2T8KTYG ctlg== X-Gm-Message-State: AOAM530/Vzui8Ajbci5oOst8DuEGtID5z9oefIJKnJS9i3PhJuMEc5NV mpKT9hQb70uKmSvtz05uiug5Op76T63mEfAfcAlM X-Received: by 2002:aa7:da46:: with SMTP id w6mr23979297eds.31.1592958906753; Tue, 23 Jun 2020 17:35:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Paul Moore Date: Tue, 23 Jun 2020 20:34:55 -0400 Message-ID: Subject: Re: [PATCH ghak124 v3] audit: log nftables configuration change events To: Richard Guy Briggs Cc: Linux-Audit Mailing List , LKML , netfilter-devel@vger.kernel.org, sgrubb@redhat.com, Ondrej Mosnacek , fw@strlen.de, twoerner@redhat.com, Eric Paris , tgraf@infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 4, 2020 at 9:21 AM 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. > > This uses the same NETFILTER_CFG record format but overloads the table > field. > > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.878:162) : table=?:0;?:0 family=unspecified entries=2 op=nft_register_gen pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > ... > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.878:162) : table=firewalld:1;?:0 family=inet entries=0 op=nft_register_table pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > ... > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.911:163) : table=firewalld:1;filter_FORWARD:85 family=inet entries=8 op=nft_register_chain pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > ... > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.911:163) : table=firewalld:1;filter_FORWARD:85 family=inet entries=101 op=nft_register_rule pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > ... > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.911:163) : table=firewalld:1;__set0:87 family=inet entries=87 op=nft_register_setelem pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > ... > type=NETFILTER_CFG msg=audit(2020-05-28 17:46:41.911:163) : table=firewalld:1;__set0:87 family=inet entries=0 op=nft_register_set pid=396 subj=system_u:system_r:firewalld_t:s0 comm=firewalld > > For further information please see issue > https://github.com/linux-audit/audit-kernel/issues/124 > > Signed-off-by: Richard Guy Briggs > --- > Changelog: > v3: > - inline message type rather than table > > v2: > - differentiate between xtables and nftables > - add set, setelem, obj, flowtable, gen > - use nentries field as appropriate per type > - overload the "tables" field with table handle and chain/set/flowtable > > include/linux/audit.h | 18 ++++++++ > kernel/auditsc.c | 24 ++++++++-- > net/netfilter/nf_tables_api.c | 103 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 142 insertions(+), 3 deletions(-) I'm not seeing any additional comments from the netfilter folks so I've gone ahead and merged this into audit/next. Thanks Richard. -- paul moore www.paul-moore.com