Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp839651ybz; Fri, 1 May 2020 09:27:13 -0700 (PDT) X-Google-Smtp-Source: APiQypLNFh9TWKdwiNW1AI/KOJ55ctN+B5EtmX7HsWdwt1tr6ku8+fGIqkAS93TQRgRj2sxlnXcW X-Received: by 2002:a50:951c:: with SMTP id u28mr4109312eda.310.1588350432782; Fri, 01 May 2020 09:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588350432; cv=none; d=google.com; s=arc-20160816; b=qQ39bDHIj/jW9u30BCCZ1YTgueSh/TtVeppqjlPV5VxxkFdWC5mj93/xiqVfuQxq/x 4spro044KxyDu3mi2a8oOWfwmaSHtOJ4j0czm33VqQJd6zbQwh9sthsryVE6EZYQ2lpz FDZc+OXmDXnaaubvJ9JMM7TVpw+9dEeI+Qj29qGsg714QXAd+CND3DgAuOT4vDraXVCl cX49EvD3J/FJAG8EgWrBsvTN11+Fu2DDViRm7xUWXjfIilPmChBusefKoTdzM46AezL6 842iDuamLyU4cNH37prhzdJAD4/1U6S6U5dKj1U1TLttgnPbKd8ZhMIjWd+zF/qW9YWW it4w== 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=jfkQqP4P46nAK7oHXekeHfYjV+lTMmLOA7ipwLh/Dr8=; b=fkCZ/9F18PcgOghuUIFDYjOiOBDDkYpAiFvsOMjro9g13hy3u3YovpL/MaiMBKjxY8 xKcb4Fx5bhL4DPOVJ0tnqsXprqnHNMPYpDwceIVa+io26kO9nqCtuTz5EletJjbiECkK wTn+mHATg4uruStAQYspCVaEtYxtynUr/TP4bSEoQEqFrjweVFs+hj47r7jnpO3PypH8 VSy4PNmvuqYhVkOnu3l5SFpIqGSHra0fxXW3AMVsm2gGZf0+PhB/RBP4UwCgGTSQ0wkr r1p3giFBSPfvqtdvLbz5PCleq4l/PE/rQYJZQuXWPaTuRt9Lv7Le5/U15tJEdBEcd7Bj G6bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=Zvn4tyvf; 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 ly8si2270296ejb.254.2020.05.01.09.26.49; Fri, 01 May 2020 09:27:12 -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=Zvn4tyvf; 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 S1729517AbgEAQX2 (ORCPT + 99 others); Fri, 1 May 2020 12:23:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728495AbgEAQX2 (ORCPT ); Fri, 1 May 2020 12:23:28 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF012C061A0C for ; Fri, 1 May 2020 09:23:27 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id s10so7611894edy.9 for ; Fri, 01 May 2020 09:23:27 -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=jfkQqP4P46nAK7oHXekeHfYjV+lTMmLOA7ipwLh/Dr8=; b=Zvn4tyvfjCwJZ4OUXbaZPdeUosydRCUvEPtuDiMRQpLR4Lt1iBBN6upWwzblLJEBt7 DC8Kwix4abLHUDib+LHkkSs5i7qxPasdEY0sZRZw9fareW+qLioVXXvY7J90+WTOqSCr KP3FzIgAp/z6w0Z2zvjoZCK4QVNc2k10LZFzL9i2qpc7qKX9lKA2mbhFHpYmEvgWAq/x BttAwm4H7hbo9DPXsPKU1gbl2gNZA4FrIo8F05isaYZqNS+j/gOrY02+dblEz6//nwDe wrOUKMMBmTF/VPdoL5ub21/7574RN3HHihWiPlLtpNk1F3ssOwvCRXE4ZnTNKz4wfMYo GCqg== 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=jfkQqP4P46nAK7oHXekeHfYjV+lTMmLOA7ipwLh/Dr8=; b=Uo2xOcwvmcWk2N0NJQ89zapFOFtoVRj1RcVapyjAfHnckc7U2PV4Be0LcC3x1rcDtf Dr7/JXkoHnM079ZPmr3/sfW6eeKMOBTLFHfFN2jAgSV8agWmRp6f6FAZJ903nikIkAAr D42esGledeyr92Q8vrOkUSJvJnXf/LVzpYw/YhnafSZePTxFoX6vD2zmkGR/zmVL1j8D 4e6k1Vtjd54PJP+jIwPmq0QAPz9BC/cr0G3djmV0DIlQGiZbNUqN4FgJqw0ZyxLw2EMk S/i81ma8+KjCJeYzxniw+rDpiONgOodbK+poUILh7xqYu0L4cfaVVF6Z8LlXLINCvTYK YICw== X-Gm-Message-State: AGi0PuZD+iVMOr2Q9aRGviG/xzeSS5KWJgMzqFqieFJ9jMtHFEVv5nmu Fs7D2xZAQvegLuMLH68SM8ZhDgWA/DrmrV1DnKFe X-Received: by 2002:aa7:cb0f:: with SMTP id s15mr4169202edt.164.1588350206362; Fri, 01 May 2020 09:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20200429143146.3vlcmwvljo74ydb4@madcap2.tricolour.ca> <3348737.k9gCtgYObn@x2> <20200429213247.6ewxqf66i2apgyuz@madcap2.tricolour.ca> In-Reply-To: <20200429213247.6ewxqf66i2apgyuz@madcap2.tricolour.ca> From: Paul Moore Date: Fri, 1 May 2020 12:23:15 -0400 Message-ID: Subject: Re: [PATCH ghak25 v4 3/3] audit: add subj creds to NETFILTER_CFG record to cover async unregister To: Richard Guy Briggs Cc: Steve Grubb , Linux-Audit Mailing List , LKML , netfilter-devel@vger.kernel.org, omosnace@redhat.com, fw@strlen.de, twoerner@redhat.com, Eric Paris , ebiederm@xmission.com, 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 Wed, Apr 29, 2020 at 5:33 PM Richard Guy Briggs wrote: > On 2020-04-29 14:47, Steve Grubb wrote: > > On Wednesday, April 29, 2020 10:31:46 AM EDT Richard Guy Briggs wrote: > > > On 2020-04-28 18:25, Paul Moore wrote: > > > > On Wed, Apr 22, 2020 at 5:40 PM Richard Guy Briggs > > wrote: > > > > > Some table unregister actions seem to be initiated by the kernel to > > > > > garbage collect unused tables that are not initiated by any userspace > > > > > actions. It was found to be necessary to add the subject credentials > > > > > to cover this case to reveal the source of these actions. A sample > > > > > record: > > > > > type=NETFILTER_CFG msg=audit(2020-03-11 21:25:21.491:269) : table=nat > > > > > family=bridge entries=0 op=unregister pid=153 uid=root auid=unset > > > > > tty=(none) ses=unset subj=system_u:system_r:kernel_t:s0 > > > > > comm=kworker/u4:2 exe=(null)> > > > > [I'm going to comment up here instead of in the code because it is a > > > > bit easier for everyone to see what the actual impact might be on the > > > > records.] > > > > > > > > Steve wants subject info in this case, okay, but let's try to trim out > > > > some of the fields which simply don't make sense in this record; I'm > > > > thinking of fields that are unset/empty in the kernel case and are > > > > duplicates of other records in the userspace/syscall case. I think > > > > that means we can drop "tty", "ses", "comm", and "exe" ... yes? > > > > > > From the ghak28 discussion, this list and order was selected due to > > > Steve's preference for the "kernel" record convention, so deviating from > > > this will create yet a new field list. I'll defer to Steve on this. It > > > also has to do with the searchability of fields if they are missing. > > > > > > I do agree that some fields will be superfluous in the kernel case. > > > The most important field would be "subj", but then "pid" and "comm", I > > > would think. Based on this contents of the "subj" field, I'd think that > > > "uid", "auid", "tty", "ses" and "exe" are not needed. > > > > We can't be adding deleting fields based on how its triggered. If they are > > unset, that is fine. The main issue is they have to behave the same. > > I don't think the intent was to have fields swing in and out depending > on trigger. The idea is to potentially permanently not include them in > this record type only. The justification is that where they aren't > needed for the kernel trigger situation it made sense to delete them > because if it is a user context event it will be accompanied by a > syscall record that already has that information and there would be no > sense in duplicating it. Yes, exactly. -- paul moore www.paul-moore.com