Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp175573ybj; Wed, 6 May 2020 14:30:16 -0700 (PDT) X-Google-Smtp-Source: APiQypImUTswbxJFZjWUq6cU6BAt79NDklzm+nsE19JN1I4r01XqNqXeO4o8XXkQ4klxeAiAUUHf X-Received: by 2002:a50:fc06:: with SMTP id i6mr8558550edr.110.1588800615953; Wed, 06 May 2020 14:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588800615; cv=none; d=google.com; s=arc-20160816; b=KM5QxLFAs7YSZ7e+vID5UysDnK5kAn5vDnaAIOhMdQ98HwWZ2etYULfhHp/oMprXps 92Pgm7I+AaXz18MNtRdBp//FWv02k7gBnTFN+UpH9Q3HoEyWp7XHZwIdzzhnevjq55CE yEx6TcJ2fDRQgnz9805hV8ciCCqlynCKgl9qAyxXDl3XRdKP8oIOxQc9Mmuw9mxsrUV8 EBRmQU2dIm1SCJ2jJKE+aj4DycNUrlT/30fF7v90eJy4BfliMoGGEX/8zcWg7tRDthlv zvcEdeqZn3gwAZ0jlnmekCtiF/KJxfRh/p0L0g2uMfTj7ZMeeVqszcUpBC/hkF0qHKPG cIHg== 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=x+4JHOeVom+2+GvS+WBN7vb+d53P3ecF4mumR/1VYtA=; b=NDgJYGXvcXpOW6Cf0pYAIqlg1mws92/VgrVYMN+iYKtb2lAxRR9qG7QNwGX2LDu1gM +A4jlhv9i/72YaJdJmEWN9y3YFxI8sWIdkL4fCDCaotKR8Fb86nQuvbAxP1EgIEf8/lx UyNjUrS3we4laoC9FNpFS/eB0uzB601JHcd1adUA0R8Z1OAJsssiOT83RmJcQ6uia81e FuuRuoAXZGuoo3Aamm8fycJK+e1Q2/LXCgOeNVd7SSCoM+bsUvxk5fZHrEOmY6sKDcey Rz7wg3b4q7oxUNJXs984UNqr3Hef8JDRhhfCj1ce/yfjnfbMQOrAP3I0yFvn0va2pVGK 6wkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JqkklJK9; 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 h20si1972017eds.141.2020.05.06.14.29.51; Wed, 06 May 2020 14:30:15 -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=JqkklJK9; 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 S1729825AbgEFV0j (ORCPT + 99 others); Wed, 6 May 2020 17:26:39 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:32267 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729684AbgEFV0i (ORCPT ); Wed, 6 May 2020 17:26:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588800396; 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=x+4JHOeVom+2+GvS+WBN7vb+d53P3ecF4mumR/1VYtA=; b=JqkklJK9KKh1Y4xqKkkcq3/4Pd53tRgeSkLhqzf7hdHxlIptnL+N8WGtDq88bNrWjXo0BL nt7bx/iNG6HJOkwFqAcF84kaRcBeqGl2U3zTRWJHH5Gp/6J2X4q5zpf2GWrXHhtD4embgr aSgWd4ZJKWh+5cewPyGTHpu3Lf5M0kM= 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-464-li2f7KgoOsmbIc3SCO0qoA-1; Wed, 06 May 2020 17:26:35 -0400 X-MC-Unique: li2f7KgoOsmbIc3SCO0qoA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63725100CCC2; Wed, 6 May 2020 21:26:33 +0000 (UTC) Received: from x2.localnet (ovpn-113-240.phx2.redhat.com [10.3.113.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE2B510013D9; Wed, 6 May 2020 21:26:26 +0000 (UTC) From: Steve Grubb To: Richard Guy Briggs Cc: Paul Moore , 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 Subject: Re: [PATCH ghak25 v4 3/3] audit: add subj creds to NETFILTER_CFG record to cover async unregister Date: Wed, 06 May 2020 17:26:25 -0400 Message-ID: <3250272.v6NOfJhyum@x2> Organization: Red Hat In-Reply-To: <20200429213247.6ewxqf66i2apgyuz@madcap2.tricolour.ca> References: <3348737.k9gCtgYObn@x2> <20200429213247.6ewxqf66i2apgyuz@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, April 29, 2020 5:32:47 PM EDT 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 > >=20 > > 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=3DNETFILTER_CFG msg=3Daudit(2020-03-11 21:25:21.491:269) : > > > > > table=3Dnat > > > > > family=3Dbridge entries=3D0 op=3Dunregister pid=3D153 uid=3Droot = auid=3Dunset > > > > > tty=3D(none) ses=3Dunset subj=3Dsystem_u:system_r:kernel_t:s0 > > > > > comm=3Dkworker/u4:2 exe=3D(null)> > > > >=20 > > > > [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 t= he > > > > records.] > > > >=20 > > > > 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? > > >=20 > > > 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. > > >=20 > > > 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. > >=20 > > 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. >=20 > 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. We should not be adding syscall records to anything that does not result fr= om=20 a syscall rule triggering the event. Its very wasteful. More wasteful than= =20 just adding the necessary fields. I also wished we had a coding specification that put this in writing so tha= t=20 every event is not a committee decision. That anyone can look at the docume= nt=20 and Do The Right Thing =E2=84=A2. If I add a section to Writing-Good-Events outlining the expected ordering o= f=20 fields, would that be enough that we do not have long discussions about eve= nt=20 format? I'm thinking this would also help new people that want to contribut= e. =2DSteve