
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://www.selinuxproject.org/w/skins/common/feed.css?63"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.selinuxproject.org/w/?title=RoleRules&amp;action=history&amp;feed=atom</id>
		<title>RoleRules - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.selinuxproject.org/w/?title=RoleRules&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://www.selinuxproject.org/w/?title=RoleRules&amp;action=history"/>
		<updated>2013-05-22T08:13:41Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.10.4</generator>

	<entry>
		<id>http://www.selinuxproject.org/w/?title=RoleRules&amp;diff=840&amp;oldid=prev</id>
		<title>RichardHaines: New page: = Role Rules = == Role allow Rule == The role allow rule checks whether a request to change roles is allowed, if it is, then there may be a further request for a role_transition so that th...</title>
		<link rel="alternate" type="text/html" href="http://www.selinuxproject.org/w/?title=RoleRules&amp;diff=840&amp;oldid=prev"/>
				<updated>2009-11-29T15:43:58Z</updated>
		
		<summary type="html">&lt;p&gt;New page: = Role Rules = == Role allow Rule == The role allow rule checks whether a request to change roles is allowed, if it is, then there may be a further request for a role_transition so that th...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Role Rules =&lt;br /&gt;
== Role allow Rule ==&lt;br /&gt;
The role allow rule checks whether a request to change roles is allowed, if it is, then there may be a further request for a role_transition so that the process runs with the new role or role set. &lt;br /&gt;
&lt;br /&gt;
Important Notes: &lt;br /&gt;
&lt;br /&gt;
# The role allow rule has the same keyword as the allow AV rule.&lt;br /&gt;
# The role allow rule is used in the Reference Policy sources, however there are no corresponding role_transition rules. This is because the policy expects users to either keep the same role as when they logged onto the system, or use the newrole(1) command to change roles.&lt;br /&gt;
# The Reference Policy uses the constrain Statement to manage role relationships.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement definition is:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
allow from_role_id to_role_id; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|allow&lt;br /&gt;
|The role allow rule keyword.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|from_role_id&lt;br /&gt;
|One or more role identifiers that identify the current role. Multiple entries consist of a space separated list enclosed in braces ({}).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|to_role_id&lt;br /&gt;
|One or more role identifiers that identify the new role to be granted on the transition. Multiple entries consist of a space separated list enclosed in braces ({}).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement is valid in:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Monolithic Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Base Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Module Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Conditional Policy (if) Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''optional Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''require Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Using the &amp;lt;/nowiki&amp;gt;role allow rule to define authorised role&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# transitions in the Reference Policy. The current role &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# &amp;lt;/nowiki&amp;gt;sysadm_r is granted permission to transition to the secadm_r&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# role in the MLS policy.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
allow sysadm_r secadm_r;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== role_transition Rule ==&lt;br /&gt;
The role_transition rule specifies that a role transition is required, and if allowed, the process will run under the new role. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement definition is:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
role_transition current_role_id type_id new_role_id; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|role_transition&lt;br /&gt;
|The role_transition keyword.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|current_role_id&lt;br /&gt;
|One or more role identifiers that identify the current role. Multiple entries consist of a space separated list enclosed in braces ({}).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|type_id&lt;br /&gt;
|One or more type or attribute identifiers. Multiple entries consist of a space separated list enclosed in braces ({}). Entries can be excluded from the list by using the negative operator (-). Only 'domain' types make sense within the policy.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|new_role_id&lt;br /&gt;
|The new role to be granted on transition.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement is valid in:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Monolithic Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Base Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Module Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Conditional Policy (if) Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''optional Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''require Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# This is a role_transition used in the ext_gateway.conf&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# loadable module to allow the secure client / server process to&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# run under the &amp;lt;/nowiki&amp;gt;message_filter_r role. The role needs to be&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# declared, allowed to transition from its current role of &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# &amp;lt;/nowiki&amp;gt;unconfined_r and it then transitions when the process &lt;br /&gt;
&amp;lt;nowiki&amp;gt;# transitions via the type_transition statement (not shown).&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Note that the role needs to be associated to a user by either:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# 1) An embedded user statement in the policy. This is not&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# &amp;lt;/nowiki&amp;gt;recommended as it makes the policy fixed to either &lt;br /&gt;
&amp;lt;nowiki&amp;gt;# &amp;lt;/nowiki&amp;gt;standard, MCS or MLS.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# 2) Using the semanage(8) command to add the role. This will &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# &amp;lt;/nowiki&amp;gt;allow the module to be used by MCS/MLS policies as well.&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# The secure client / server will run in this domain:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
type ext_gateway_t;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# The binaries will be labeled:&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
type secure_services_exec_t;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Use message_filter_r role and then transition&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
role message_filter_r types ext_gatway_t;&lt;br /&gt;
allow unconfined_r message_filter_r;&lt;br /&gt;
role_transition unconfined_r secure_services_exec_t message_filter_r;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Role dominance Rule ===&lt;br /&gt;
This rule has been deprecated and therefore should not be used. The role dominance rule allows the dom_role_id to dominate the role_id (consisting of one or more roles). The dominant role will automatically inherit all the type associations of the other roles. &lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
# There is another dominance rule for MLS (see the MLS dominance Statement).&lt;br /&gt;
# The role dominance rule is not used by the Reference Policy as the policy manages role dominance using the constrain Statement.&lt;br /&gt;
# Note the usage of braces '{}' and the '&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;' in the statement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement definition is:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dominance { role dom_role_id { role role_id; } }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Where:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|dominance&lt;br /&gt;
|The dominance keyword.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|role&lt;br /&gt;
|The role keyword.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|dom_role_id&lt;br /&gt;
|The dominant role identifier.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|role_id&lt;br /&gt;
|For the simple case each { role role_id; } pair defines the role_id that will be dominated by the dom_role_id. More complex rules can be defined but as the statement is depreciated !!!. &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The statement is valid in:'''&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Monolithic Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Base Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Module Policy'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;'''Conditional Policy (if) Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''optional Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;'''require Statement'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Yes&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;No&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# This shows the dominance role rule note however that it&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# has been depreciated and should not be used.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dominance { role message_filter_r { role unconfined_r };}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>RichardHaines</name></author>	</entry>

	</feed>