Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5799501imm; Mon, 23 Jul 2018 06:21:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeT1JM5V1MxY1rZuzqaP7n6E/x+IBoxCWYc4eu6/JhSyeCyfCL9jAiDNgb5TpnGZUWeWthv X-Received: by 2002:a62:aa02:: with SMTP id e2-v6mr13103457pff.211.1532352070443; Mon, 23 Jul 2018 06:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532352070; cv=none; d=google.com; s=arc-20160816; b=Kpbgj3Z/PGNZtuarLonSo2q/G7xghrJkO7r0prt078D6RuZNLjYs9rIZ+GWXvhwMqG Gm8ELiVCbNb/hfMqQXCHRj33/vKIjtK2hyVg9cGAW9CNNFx21XvicXNw5IGs+xNZieQ3 6Etq3yslq8BXEtJlBynXtp6dBTWVwhrKOSZJNXfoTgXQ1GfBEUFgXqE9xJIaZ9068ya+ LZOfv+UmGKY7JzIPGY6TCQc5vQTCgWyoZZwffXa3zxlpPJiqUERs6IX6AOaTx5sWVRfm u1ormPP3aUT+dAlgD5fyI57jeYDtUa0NwNfyNPf6taiLhKNJULCcYvKfn5Xh5nYV/VM/ qiuQ== 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=xnoi9jzuOT9fiCuC5kcol4QdaK7ZY+j1cMwob8yz+48=; b=qMf4i/JB6xtjJ3800XZGlCMsWqPCeP3/nPr7fmuHREJvOsvnEerNgVidz0B17sjk/i R+3j7mFwwEnY5xHfA9+VnRtoKsoZUi6B7kryslJlcDv9pO2ygsrwAi+j+znxaohG2xLo XiVDU11PMffHBy0tzLu4Fg8qeWSVbMZKIBRnS1nM0CkYJio04hu7Lxp9CYu6RRANktwR 0cn+/rTFuR6tEaRSWWPocW1A0WGwW9miFCj4TUfsuPmBavQhN3mm+Rry+e3fyGzR1BmK sjdjWagzYvk5y4x35lMncuwLIolSuY6MySgoFlE76SxGPIUhaOV8VHB7rteczPo8wa+I RD8g== 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 t189-v6si9265550pgb.440.2018.07.23.06.20.55; Mon, 23 Jul 2018 06:21:10 -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 S2388256AbeGWOVJ (ORCPT + 99 others); Mon, 23 Jul 2018 10:21:09 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38054 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388053AbeGWOVI (ORCPT ); Mon, 23 Jul 2018 10:21:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C5A68790F; Mon, 23 Jul 2018 13:19:55 +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 286D3111CA17; Mon, 23 Jul 2018 13:19:47 +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 09:19:47 -0400 Message-ID: <3318670.y8SpQ3RC2W@x2> Organization: Red Hat In-Reply-To: <20180722205510.eh2n7bcd52454dwj@madcap2.tricolour.ca> References: <5467262.rd0RIe6TW9@x2> <20180722205510.eh2n7bcd52454dwj@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.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 23 Jul 2018 13:19:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 23 Jul 2018 13:19:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 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. -Steve