All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Anderson <mra@hp.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov
Subject: Re: matchpathcon() for arbitrary subjects
Date: Tue, 12 Dec 2006 17:45:17 -0500	[thread overview]
Message-ID: <457F30FD.8060200@hp.com> (raw)
In-Reply-To: <1165959675.998.135.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Tue, 2006-12-12 at 16:29 -0500, Matt Anderson wrote:
>> Thats true, once there was output it would block other users from using
>> that queue until it was removed.  This is intentional.
> 
> Ok.  Polyinstantiating the destination file would be nicer from a
> functional point of view.
> 
>> The idea is to bring some sort of useful SELinux support to file
>> printers.  In the case of file printers I've taken this to mean that the
>> user who printed the job would be able to access the output directly.
>>
>> Cups has no mechanism to access the file after its been printed.
>>
>> In talking to Dan Walsh about the policy aspect of it we had talked
>> about polyinstantiating the output type, effectively user_lpr_t would
>> generate user_print_output_t.  While that would block secadm_lpr_t from
>> printing it would also stop secadm from reading someone else's output.
> 
> In that case, security_compute_create() is what you want.  Passing in
> the client's context as the first context, the context of the parent
> directory in which the destination file will be created as the second
> context, and SECCLASS_FILE for the security class, and returning the
> context to put on the file.  That context would have the client's level,
> and it would have either the parent directory's type (if no type
> transition rule matches) or the type specified by a type transition rule
> on the client's type and the parent directory type.

Yes, thats exactly what I'd like to do.

> I assume you would limit the client to only read and write access to the
> file, and not give it other permissions (e.g. create, unlink, rename,
> etc), leaving such manipulations entirely to cupsd.

>From the perspective of $1_lpr_t I was intending to only allow write
permission, in order to validate that the user was able to print.  For
user_t it seemed to me that { read getattr relabelfrom link unlink
rename } was the correct set of permissions.  That way a user could copy
the output to another location.

I'm not sure how you would tell cupsd to remove the file.  Some sort of
admin role such as sysadm might also need the ability to unlink all of
these types in order to manage the queue.

-matt

--
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:[~2006-12-12 22:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 19:21 matchpathcon() for arbitrary subjects Matt Anderson
2006-12-12 19:40 ` Stephen Smalley
2006-12-12 20:24   ` Stephen Smalley
2006-12-12 20:46   ` Matt Anderson
2006-12-12 20:50     ` Stephen Smalley
2006-12-12 20:53       ` Stephen Smalley
2006-12-12 21:29         ` Matt Anderson
2006-12-12 21:41           ` Stephen Smalley
2006-12-12 22:45             ` Matt Anderson [this message]
2006-12-13 13:32               ` Stephen Smalley

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=457F30FD.8060200@hp.com \
    --to=mra@hp.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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.