Skip to contentSkip to conversation

SELinux metadata protection

DISCUSSION schaufler-ca.com - Casey Schaufler 5 participants 6 messages Jan 2, 2006 – Jan 6, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

------------------------
Casey Schaufler
[email protected]
650.906.1780

Quoted 9 lines · --- KaiGai Kohei

Date: Sun, 01 Jan 2006 03:11:47 +0900
From: KaiGai Kohei <[email protected]>
To: [email protected], "SELinux(NSA)" <[email protected]>
Subject: SELinux metadata protection

Hello

Quoted 6 lines

Nowaday, I�m considering about a philosophical
theme.

In my understanding, file-metadata includes
_filename_ similar to filesize
update-timestamp, and so on.

Casey takes a deep breath...

The filename is not an attribute of the file. The pathname components are data contained in directory entries. The association of path name to inode number is one way. There is no association of path name from file. Really. This is the thing that make audit hard.

Yes, I know "It's obvious". It's just not true.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 10 lines · schaufler-ca.com - Casey Schaufler

Casey takes a deep breath...

The filename is not an attribute of the file. The pathname components are data contained in directory entries. The association of path name to inode number is one way. There is no association of path name from file. Really. This is the thing that make audit hard.

Yes, I know "It's obvious". It's just not true.

The world is ending because I agree with Casey on this one... The filename is not an attribute of the file, and we do not want this type of filtering on directory reads. Use the permissions on the directory itself to control who can see the names it contains. It is the data container for the filenames.

Use polyinstantiation aka Multi-Level Directories aka moldy directories for shared directories like /tmp.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw

Thanks for your comments.

OK, I understood positioning of filename in SELinux. I wanted to confirm whether it was metadata or not at first because it seems to me a bit unclarity.

Drop previous two patches.

Quoted 20 lines
Quoted 10 lines

Casey takes a deep breath...

The filename is not an attribute of the file. The pathname components are data contained in directory entries. The association of path name to inode number is one way. There is no association of path name from file. Really. This is the thing that make audit hard.

Yes, I know "It's obvious". It's just not true.

The world is ending because I agree with Casey on this one... The filename is not an attribute of the file, and we do not want this type of filtering on directory reads. Use the permissions on the directory itself to control who can see the names it contains. It is the data container for the filenames.

Use polyinstantiation aka Multi-Level Directories aka moldy directories for shared directories like /tmp.

Signature · 6 lines
KaiGai Kohei <[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw
In reply to Stephen Smalley
Quoted 13 lines · Stephen Smalley
Quoted 10 lines · schaufler-ca.com - Casey Schaufler

Casey takes a deep breath...

The filename is not an attribute of the file. The pathname components are data contained in directory entries. The association of path name to inode number is one way. There is no association of path name from file. Really. This is the thing that make audit hard.

Yes, I know "It's obvious". It's just not true.

Quoted 8 lines

The world is ending because I agree with Casey on this one... The filename is not an attribute of the file, and we do not want this type of filtering on directory reads. Use the permissions on the directory itself to control who can see the names it contains. It is the data container for the filenames.

Use polyinstantiation aka Multi-Level Directories aka moldy directories for shared directories like /tmp.

Looking at the second "application note" for 5.3.4.1 of PP_MLOSPP_MR (from http://niap.nist.gov/cc-scheme/pp/PP_MLOSPP-MR_V1.22.html), it says:

"The MAC policy covers all subjects and all objects. The list of objects must include object attributes that are themselves objects (such as filenames) because they can be manipulated by a user."

So it sounds like to meet this profile, we'd have to either have separate controls on the filename, or extend a file's read/write access rights to any dentry pointing to the inode.

Of course I'd resigned myself long ago to not being able to meet this application note :) Particularly due to the aforementioned hard-to- handle information leak on touch(/var/somefilename). So I'm not arguing with the decision to abort this patch.

-serge

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#4 lore raw
Quoted 11 lines · Serge E. Hallyn

Looking at the second "application note" for 5.3.4.1 of PP_MLOSPP_MR (from http://niap.nist.gov/cc-scheme/pp/PP_MLOSPP-MR_V1.22.html), it says:

"The MAC policy covers all subjects and all objects. The list of objects must include object attributes that are themselves objects (such as filenames) because they can be manipulated by a user."

So it sounds like to meet this profile, we'd have to either have separate controls on the filename, or extend a file's read/write access rights to any dentry pointing to the inode.

I don't think so. You would just argue that filenames are not separable objects in Unix/Linux, that they are part of the content of directory objects in Unix/Linux, and that MAC policy does control the ability to read directories based on their label. Further, MAC policy does already control the ability to modify directories not only based on checks on the directory label but also based on per-file checks (e.g. SELinux checks rename, unlink, and link permissions on the inode in addition to add_name/remove_name on the directory). The unlink/link checks are justified since they alter inode state (link count). The rename check is more of an integrity-oriented control.

Quoted 4 lines

Of course I'd resigned myself long ago to not being able to meet this application note :) Particularly due to the aforementioned hard-to- handle information leak on touch(/var/somefilename). So I'm not arguing with the decision to abort this patch.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#5 lore raw
Quoted 8 lines · Stephen Smalley
Quoted 7 lines · Serge E. Hallyn

Looking at the second "application note" for 5.3.4.1 of PP_MLOSPP_MR (from http://niap.nist.gov/cc-scheme/pp/PP_MLOSPP-MR_V1.22.html), it says:

"The MAC policy covers all subjects and all objects. The list of objects must include object attributes that are themselves objects (such as filenames) because they can be manipulated by a user."

In the paper world, classified documents routinely have unclassified (or less classified) titles and metadata. In the trusted OS I use regularly (HP CMW), a classified file can only be written to a lower level directory by way of elevated privilege because the process is 'writing down' to the directory and declaring the metadata to be classified at the directory level. (C)overt channels are dealt with during the evaluation of the use of privilege by the application.

joe

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.