All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Kyle Moffett <kyle@moffetthome.net>
Cc: Stephen Smalley <stephen.smalley@gmail.com>,
	Eric Paris <eparis@redhat.com>,
	penguin-kernel@i-love.sakura.ne.jp, selinux@tycho.nsa.gov,
	sds@tycho.nsa.gov, jmorris@namei.org,
	linux-security-module@vger.kernel.org, viro@zeniv.linux.org.uk,
	hch@lst.de, Casey Schaufler <casey@schaufler-ca.com>
Subject: Re: [RFC PATCH 1/2] fs/vfs/security: pass last path component to LSM on inode creation
Date: Wed, 08 Dec 2010 06:49:43 -0800	[thread overview]
Message-ID: <4CFF9B07.3070201@schaufler-ca.com> (raw)
In-Reply-To: <AANLkTimHh_6pn4iamx+-v7ToBexoP0a9vxVoTrPfRGKQ@mail.gmail.com>

On 12/8/2010 6:25 AM, Kyle Moffett wrote:
> On Tue, Dec 7, 2010 at 12:34, Stephen Smalley <stephen.smalley@gmail.com> wrote:
>> On Tue, Dec 7, 2010 at 11:56 AM, Casey Schaufler <casey@schaufler-ca.com> wrote:
>>> Let's assume for the moment that no one has a significant objection
>>> to adding the component name to inode_init_security. I am not
>>> suggesting that what gets passed to inode_init_security is
>>> insufficiently general. I am asking if there are other hooks that
>>> also ought to have the component name as one of their parameters.
>>> Yes, I understand the concept of "if it ain't broke ...", and that
>>> may suffice at this point, and if not the fact that no one would be
>>> using the component name in those other hooks definitely would. I
>>> expect that when someone comes along with a new LSM that does access
>>> controls based on the final component* they aren't going to suffer
>>> unnecessary resistance from the SELinux community as they add the
>>> component name as a parameter to other hooks.
>>>
>>> ----
>>> * For example, only files suffixed with ".exe" can be executed and
>>>  only files suffixed with ".so" can be mmapped.
>> I think you can already achieve that via the pathname hooks, but if
>> not and you want it, go for it.
> Actually, there are still a few remaining hooks which might actually
> be useful to add the last path component to even in SELinux.  While
> you of course cannot (and should not) *change* the label of a file in
> a link() or rename() operation, it would potentially be useful to deny
> an operation based on the old label and the new name that is being
> passed in.  It would also make sense if the file create() action was
> able to match on the same requirements as the file "type_transition".
>
> EG: To prevent a compromised web application from messing with
> otherwise writable .htaccess files in its data folders, you ought to
> be able to do something like this (although this does imply
> introducing some sort of matching order, where a "deny_name" with a
> matching name is applied instead of a more-generic "allow"):
>
> deny_name my_web_app_t my_web_app_data_t file:rename ".htaccess";
> allow my_web_app_t my_web_app_data_t file:rename;
>
> deny_name my_web_app_t my_web_app_data_t file:link ".htaccess";
> allow my_web_app_t my_web_app_data_t file:link;
>
> Cheers,
> Kyle Moffett
>

Thank you Kyle. I was hoping someone would follow up on that. I owe you (another?) beer.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2010-12-08 14:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 21:45 [RFC PATCH 1/2] fs/vfs/security: pass last path component to LSM on inode creation Eric Paris
2010-12-03 21:45 ` [RFC PATCH 2/2] SELinux: Use dentry name in new object labeling Eric Paris
2010-12-04  4:20 ` [RFC PATCH 1/2] fs/vfs/security: pass last path component to LSM on inode creation Casey Schaufler
2010-12-04 21:34   ` Eric Paris
2010-12-05  7:38     ` Casey Schaufler
2010-12-06 14:32       ` Daniel J Walsh
2010-12-06 23:32       ` Kyle Moffett
2010-12-07 13:43       ` Stephen Smalley
2010-12-07 14:58         ` Casey Schaufler
2010-12-07 16:11           ` Stephen Smalley
2010-12-07 16:56             ` Casey Schaufler
2010-12-07 17:34               ` Stephen Smalley
2010-12-07 18:00                 ` Casey Schaufler
2010-12-08 14:25                 ` Kyle Moffett
2010-12-08 14:49                   ` Casey Schaufler [this message]
2010-12-08 19:04                   ` Daniel J Walsh

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=4CFF9B07.3070201@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=eparis@redhat.com \
    --cc=hch@lst.de \
    --cc=jmorris@namei.org \
    --cc=kyle@moffetthome.net \
    --cc=linux-security-module@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    --cc=stephen.smalley@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.