Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754039AbbEPOvZ (ORCPT ); Sat, 16 May 2015 10:51:25 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:56472 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbbEPOvV (ORCPT ); Sat, 16 May 2015 10:51:21 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Paul Moore Cc: Daniel J Walsh , Paul Moore , Andy Lutomirski , "Serge E. Hallyn" , Richard Guy Briggs , Linux API , Linux Containers , "linux-kernel\@vger.kernel.org" , Al Viro , linux-audit@redhat.com, Network Development , Linux FS Devel , Eric Paris References: <20150515023221.GC965@madcap2.tricolour.ca> <9125391.7ZiCneo6Xn@sifl> <555711FA.50703@redhat.com> Date: Sat, 16 May 2015 09:46:29 -0500 In-Reply-To: (Paul Moore's message of "Sat, 16 May 2015 08:16:55 -0400") Message-ID: <87r3qgpol6.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX187rcpBKvJbRbxfDZ76sb9HlVxAszWYMTc= X-SA-Exim-Connect-IP: 67.3.205.90 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa04 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa04 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Paul Moore X-Spam-Relay-Country: X-Spam-Timing: total 430 ms - load_scoreonly_sql: 0.10 (0.0%), signal_user_changed: 5 (1.2%), b_tie_ro: 3.6 (0.8%), parse: 0.71 (0.2%), extract_message_metadata: 12 (2.7%), get_uri_detail_list: 1.91 (0.4%), tests_pri_-1000: 4.7 (1.1%), tests_pri_-950: 1.11 (0.3%), tests_pri_-900: 0.94 (0.2%), tests_pri_-400: 25 (5.7%), check_bayes: 24 (5.5%), b_tokenize: 7 (1.7%), b_tok_get_all: 9 (2.0%), b_comp_prob: 2.6 (0.6%), b_tok_touch_all: 2.8 (0.7%), b_finish: 0.69 (0.2%), tests_pri_0: 375 (87.1%), tests_pri_500: 3.7 (0.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH V6 05/10] audit: log creation and deletion of namespace instances X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3422 Lines: 70 Paul Moore writes: > On Sat, May 16, 2015 at 5:46 AM, Daniel J Walsh wrote: >> On 05/15/2015 05:05 PM, Paul Moore wrote: >>> On Thursday, May 14, 2015 11:23:09 PM Andy Lutomirski wrote: >>>> On Thu, May 14, 2015 at 7:32 PM, Richard Guy Briggs wrote: >>>>> On 15/05/14, Paul Moore wrote: >>>>>> * Look at our existing audit records to determine which records should >>>>>> have >>>>>> namespace and container ID tokens added. We may only want to add the >>>>>> additional fields in the case where the namespace/container ID tokens are >>>>>> not the init namespace. >>>>> If we have a record that ties a set of namespace IDs with a container >>>>> ID, then I expect we only need to list the containerID along with auid >>>>> and sessionID. >>>> The problem here is that the kernel has no concept of a "container", and I >>>> don't think it makes any sense to add one just for audit. "Container" is a >>>> marketing term used by some userspace tools. >>>> >>>> I can imagine that both audit could benefit from a concept of a >>>> namespace *path* that understands nesting (e.g. root/2/5/1 or >>>> something along those lines). Mapping these to "containers" belongs >>>> in userspace, I think. >>> It might be helpful to climb up a few levels in this thread ... >>> >>> I think we all agree that containers are not a kernel construct. I further >>> believe that the kernel has no business generating container IDs, those should >>> come from userspace and will likely be different depending on how you define >>> "container". However, what is less clear to me at this point is how the >>> kernel should handle the setting, reporting, and general management of this >>> container ID token. >>> >> Wouldn't the easiest thing be to just treat add a containerid to the >> process context like auid. > > I believe so. At least that was the point I was trying to get across > when I first jumped into this thread. It sounds nice but containers are not just a per process construct. Sometimes you might know anamespace but not which process instigated action to happen on that namespace. >> Then make it a privileged operation to set it. Then tools that care about >> auditing like docker can set the ID >> and remove the Capability from it sub processes if it cares. All >> processes adopt parent processes containerid. >> Now containers can be audited and as long as userspace is written >> correctly nested containers can either override the containerid or not >> depending on what the audit rules are. > > This part I'm still less certain on. I agree that setting the > container ID should be privileged in some sense, but the kernel > shouldn't *require* privilege to create a new container (however the > user chooses to define it). Simply requiring privilege to set the > container ID and failing silently may be sufficient. My hope is as things mature fewer and fewer container things will need any special privilege to create. I think it needs to start with a clear definition of what is wanted and then working backwards through which messages in which contexts you want to have your magic bits. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/