Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbdLKQwu (ORCPT ); Mon, 11 Dec 2017 11:52:50 -0500 Received: from sonic312-28.consmr.mail.ne1.yahoo.com ([66.163.191.209]:38255 "EHLO sonic312-28.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbdLKQwq (ORCPT ); Mon, 11 Dec 2017 11:52:46 -0500 X-YMail-OSG: 0IvgyCUVM1kAGc_9dMlAYfI532sqqO4Xw2bhXHp0tIPBN7eupsrE6b4O9aWN1xF z28mLk1sQkDuwNt0JN80ix7KC254EjCvSq8iqpTyCbjLW9IT24QkT_dv71UCoMFlhQRaXBkt41Bq dG6fyKQOv98GcdgI4xznHw2tfgFuA1ygsZxIQotL9x.hgUX5PiAY6Z0y2Q9fjjAKG6gzMIsy4IPu F_ehco.rzaUuZOvew2fBY61Id4NCN8U28yKMiIFxd1BkHAxybt3rzb_gZRRroVaNYUMiUYuPiUUl acOQuVyCPzo1Yexg4x.bQR0l4ESjEvQlW6RNBYInFYf2mGhx6v_VGApouwTWmD8N8v_QvpfI3bSM d6KfDOGGNZt0jLVXrlG19Iq57lsyPj79aHE68v2at7CrcqWJjwIq_O4HPy0jHUNCDbIzDOd6feG. tx4kTxq_RZDIHgDFn0nZEw4prrPDxBJ7VLMwN0MSzz0Xs1opQBFzIKQSM2qqoyskmz4m8gvoUXNs wTQ1e.RAyWZ_vlZIRRw-- Subject: Re: RFC(v2): Audit Kernel Container IDs To: Eric Paris , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Richard Guy Briggs , cgroups@vger.kernel.org, Linux Containers , Linux API , Linux Audit , Linux FS Devel , Linux Kernel , Linux Network Development Cc: mszeredi@redhat.com, "Eric W. Biederman" , Simo Sorce , jlayton@redhat.com, "Carlos O'Donell" , David Howells , Al Viro , Andy Lutomirski , Eric Paris , trondmy@primarydata.com, Michael Kerrisk References: <20171012141359.saqdtnodwmbz33b2@madcap2.tricolour.ca> <75b7d6a6-42ba-2dff-1836-1091c7c024e7@schaufler-ca.com> <7ebca85a-425c-2b95-9a5f-59d81707339e@digikod.net> <1513009857.6310.337.camel@redhat.com> From: Casey Schaufler Message-ID: <50813ebc-5de7-c930-79dc-c1d3cfcfb172@schaufler-ca.com> Date: Mon, 11 Dec 2017 08:52:43 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1513009857.6310.337.camel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 23 On 12/11/2017 8:30 AM, Eric Paris wrote: > On Sat, 2017-12-09 at 10:28 -0800, Casey Schaufler wrote: >> Because a container doesn't have to use namespaces to be a container >> you still need a mechanism for a process to declare that it is in >> fact >> in a container, and to identify the container. > I like the idea but I'm still tossing it around in my head (and > thinking about Casey's statement too). Lets say we have a 'docker-like' > container with pid=100 netns=X,userns=Y,mountns=Z. If I'm on the host > in all init namespaces and I run > nsenter -t 100 -n ip link set eth0 promisc on > How should this be logged? Did this command run in it's own 'container' > unrelated to the 'docker-like' container? Jose Bollo's PTAGS ( https://gitlab.com/jobol/ptags ) would be prefect. Any time you declare something to be a container or enter a namespace you slap a tag on it. Identifying nested containers would be easy, you'd have multiple tags. PTAGS unfortunately needs module stacking, but how hard could that be? > -Eric