Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6107721imm; Mon, 23 Jul 2018 11:32:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcntt+DuENrleu5ogDKI1qa96lrRslEfy+7I9O+lOlAJFZusYnJ/DhMR3OZ2X2jaYvypoPh X-Received: by 2002:a17:902:760d:: with SMTP id k13-v6mr13767019pll.56.1532370752093; Mon, 23 Jul 2018 11:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532370752; cv=none; d=google.com; s=arc-20160816; b=nO8SLvC0Io31KxOa5ZVMGbu5fz+RP+mjnrDQRECGlXLUUc368v8WW7XLPmBBkTi94o ncZtyLTtVjbgdXwUyyTVdLkvPG3aPa90iTuf5o0bOCCsxZBisYuGMUb4rko0+ikGlmFO Yf6vdOR+zoaImwulW2U5tuonjebztpjwqO32M4gMHTBg/zulBYiISjKp4JvBzvE+RwEw hUJYiWRB4DH6M+OyqRj8nKCzujJB/HX8AKMpwWvTCKRPhf1TPNL99xiqFvCdYEKr7qJ9 Fy8JEU9GLQXR2dJ06xiDqEq9RsefNYXKMRngimkX4pM6f9MpoOS3xAzQzL/5/X1X9uWT 2JaQ== 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 :arc-authentication-results; bh=jl9N+vIKdPZXD2bA1vCp/ip+qMPn3HmCXAiDuY1w9J8=; b=KU2pMDqIMuuqlGYrrvyJkC5/IIzRXrboxh1GGFX70R9cIwQziPNLbKCCnYJc5J5y9e zcBvpusYtMuh4COCViArWL+e5YYsSqw5ZnDIacjpRr6/+SpED0VYxwu8RZ4ZosNJdzPO wrcaXKubn3dYd8YHKkliaVkqAR9h6Boyy9XEpDvm554LsVwtRKBazj3Y5ZDmjJslPovB p9nxol8jMTsKuwirmjIn1r2G9E4zeUanQBsoiyR9c6c2W0By3hWp9uQSnkj8nxA3/DIb ngD1FI5xy79+ULRKW9I9ZCI4dIEEJs2gKWCBIe4VhyHxPDWr+9HRkISZDUamXdeklw+Z 5eDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=OAxm4A1y; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81-v6si10374131pfa.368.2018.07.23.11.32.17; Mon, 23 Jul 2018 11:32:32 -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; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=OAxm4A1y; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388098AbeGWTdz (ORCPT + 99 others); Mon, 23 Jul 2018 15:33:55 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43360 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388058AbeGWTdy (ORCPT ); Mon, 23 Jul 2018 15:33:54 -0400 Received: by mail-lf1-f68.google.com with SMTP id m12-v6so1164706lfc.10 for ; Mon, 23 Jul 2018 11:31:24 -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=jl9N+vIKdPZXD2bA1vCp/ip+qMPn3HmCXAiDuY1w9J8=; b=OAxm4A1yatnhoX93nX4Mrcl3Jr0sVj0bJd5fFj2rVbIhY6JWqbwRYZeTtrB4CRtNSx 4vU/4OgWn4aVg3PJc+w1PTQcHeTh/TMfZ+YGWjDKDplGO6fVsw5stiq/QaHk9SMWABw4 Y9KIpEv0SEEu8XxcX8Zd61D9+QOxJKHZUFp0fyM7WUazm95RZ3UD6nL16pTvpHiVVOm+ IqrFv3rUua/je3hVMJOo+C9eVg4ExPNLnStTJTA3b9AtewKTsFQ2dGXPJXa7GyPKZ8iN EOMZcv2FLLBK+ySH6EwXakzKdFkjH4UDL4sZF0X+58a6zNv9ooqz64skkyfO5573oe+q LQUg== 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=jl9N+vIKdPZXD2bA1vCp/ip+qMPn3HmCXAiDuY1w9J8=; b=K+DakafcsFBki0tv/n2Tklsz4v4h0sBFuGGxYE2M/q2t1V06xn+VAOVPUbxp4IsAto AZK4RXkq4SDzILNpEWxH9W7p26Mw/ob4AdJmmlLWHpXFb+gnLwim3gO8d/f7b9JHiilq BhdX2J8OiZa5+YYtFsTN4ci5tV4vr4w7/+jLdzqhROYvModkpO+RXOj0APzJUW712PzW oPnLK4lX+OOJFknvi02C6848/vbkgGTGIXFAGKRpITNnjjo+Tb8GtOAp8OKsbtjqxwtN YpN0sgxb+FujeFw4qgSe6qemo+eqFKPg771qf4njCKkLR2LafsLTHdgGhGd6KAsUXCKN 04sw== X-Gm-Message-State: AOUpUlGj1JGIAOpDdk1u7R8miiyHyQ23Dis/nGA60CsxDMGFpw2w3XDk NpaBH9d482IOhChsVlq4fMulcJ5lb3AlGdBxciMU X-Received: by 2002:a19:9a81:: with SMTP id c123-v6mr8431505lfe.106.1532370683233; Mon, 23 Jul 2018 11:31:23 -0700 (PDT) MIME-Version: 1.0 References: <3318670.y8SpQ3RC2W@x2> <20180723151148.hyu4jqy2etp5afpt@madcap2.tricolour.ca> <2739536.aL1iVigTi9@x2> In-Reply-To: <2739536.aL1iVigTi9@x2> From: Paul Moore Date: Mon, 23 Jul 2018 14:31:11 -0400 Message-ID: Subject: Re: [RFC PATCH ghak90 (was ghak32) V3 02/10] audit: log container info of syscalls To: sgrubb@redhat.com, rgb@redhat.com Cc: 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 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 Mon, Jul 23, 2018 at 12:48 PM Steve Grubb wrote: > 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. I think we should keep the "op" field for audit container ID management operations, even though we really only have a "set" operation at the moment, but the others should drop the "op" field (see my previous emails in this thread). -- paul moore www.paul-moore.com