Skip to contentSkip to conversation

Object Security Classes

DISCUSSION Michael Nyika 2 participants 4 messages Jun 27, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

Good day: I have a question and it is about Object Security Classes. How does one know before hand what identifiers they can take? For example, i have come across "file", "capability", "process". In what file have they been predefined (if at all)?

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
You have received this message because you are subscribed to the selinux 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 5 lines · Michael Nyika

Good day: I have a question and it is about Object Security Classes. How does one know before hand what identifiers they can take? For example, i have come across "file", "capability", "process". In what file have they been predefined (if at all)?

As explained in the Configuring the SELinux Policy report, the security classes are defined in a configuration file that is shared between the SELinux kernel module and the example policy configuration. The file is named security_classes and is located under lsm-2.4/security/selinux/flask in the source tree. The upstream distribution installs it into /usr/local/selinux/flask, while the Debian selinux package install it into /usr/lib/selinux (I think). There are a set of macros defined for common sets of classes in the selinux/policy/macros/global_macros.te file, as also discussed in the report.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
You have received this message because you are subscribed to the selinux 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

Re: Type Attribute Declarations

Related to this, i am also trying to resolve the
identifiers given to types.

Your document "Security Policy Configuration for the Security-Enhanced Linux" outlines some on page 5, such as "privuser", "privrole" and others. (I understand "domain" as an important attribute in defining a domain ). Where are "privuser" and the rest in the document defined?

Also, looking at policy/types/network.te , i come across "socket_type", "port_type" and others. They must have been defined somewhere, right? OR is that just a way of GROUPING types with one's own identifers (and leaving it at that) so that that particular SET of type-attributes must exist/not-exist for certain permissions to be granted?...........????

Quoted 30 lines · --- Stephen Smalley
Quoted 2 lines · Michael Nyika

Good day: I have a question and it is about Object Security Classes. How does one know before hand

what

Quoted 1 line

identifiers they can take? For example, i have

come

Quoted 1 line

across "file", "capability", "process". In what

file

Quoted 1 line

have they been predefined (if at all)?

As explained in the Configuring the SELinux Policy report, the security
classes are defined in a configuration file that is shared between the
SELinux kernel module and the example policy configuration. The file is
named security_classes and is located under lsm-2.4/security/selinux/flask
in the source tree. The upstream distribution installs it into
/usr/local/selinux/flask, while the Debian selinux package install it into
/usr/lib/selinux (I think). There are a set of macros defined for common
sets of classes in the selinux/policy/macros/global_macros.te file, as also discussed in the report.

Quoted 6 lines

--
Stephen D. Smalley, NAI Labs
[email protected]

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
You have received this message because you are subscribed to the selinux 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

Re: Type Attribute Declarations

Quoted 10 lines · Michael Nyika

Related to this, i am also trying to resolve the identifiers given to types.

Your document "Security Policy Configuration for the Security-Enhanced Linux" outlines some on page 5, such as "privuser", "privrole" and others. (I understand "domain" as an important attribute in defining a domain ). Where are "privuser" and the rest in the document defined?

Quoted 7 lines

Also, looking at policy/types/network.te , i come across "socket_type", "port_type" and others. They must have been defined somewhere, right? OR is that just a way of GROUPING types with one's own identifers (and leaving it at that) so that that particular SET of type-attributes must exist/not-exist for certain permissions to be granted?...........????

These identifiers are "type attributes", which are explained in both the newer Configuring the SELinux Polcy report and in the older report you mention. The meaning of a type attribute is entirely defined by how it is used within the rules in the configuration - a type attribute is merely a way of easily representing a type set with a single name.

In the current release of SELinux, type attributes are implicitly declared when they are used in a type declaration. However, in response to recent discussions on this list, we have now added (and made mandatory) explicit declarations for the type attributes along with comment lines explaining their intended purpose within the configuration. This will be in the next public release. I've attached the new attrib.te file so you can see these declarations and their comments.

--
Stephen D. Smalley, NAI Labs
[email protected]

#
# Declarations for type attributes.
#

# A type attribute can be used to identify a set of types with a similar

# property.  Each type can have any number of attributes, and each
# attribute can be associated with any number of types.  Attributes are
# explicitly declared here, and can then be associated with particular
# types in type declarations.  Attribute names can then be used throughout 
# the configuration to express the set of types that are associated with 
# the attribute.  Except for the MLS attributes, attributes have no implicit
# meaning to SELinux.  The meaning of all other attributes are completely 
# defined through their usage within the configuration, but should be 
# documented here as comments preceding the attribute declaration.  

#####################
# Attributes for MLS:
#

# The mlstrustedreader attribute identifies every domain that can

# override the normal MLS restrictions on reading (i.e. domains
# that can read up).  
attribute mlstrustedreader;

# The mlstrustedwriter attribute identifies every domain that can

# override the normal MLS restrictions on writing (i.e. domains
# that can write down).  
attribute mlstrustedwriter;

# The mlstrustedobject attribute identifies every type that can

# be accessed without normal MLS restrictions (i.e. processes can
# read or write objects with this type regardless of MLS level).  
# Examples:  /dev/null, descriptors created by login
attribute mlstrustedobject;

#########################
# Attributes for domains:
#

# The domain attribute identifies every type that can be

# assigned to a process.  This attribute is used in TE rules 
# that should be applied to all domains, e.g. permitting 
# init to kill all processes or permitting all processes
# to read a particular file.
attribute domain;

