From: Dominick Grift <dac.override@gmail.com>
To: selinux@tycho.nsa.gov
Subject: Re: Question on unconfined_t
Date: Mon, 17 Nov 2014 22:54:57 +0100 [thread overview]
Message-ID: <20141117215456.GA7768@e145.network2> (raw)
In-Reply-To: <CAOK12DarQLB3QcmRLd4xTWTDS0kBD+zAXfh_0oHK3_gYxnniiQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]
On Mon, Nov 17, 2014 at 09:18:51PM +0000, Paddie O'Brien wrote:
> Thanks. I was under the mistaken impression that unconfined_t got
> something for free. My new understanding is that it's by convention
> that policy writers give access to unconfined_t to their domains and
> they do so by adding explicit rules.
>
> Also I was missing file_type(mytype_exec_t) although I had
> domain_type(mytpe_t). Is there a way to see what things like file_type
> and domain_type expand to? I want to know what's going on in the
> background.
>
Yes, Generally what file_type() and domain_type() do is associate a "type attribute" with the calling type
type attributes are a way to group common rules. You could look at them as tags in a way
consider this example
attribute cars
type pinto, cars;
type chevy, cars;
attribute bicycle
type specialized, bicycle;
type cannondale, bicycle;
Now we have 4 types grouped into two categories using type attributes: cars and bicycles
now the type attributes can be used to write rules that apply to all the types associated with a particular type attribute.
allow cars i85:interstate 100mph;
stupid example that allows "all cars (pinto and chevy)" to drive 100mph on the i95 interstate
This concept of grouping types by associating type attributes with them is what is used a lot
file_type(myfile_t) associates the files_type attribute with the myfile_t type, effectively categorizing myfile_t as a type for a file
similarely domain_type(myprocess_t) categorizes myprocess_t as a type for processes
so if you want to give some type access to all "files" rather than individual types:
allow myprocess_t files_type:file read;
or if you want to allow all types associated with processes to write all types associated with files:
allow domain_type files_type:file write;
There are alot of type attributes and types (and other identifiers like roles) are grouped in many ways
To see which rules apply you can use the seinfo and sesearch command creatively.
Example:
to list all attributes: seinfo -a
to example all attributes: seinfo -xa
see which attributes are associated with the unconfined_t type: seinfo -xtunconfined_t
to see all rules associated with a particular attribute: sesearch -A -t files_type
it takes a while to get creative with those two commands and with those concepts.
Just remember selinux is like accounting in some ways, its all about grouping and associating.
--
Dominick Grift
[-- Attachment #2: Type: application/pgp-signature, Size: 648 bytes --]
next prev parent reply other threads:[~2014-11-17 21:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 14:44 Question on unconfined_t Paddie O'Brien
2014-11-17 15:37 ` Stephen Smalley
2014-11-17 20:37 ` Daniel J Walsh
2014-11-17 21:18 ` Paddie O'Brien
2014-11-17 21:54 ` Dominick Grift [this message]
2014-11-17 22:42 ` Dominick Grift
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=20141117215456.GA7768@e145.network2 \
--to=dac.override@gmail.com \
--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.