* Restrict File creation types
@ 2004-06-10 17:26 Kenny
2004-06-10 19:08 ` Stephen Smalley
0 siblings, 1 reply; 2+ messages in thread
From: Kenny @ 2004-06-10 17:26 UTC (permalink / raw)
To: selinux
How would I go about restricting all files created in a certain
directory to a set of types. Eg:
I have Dir Types:
Dir_Type1_t
Dir_Type2_t
and file Types:
File_type_1a_t
File_type_1b_t
File_type_2a_t
File_type_2b_t
I want all files in Dir_Type1_t to be of types File_type_1a_t or
File_type_1b_t no matter the domain of the creating process
and all files in Dir_Type2_t to be of types File_type_2a_t or
File_type_2b_t.
(mkdir -Z user:object_r:File_type_2a_t TEST in a dir of type
Dir_Type2_t should fail as any user/role/domain)
I've tried looking through the logs with auditallow on for all the Dir
and File types, but didn't see anything where both types where listed
in the same allow statement. Is this even possible?
Kenny
--
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Restrict File creation types
2004-06-10 17:26 Restrict File creation types Kenny
@ 2004-06-10 19:08 ` Stephen Smalley
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Smalley @ 2004-06-10 19:08 UTC (permalink / raw)
To: Kenny; +Cc: selinux
On Thu, 2004-06-10 at 13:26, Kenny wrote:
> How would I go about restricting all files created in a certain
> directory to a set of types. Eg:
> I have Dir Types:
> Dir_Type1_t
> Dir_Type2_t
> and file Types:
> File_type_1a_t
> File_type_1b_t
> File_type_2a_t
> File_type_2b_t
>
> I want all files in Dir_Type1_t to be of types File_type_1a_t or
> File_type_1b_t no matter the domain of the creating process
> and all files in Dir_Type2_t to be of types File_type_2a_t or
> File_type_2b_t.
> (mkdir -Z user:object_r:File_type_2a_t TEST in a dir of type
> Dir_Type2_t should fail as any user/role/domain)
>
> I've tried looking through the logs with auditallow on for all the Dir
> and File types, but didn't see anything where both types where listed
> in the same allow statement. Is this even possible?
There isn't a particular permission that enforces an association between
the parent directory type and the new file type. You can do things
like:
- Prevent a domain from specifying a particular context at all for a new
file, forcing new files to inherit from the parent directory or to
follow any type_transition rule specified in the policy.
- Control which domains can write to a given directory, and then ensure
that those domains can only create files with particular types.
It wouldn't be difficult to add a new permission check between the
parent directory type and the new file type on file creation, but you
would also need to ensure that the property is preserved for hard links,
and possibly for bind mounts.
There is a permission check performed between the new file type and the
filesystem type.
--
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency
--
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-06-10 19:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-10 17:26 Restrict File creation types Kenny
2004-06-10 19:08 ` Stephen Smalley
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.