mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: linux kernel mailing list <linux-kernel@vger.kernel.org>,
	linux-security-module@vger.kernel.org
Subject: Re: IMA: How to manage user space signing policy with others
Date: Thu, 28 Feb 2013 15:30:01 -0500	[thread overview]
Message-ID: <1362083401.2908.412.camel@falcor1.watson.ibm.com> (raw)
In-Reply-To: <20130228185155.GC11360@redhat.com>

On Thu, 2013-02-28 at 13:51 -0500, Vivek Goyal wrote:
> On Thu, Feb 28, 2013 at 10:13:33AM -0500, Vivek Goyal wrote:
> > Hi Mimi,
> > 
> > I am running into issues w.r.t IMA policy management and user space
> > signing. So thought of dropping a mail and gather some ideas.
> > 
> > Currently IMA seems to able to one policy only which does not contain
> > conflicting rules. We have tcb policies in-built and they don't have
> > conflicting rules. User can put its own policy and that will replace
> > kernel policy (default policy). And then user is responsible for making
> > sure conflicting rules are not present.
> > 
> > Now with user space signing and secureboot, I have another set of rules
> > which are not compatible with existing tcb policies. This is how my
> > rules look like as of today. These can change based on config options.
> > 
> > appraise func=BPRM_CHECK appraise_type=optional
> > appraise func=BPRM_POST_LOAD appraise_type=optional
> > 
> > These rules are not compatible with tcp appraise rule.
> > 
> > .action = APPRAISE,.fowner = GLOBAL_ROOT_UID,.flags = IMA_FOWNER
> > 
> > That means in current scheme of things, multiple policies can't co-exist
> > together. It has few  disadvantages.
> > 
> > - If we want IMA to be central point for all integrity measurement
> >   needs, then having one policy only is very limiting. The fact that
> >   user can overirde that policy makes it worse as then kernel can
> >   not impose any policy at all.
> > 
> >   IOW, if user enables user space signign in kernel, say CONFIG_BIN_SIGN=y,
> >   then I need a way so that kernel can make sure IMA rules needed to
> >   ensure integrity of binaries are present and can not be overruled.
> > 
> > - Disabling policy can disable certain features in kernel. So in this
> >   case if user overides default policy, it will disable binary signing
> >   feature also (that too in a very unintutive way).
> > 
> > 
> > One possible way could be that we allow execution of all the relevant
> > rules in a policy and return the ANDed results of all the rules. But
> > this does not go well with the result caching. Atleast current IMA
> > infrastructure does not allow it and might require overhaul.
> > 
> > In general I am concerned about increased performance overhead if we
> > allow multiple policies to co-exist. 
> > 
> > Performance overhead is a concern even without multiple policies. For
> > user space signing, IMA hooks will be called for file operations like
> > open(), mmap() etc and we don't require those to be called. I am not
> > sure if performance overhead is significant or not. Once things start
> > working, I will do some benchmarking.
> > 
> > But coming back to the point, how to go about making sure user space
> > signing policies can't be overridden if user has enabled user space
> > signing feature in kernel.
> 
> Thinking more about it, even if something could be done where multiple
> rules (kernel and user specified one) could co-exist, I think there will
> be issues. One issue could override other in incompatible way.
> 
> For example, one of the limitations of current IMA infrastructures is
> that it does not cover the case of somebody writing to thd disk directly
> (by bypassing the filesystem). If IMA has cached previous appraisal
> result, next time IMA will simply say file integrity is fine. This
> probably worked so far, but certainly does not work for my case where
> I want to verify file signature everytime and no result caching.
> 
> I thought I could extend IMA rule syntax and mention that results of
> particular rule should not be cached. For example,
> 
> cache_result = no
> 
> So one could say
> 
> appraise bprm_check appraise_type=optional cache_result=no
> 
> But then an user space policy could overide it by specifying
> 
> appraise bprm_check appraise_type=optional 
> 
> Or something simlar. And results will be cached and calling code will
> assume that signatures of binary are fine. But that's not the case.
> 
> So we need few more things from IMA for it to support the case of user
> space signing.
> 
> - Ability to make sure kernel specified rules can not be overridden.

Our posts must have crossed -
http://marc.info/?l=linux-security-module&m=136207944823661&w=2

> - Ability to not cache results so that direct writes to disk could
>   be detected.

I'm not going to argue the futility of this argument.  I'll leave that
to others more qualified.  If you really are concerned, then be my guest
and define a general 'nocaching' option, not rule specific.  Replacing
the policy won't affect the option.

> Till then I can't see how can I use IMA to implement process signing.

Vivek, you continue to imply that IMA doesn't cut it for your use case,
yet ignore my suggestions.

Mimi



  reply	other threads:[~2013-02-28 20:30 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 15:13 Vivek Goyal
2013-02-28 18:51 ` Vivek Goyal
2013-02-28 20:30   ` Mimi Zohar [this message]
2013-02-28 20:57     ` Vivek Goyal
2013-03-01  1:42       ` Mimi Zohar
2013-02-28 19:23 ` Mimi Zohar
2013-02-28 20:08   ` Vivek Goyal
2013-03-01  1:45     ` Mimi Zohar
2013-02-28 21:35   ` Vivek Goyal
2013-02-28 22:20     ` Eric Paris
2013-03-01  1:49       ` Mimi Zohar
2013-03-01 12:15         ` Mimi Zohar
2013-03-01 15:28           ` Vivek Goyal
2013-03-01 18:40             ` Vivek Goyal
2013-03-01 19:39               ` Mimi Zohar
2013-03-01 21:33                 ` Vivek Goyal
2013-03-03 21:42                   ` Mimi Zohar
2013-03-04 15:29                     ` Vivek Goyal
2013-03-04 17:46                       ` Vivek Goyal
2013-03-04 18:59                       ` Mimi Zohar
2013-03-04 19:15                         ` Vivek Goyal
2013-03-05  1:21                           ` Mimi Zohar
2013-03-05 15:18                             ` Vivek Goyal
2013-03-05 20:40                               ` Mimi Zohar
2013-03-05 21:53                                 ` Vivek Goyal
2013-03-06 15:42                                   ` Mimi Zohar
2013-03-06 23:55                                     ` Vivek Goyal
2013-03-07  1:39                                       ` Mimi Zohar
2013-03-07 14:36                                         ` Vivek Goyal
2013-03-07 15:40                                           ` Mimi Zohar
2013-03-07 15:53                                             ` Vivek Goyal
2013-03-07 17:53                                               ` Kasatkin, Dmitry
2013-03-07 21:56                                                 ` Vivek Goyal
2013-03-08  8:09                                                   ` Kasatkin, Dmitry
2013-03-08 15:40                                                     ` Vivek Goyal
2013-03-06 15:54                                 ` Vivek Goyal
2013-03-06 22:48                                   ` Mimi Zohar
2013-03-06 23:38                                     ` Vivek Goyal
2013-03-07 13:38                                       ` Mimi Zohar
2013-03-07 14:57                                         ` Vivek Goyal
2013-03-04 19:19                         ` Eric Paris
2013-03-04 21:47                     ` Vivek Goyal
2013-03-01  2:17     ` Mimi Zohar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362083401.2908.412.camel@falcor1.watson.ibm.com \
    --to=zohar@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome