From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754766AbdGNRf7 (ORCPT ); Fri, 14 Jul 2017 13:35:59 -0400 Received: from h2.hallyn.com ([78.46.35.8]:36302 "EHLO h2.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753844AbdGNRf6 (ORCPT ); Fri, 14 Jul 2017 13:35:58 -0400 Date: Fri, 14 Jul 2017 12:35:56 -0500 From: "Serge E. Hallyn" To: Stefan Berger , Mimi Zohar Cc: "Serge E. Hallyn" , "Eric W. Biederman" , "Theodore Ts'o" , containers@lists.linux-foundation.org, lkp@01.org, linux-kernel@vger.kernel.org, tycho@docker.com, James.Bottomley@HansenPartnership.com, vgoyal@redhat.com, christian.brauner@mailbox.org, amir73il@gmail.com, linux-security-module@vger.kernel.org, casey@schaufler-ca.com Subject: Re: [PATCH v2] xattr: Enable security.capability in user namespaces Message-ID: <20170714173556.GA19669@mail.hallyn.com> References: <87y3rscz9j.fsf@xmission.com> <20170713164012.brj2flnkaaks2oci@thunk.org> <87k23cb6os.fsf@xmission.com> <847ccb2a-30c0-a94c-df6f-091c8901eaa0@linux.vnet.ibm.com> <87bmoo8bxb.fsf@xmission.com> <9a3010e5-ca2b-5e7a-656b-fcc14f7bec4e@linux.vnet.ibm.com> <87h8yf7szd.fsf@xmission.com> <65dbe654-0d99-03fa-c838-5a726b462826@linux.vnet.ibm.com> <20170714133437.GA16737@mail.hallyn.com> <596f808b-e21d-8296-5fef-23c1ce7ab778@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <596f808b-e21d-8296-5fef-23c1ce7ab778@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Stefan Berger (stefanb@linux.vnet.ibm.com): > On 07/14/2017 09:34 AM, Serge E. Hallyn wrote: > >Quoting Stefan Berger (stefanb@linux.vnet.ibm.com): > >>On 07/13/2017 08:38 PM, Eric W. Biederman wrote: > >>>Stefan Berger writes: > >>> > >>>>On 07/13/2017 01:49 PM, Eric W. Biederman wrote: > >>>> > >>>>>My big question right now is can you implement Ted's suggested > >>>>>restriction. Only one security.foo or secuirty.foo@... attribute ? > >>>>We need to raw-list the xattrs and do the check before writing them. I am fairly sure this can be done. > >>>> > >>>>So now you want to allow security.foo and one security.foo@uid=<> or just a single one security.foo(@[[:print:]]*)? > >>>> > >>>The latter. > >>That case would prevent a container user from overriding the xattr > >>on the host. Is that what we want? For limiting the number of xattrs > >Not really. If the file is owned by a uid mapped into the container, > >then the container root can chown the file which will clear the file > >capability, after which he can set a new one. If the file is not > >owned by a uid mapped into the container, then container root could > >not set a filecap anyway. > > Let's say I installed a container where all files are signed and > thus have security.ima. Now for some reason I want to re-sign some > or all files inside that container. How would I do that ? Would I > need to get rid of security.ima first, possibly by copying each > file, deleting the original file, and renaming the copied file to > the original name, or should I just be able to write out a new > signature, thus creating security.ima@uid=1000 besides the > security.ima ? > > Stefan Hi Mimi, what do you think makes most sense for IMA? -serge From mboxrd@z Thu Jan 1 00:00:00 1970 From: serge@hallyn.com (Serge E. Hallyn) Date: Fri, 14 Jul 2017 12:35:56 -0500 Subject: [PATCH v2] xattr: Enable security.capability in user namespaces In-Reply-To: <596f808b-e21d-8296-5fef-23c1ce7ab778@linux.vnet.ibm.com> References: <87y3rscz9j.fsf@xmission.com> <20170713164012.brj2flnkaaks2oci@thunk.org> <87k23cb6os.fsf@xmission.com> <847ccb2a-30c0-a94c-df6f-091c8901eaa0@linux.vnet.ibm.com> <87bmoo8bxb.fsf@xmission.com> <9a3010e5-ca2b-5e7a-656b-fcc14f7bec4e@linux.vnet.ibm.com> <87h8yf7szd.fsf@xmission.com> <65dbe654-0d99-03fa-c838-5a726b462826@linux.vnet.ibm.com> <20170714133437.GA16737@mail.hallyn.com> <596f808b-e21d-8296-5fef-23c1ce7ab778@linux.vnet.ibm.com> Message-ID: <20170714173556.GA19669@mail.hallyn.com> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org Quoting Stefan Berger (stefanb at linux.vnet.ibm.com): > On 07/14/2017 09:34 AM, Serge E. Hallyn wrote: > >Quoting Stefan Berger (stefanb at linux.vnet.ibm.com): > >>On 07/13/2017 08:38 PM, Eric W. Biederman wrote: > >>>Stefan Berger writes: > >>> > >>>>On 07/13/2017 01:49 PM, Eric W. Biederman wrote: > >>>> > >>>>>My big question right now is can you implement Ted's suggested > >>>>>restriction. Only one security.foo or secuirty.foo at ... attribute ? > >>>>We need to raw-list the xattrs and do the check before writing them. I am fairly sure this can be done. > >>>> > >>>>So now you want to allow security.foo and one security.foo at uid=<> or just a single one security.foo(@[[:print:]]*)? > >>>> > >>>The latter. > >>That case would prevent a container user from overriding the xattr > >>on the host. Is that what we want? For limiting the number of xattrs > >Not really. If the file is owned by a uid mapped into the container, > >then the container root can chown the file which will clear the file > >capability, after which he can set a new one. If the file is not > >owned by a uid mapped into the container, then container root could > >not set a filecap anyway. > > Let's say I installed a container where all files are signed and > thus have security.ima. Now for some reason I want to re-sign some > or all files inside that container. How would I do that ? Would I > need to get rid of security.ima first, possibly by copying each > file, deleting the original file, and renaming the copied file to > the original name, or should I just be able to write out a new > signature, thus creating security.ima at uid=1000 besides the > security.ima ? > > Stefan Hi Mimi, what do you think makes most sense for IMA? -serge -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html