Received: by 10.223.164.221 with SMTP id h29csp2245584wrb; Tue, 17 Oct 2017 19:04:15 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCzJhokkBudTsU+0nWmlI3jRTqwEQp1EkJZFeqkhqALeyyRuUe2e0OdGuCGx5LscKPOvnkb X-Received: by 10.99.188.9 with SMTP id q9mr11914996pge.104.1508292255793; Tue, 17 Oct 2017 19:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508292255; cv=none; d=google.com; s=arc-20160816; b=VvAwGYXUE6/7sYbAnwVkRpNQDkECzHPqEMlDEOYm3Q3R4Gyh/Blq6z1xG146D3ksEh wZftXVVCwcPyRDvWSd4PCGjgm+aczzEC6A4gMUzfAEZ9qTY9d/w1JVKv8wKJntRqmRAr 6JaX5cwQa4fsbEpcvArn9fYaQIUDagPKYNM+8faV/IlK4aAfdXIb2eOL8kZJL3xtJJo7 cwiAYMt+biR43zMhsdp1nufwFu2SvH86GY8M5xgAhoqIjZ1ZECuULBfW5AqPnLfeVlew eN0KSBAAvYDVAZ/wZCqTInfaDxALPziHzq4goVmXbcX4syJkYtbuUStakxPbVSnC9U+N I/Dg== 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 :organization:references:in-reply-to:date:cc:to:from:subject :message-id:dmarc-filter:arc-authentication-results; bh=bbUEuRWnxm7cnMhtBwAAXw6BpM89te6Xwjy0G1x3dFM=; b=w1UIEYXIcARmyZEJlAzS2Q0eqszP1+FhAlptupBUSZuosES+unEbMax0fJWy1oHP2R rgxlIZ1rkjw9pzXOLZc2F4kpIUFjSFw34+PR4c4iu5ekvgqKFz5TDfQ5XSMs/DtXlRoh zuOTtttPYMgXRaM7Hjag9r3J9VcfzoXvSXujChJ18VOvUpacIG3BGTb9PWMI3VV4phby 2yU1KQH2hecirclyg1ZN1iA2lkuTtGFYqvkOOdINBcUhz4IZAJVGbCqUlQ/N6EY6tTW/ tCp1HjmRX2HCtVqx/tpD2lF3ciDqlhTOlb3EeNCudpx5Px4ZRHik2rjR8O8c2F2loIaq zGZg== 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 h1si2098392pfg.498.2017.10.17.19.04.01; Tue, 17 Oct 2017 19:04:15 -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 S965153AbdJQP26 (ORCPT + 99 others); Tue, 17 Oct 2017 11:28:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43986 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933928AbdJQP2y (ORCPT ); Tue, 17 Oct 2017 11:28:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DED1D20276; Tue, 17 Oct 2017 15:28:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DED1D20276 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=simo@redhat.com Received: from ovpn-116-110.phx2.redhat.com (ovpn-116-110.phx2.redhat.com [10.3.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3C2362511; Tue, 17 Oct 2017 15:28:41 +0000 (UTC) Message-ID: <1508254120.6230.34.camel@redhat.com> Subject: Re: RFC(v2): Audit Kernel Container IDs From: Simo Sorce To: Casey Schaufler , Steve Grubb , linux-audit@redhat.com Cc: Richard Guy Briggs , mszeredi@redhat.com, "Eric W. Biederman" , jlayton@redhat.com, Carlos O'Donell , Linux API , Linux Containers , Linux Kernel , Eric Paris , David Howells , Al Viro , Andy Lutomirski , Linux Network Development , Linux FS Devel , cgroups@vger.kernel.org, "Serge E. Hallyn" , trondmy@primarydata.com Date: Tue, 17 Oct 2017 11:28:40 -0400 In-Reply-To: References: <20171012141359.saqdtnodwmbz33b2@madcap2.tricolour.ca> <75b7d6a6-42ba-2dff-1836-1091c7c024e7@schaufler-ca.com> <20171017003340.whjdkqmkw4lydwy7@madcap2.tricolour.ca> <2319693.5l3M4ZINGd@x2> <1508243469.6230.24.camel@redhat.com> Organization: Red Hat, Inc. Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 17 Oct 2017 15:28:53 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-10-17 at 07:59 -0700, Casey Schaufler wrote: > On 10/17/2017 5:31 AM, Simo Sorce wrote: > > On Mon, 2017-10-16 at 21:42 -0400, Steve Grubb wrote: > > > On Monday, October 16, 2017 8:33:40 PM EDT Richard Guy Briggs > > > wrote: > > > > There is such a thing, but the kernel doesn't know about it > > > > yet.  This same situation exists for loginuid and sessionid > > > > which > > > > are userspace concepts that the kernel tracks for the > > > > convenience > > > > of userspace.  As for its name, I'm not particularly picky, so > > > > if > > > > you don't like CAP_CONTAINER_* then I'm fine with > > > > CAP_AUDIT_CONTAINERID.  It really needs to be distinct from > > > > CAP_AUDIT_WRITE and CAP_AUDIT_CONTROL since we don't want to > > > > give > > > > the ability to set a containerID to any process that is able to > > > > do > > > > audit logging (such as vsftpd) and similarly we don't want to > > > > give > > > > the orchestrator the ability to control the setup of the audit > > > > daemon. > > > > > > A long time ago, we were debating what should guard against rouge > > > processes from setting the loginuid. Casey argued that the > > > ability to > > > set the loginuid means they have the ability to control the audit > > > trail. That means that it should be guarded by CAP_AUDIT_CONTROL. > > > I > > > think the same logic applies today.  > > > > The difference is that with loginuid you needed to give processes > > able > > to audit also the ability to change it. You do not want to tie the > > ability to change container ids to the ability to audit. You want > > to be > > able to do audit stuff (within the container) without allowing it > > to > > change the container id. > > Without a *kernel* policy on containerIDs you can't say what > security policy is being exempted. The policy has been basically stated earlier. A way to track a set of processes from a specific point in time forward. The name used is "container id", but it could be anything. This marker is mostly used by user space to track process hierarchies without races, these processes can be very privileged, and must not be allowed to change the marker themselves when granted the current common capabilities. Is this a good enough description ? If not can you clarify your expectations ? > Without that you can't say what capability is (or isn't) > appropriate. See if the above is sufficient please. > You need a reason to have a capability check that makes sense in the > context of the kernel security policy. I think the proposal had a reason, we may debate on whether that reason is good enough. > Since we don't know what a container is in the kernel, Please do not fixate on the word container. > that's pretty hard. We don't create "fuzzy" capabilities > based on the trendy application behavior of the moment. If the > behavior is not related it audit, there's no reason for it, and > if it is, CAP_AUDIT_CONTROL works just fine. If this doesn't work > in your application security model I suggest that is where you > need to make changes. The authors of the proposal came to the conclusion that kernel assistance is needed. It would be nice to discuss the merits of it. If you do not understand why the request has been made it would be more useful to ask specific questions to understand what and why is the ask. Pushing back is fine, if you have understood the problem and have valid arguments against a kernel level solution (and possibly suggestions for a working user space solution), otherwise you are not adding value to the discussion. Simo. -- Simo Sorce Sr. Principal Software Engineer Red Hat, Inc From 1581557522337924371@xxx Wed Oct 18 01:39:48 +0000 2017 X-GM-THRID: 1581061469540113612 X-Gmail-Labels: Inbox,Category Forums