# The privuser attribute identifies every domain that can

# change its SELinux user identity.  This attribute is used 
# in the constraints configuration.  NOTE:  This attribute
# is not required for domains that merely change the Linux
# uid attributes, only for domains that must change the
# SELinux user identity.
attribute privuser;

# The privrole attribute identifies every domain that can

# change its SELinux role.  This attribute is used in the 
# constraints configuration.
attribute privrole;

# The privowner attribute identifies every domain that can

# assign a different SELinux user identity to a file.  This 
# attribute is used in the constraints configuration.
attribute privowner;

# The privlog attribute identifies every domain that can

# communicate with syslogd through its Unix domain socket.
# This attribute is used in the TE rules in 
# domains/program/syslogd.te to grant such access.  
# XXX If you want to mandate the use of this attribute for all 
# XXX domains that can log, then you should also write corresponding 
# XXX assertions in assert.te to enforce this restriction.  Otherwise,
# XXX it is just an optional convenience for domain writers.
attribute privlog;

# The privmem attribute identifies every domain that can

# access kernel memory devices.
# This attribute is used in the TE assertions to verify
# that such access is limited to domains that are explicitly
# tagged with this attribute.
attribute privmem;

# The auth attribute identifies every domain that needs

# to perform user authentication and requires access to
# the corresponding authentication data.  
# XXX This attribute is no longer in use except in type declarations.
# XXX It was introduced for the original attempt to put /etc/shadow into
# XXX a separate type and to limit read access to certain domains.  
# XXX Doing so transparently to applications is problematic due to
# XXX the fact that both /etc/passwd and /etc/shadow are recreated
# XXX by the same processes and live in the same directory, so file type
# XXX transition rules cannot specify different default types.  Relocating
# XXX /etc/shadow to a separate subdirectory was tried, but required
# XXX modifications to a lot of applications even after changing
# XXX the pwdb shared library.
attribute auth;

# The admin attribute identifies every administrator domain. # It is used in TE assertions when verifying that only administrator

# domains have certain permissions.  
# This attribute is presently associated with sysadm_t and 
# certain administrator utility domains.  
# XXX The use of this attribute should be reviewed for consistency.
# XXX Might want to partition into several finer-grained attributes 
# XXX used in different assertions within assert.te.
attribute admin;

# The userdomain attribute identifies every user domain, presently

# user_t and sysadm_t.  It is used in TE rules that should be applied
# to all user domains.
attribute userdomain;

# The gphdomain attribute identifies every gnome-pty-helper derived

# domain.  It is used in TE rules to permit inheritance and use of
# descriptors created by these domains.
attribute gphdomain;

############################
# Attributes for file types:
#

# The file_type attribute identifies all types assigned to files

# in persistent filesystems.  It is used in TE rules to permit
# the association of all such file types with persistent filesystem
# types, and to permit certain domains to access all such types as 
# appropriate.
attribute file_type;

# The sysadmfile attribute identifies all types assigned to files

# that should be completely accessible to administrators.  It is used
# in TE rules to grant such access for administrator domains.
attribute sysadmfile;

# The fs_type attribute identifies all types assigned to filesystems # (not limited to persistent filesystems).
# It is used in TE rules to permit certain domains to mount

# any filesystem and to permit most domains to obtain the
# overall filesystem statistics.
attribute fs_type;

# The root_dir_type attribute identifies all types assigned to

# root directories of filesystems (not limited to persistent
# filesystems).
# XXX This attribute was used to grant mountassociate permission,
# XXX but this permission is no longer defined.  We can likely
# XXX remove this attribute.
attribute root_dir_type;

# The exec_type attribute identifies all types assigned

# to entrypoint executables for domains.  This attribute is 
# used in TE rules and assertions that should be applied to all 
# such executables.
attribute exec_type;

# The tmpfile attribute identifies all types assigned to temporary

# files.  This attribute is used in TE rules to grant certain 
# domains the ability to remove all such files (e.g. init, crond).
attribute tmpfile;

# The tmpfsfile attribute identifies all types defined for tmpfs

# type transitions. 
# It is used in TE rules to grant certain domains the ability to
# access all such files.
attribute tmpfsfile;

# The home_type attribute identifies all types assigned to home

# directories.  This attribute is used in TE rules to grant certain
# domains the ability to access all home directory types.
attribute home_type;

# The ttyfile attribute identifies all types assigned to ttys. # It is used in TE rules to grant certain domains the ability to

# access all ttys.
attribute ttyfile;

# The ptyfile attribute identifies all types assigned to ptys. # It is used in TE rules to grant certain domains the ability to

# access all ptys.
attribute ptyfile;

# The pidfile attribute identifies all types assigned to pid files. # It is used in TE rules to grant certain domains the ability to

# access all such files.
attribute pidfile;

############################
# Attributes for network types:
#

# The socket_type attribute identifies all types assigned to

# kernel-created sockets.  Ordinary sockets are assigned the 
# domain of the creating process.
# XXX This attribute is unused.  Remove?
attribute socket_type;

# Identifies all types assigned to port numbers to control binding. attribute port_type;

# Identifies all types assigned to network interfaces to control

# operations on the interface (XXX obsolete, not supported via LSM) 
# and to control traffic sent or received on the interface.
attribute netif_type;

# Identifies all default types assigned to packets received

# on network interfaces.  
attribute netmsg_type;

# Identifies all types assigned to network nodes/hosts to control

# traffic sent to or received from the node.
attribute node_type;