Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6011343imm; Mon, 23 Jul 2018 09:50:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeaHNcxKQH8hLplm0FhRkVNcJd0IxUMKxfgUNTvhLjPM4hA8PxFaHXslPCd3AF5mL5GkERR X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr13594205plg.153.1532364628939; Mon, 23 Jul 2018 09:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532364628; cv=none; d=google.com; s=arc-20160816; b=WgCChQX7cxxAsNVRrnXJzBsJnqya4NsHOWo19LlY+dNy4/CeonKS8nCnjk8tarmNxe Ekcp2jGoaryjrGDqZ3sWiCNwSLFTlAWKy9JP2sVQA88mb/nCjUzOYznJ3fRWPdhdMy6L KO1OG4S6pEVQPLpOoepCxO2E4mki58mIA4mldKKe8XHgEe1TcXymSbLpRwuPv47lZlDj 7PT2YhzMEDk4kSJyHtFEXu1IYIDj/r1T9CiRivsO6RSO4CqTTxZDKIWcP2VvMwuKTbrR HHVqK6zRaXsZ01mpUxuDlDybNc06wM/aj/xj1ebxRHBvCetxRKD3Ag5jB+eEKLuai3g+ +Lhw== 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:arc-authentication-results; bh=PUlkqraTsF8H66/Dk1A9F6e5USVUlUdS44Yt/gbvvG4=; b=mNR9Qt9kfIvToEQ2AjtwjpBOs9Fdjq9dj5hpk/sjA+NS6sCsDYqB5jCvA45NUiN1O9 Pam6WsctamMY9Af91056wKcWOsXguAT+BRHHDjXvjisuCHhT1OZ8K4Hl5MW7fovtyhOz 0cg8RLnSeXz8mLLGCOpsGbtg3yUmULV/w3kyX1E24b/DfkZpAGh+sNcqgtn64nq//cDh VlXA7Jeib3ZdSWZWExkWDpXrqrhH3CGYTK8V6XktR+yApEhZquZH85Bzq8CqznHMq5Cp Upoqnf8Vj2dnjogjMGP91+0XlqQoYObjS3gwlwMz6scl+lensEov155f5Pn0j7jH3Eg0 5eKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be5-v6si9047843plb.67.2018.07.23.09.50.13; Mon, 23 Jul 2018 09:50:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388884AbeGWRup (ORCPT + 99 others); Mon, 23 Jul 2018 13:50:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50560 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388587AbeGWRuo (ORCPT ); Mon, 23 Jul 2018 13:50:44 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C88D7264D; Mon, 23 Jul 2018 16:48:39 +0000 (UTC) Received: from x2.localnet (ovpn-122-239.rdu2.redhat.com [10.10.122.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E62F2166BA0; Mon, 23 Jul 2018 16:48:38 +0000 (UTC) From: Steve Grubb To: Richard Guy Briggs Cc: Paul Moore , cgroups@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-audit@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, ebiederm@xmission.com, luto@kernel.org, carlos@redhat.com, dhowells@redhat.com, viro@zeniv.linux.org.uk, simo@redhat.com, Eric Paris , serge@hallyn.com Subject: Re: [RFC PATCH ghak90 (was ghak32) V3 02/10] audit: log container info of syscalls Date: Mon, 23 Jul 2018 12:48:38 -0400 Message-ID: <2739536.aL1iVigTi9@x2> Organization: Red Hat In-Reply-To: <20180723151148.hyu4jqy2etp5afpt@madcap2.tricolour.ca> References: <3318670.y8SpQ3RC2W@x2> <20180723151148.hyu4jqy2etp5afpt@madcap2.tricolour.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 23 Jul 2018 16:48:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 23 Jul 2018 16:48:39 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'sgrubb@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, July 23, 2018 11:11:48 AM EDT Richard Guy Briggs wrote: > On 2018-07-23 09:19, Steve Grubb wrote: > > On Sunday, July 22, 2018 4:55:10 PM EDT Richard Guy Briggs wrote: > > > On 2018-07-22 09:32, Steve Grubb wrote: > > > > On Saturday, July 21, 2018 4:29:30 PM EDT Richard Guy Briggs wrote: > > > > > > > + * audit_log_contid - report container info > > > > > > > + * @tsk: task to be recorded > > > > > > > + * @context: task or local context for record > > > > > > > + * @op: contid string description > > > > > > > + */ > > > > > > > +int audit_log_contid(struct task_struct *tsk, > > > > > > > + struct audit_context *context, > > > > > > > char > > > > > > > *op) > > > > > > > +{ > > > > > > > + struct audit_buffer *ab; > > > > > > > + > > > > > > > + if (!audit_contid_set(tsk)) > > > > > > > + return 0; > > > > > > > + /* Generate AUDIT_CONTAINER record with container ID */ > > > > > > > + ab = audit_log_start(context, GFP_KERNEL, > > > > > > > AUDIT_CONTAINER); > > > > > > > + if (!ab) > > > > > > > + return -ENOMEM; > > > > > > > + audit_log_format(ab, "op=%s contid=%llu", > > > > > > > + op, audit_get_contid(tsk)); > > > > > > > > > > > > Can you explain your reason for including an "op" field in this > > > > > > record > > > > > > type? I've been looking at the rest of the patches in this > > > > > > patchset > > > > > > and it seems to be used more as an indicator of the record's > > > > > > generating context rather than any sort of audit container ID > > > > > > operation. > > > > > > > > > > "action" might work, but that's netfilter and numeric... "kind"? > > > > > Nothing else really seems to fit from a field name, type or lack of > > > > > searchability perspective. > > > > > > > > > > Steve, do you have an opinion? > > > > > > > > We only have 1 sample event where we have op=task. What are the other > > > > possible values? > > > > > > For the AUDIT_CONTAINER record we have op= "task", "target" (from the > > > ptrace and signals patch), "tty". > > > > > > For the AUDIT_CONTAINER_ID record we have "op=set". > > > > Since the purpose of this record is to log the container id, I think that > > is all that is needed. We can get the context from the other records in > > the event. I'd suggest dropping the "op" field. > > Ok, the information above it for two different audit container > identifier records. Which one should drop the "op=" field? Both? Or > just the AUDIT_CONTAINER record? The AUDIT_CONTAINER_ID record (which > might be renamed) could use it to distinguish a "set" record from a > dropped audit container identifier that is no longer registered by any > task or namespace. Neither of them need it. All they need to do is state the container that is being acted upon. -Steve