16cd6a6acSopenharmony_ciMulti-Level Security Labeling Statements
26cd6a6acSopenharmony_ci========================================
36cd6a6acSopenharmony_ci
46cd6a6acSopenharmony_ciBecause there are many options for MLS labeling, the examples show a limited selection of statements, however there is a simple policy that will build shown in the [`levelrange`](cil_mls_labeling_statements.md#levelrange) section.
56cd6a6acSopenharmony_ci
66cd6a6acSopenharmony_cisensitivity
76cd6a6acSopenharmony_ci-----------
86cd6a6acSopenharmony_ci
96cd6a6acSopenharmony_ciDeclare a sensitivity identifier in the current namespace. Multiple [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) statements in the policy will form an ordered list.
106cd6a6acSopenharmony_ci
116cd6a6acSopenharmony_ci**Statement definition:**
126cd6a6acSopenharmony_ci
136cd6a6acSopenharmony_ci```secil
146cd6a6acSopenharmony_ci    (sensitivity sensitivity_id)
156cd6a6acSopenharmony_ci```
166cd6a6acSopenharmony_ci
176cd6a6acSopenharmony_ci**Where:**
186cd6a6acSopenharmony_ci
196cd6a6acSopenharmony_ci<table>
206cd6a6acSopenharmony_ci<colgroup>
216cd6a6acSopenharmony_ci<col width="25%" />
226cd6a6acSopenharmony_ci<col width="75%" />
236cd6a6acSopenharmony_ci</colgroup>
246cd6a6acSopenharmony_ci<tbody>
256cd6a6acSopenharmony_ci<tr class="odd">
266cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity</code></p></td>
276cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivity</code> keyword.</p></td>
286cd6a6acSopenharmony_ci</tr>
296cd6a6acSopenharmony_ci<tr class="even">
306cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity_id</code></p></td>
316cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivity</code> identifier.</p></td>
326cd6a6acSopenharmony_ci</tr>
336cd6a6acSopenharmony_ci</tbody>
346cd6a6acSopenharmony_ci</table>
356cd6a6acSopenharmony_ci
366cd6a6acSopenharmony_ci**Example:**
376cd6a6acSopenharmony_ci
386cd6a6acSopenharmony_ciThis example declares three [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) identifiers:
396cd6a6acSopenharmony_ci
406cd6a6acSopenharmony_ci```secil
416cd6a6acSopenharmony_ci    (sensitivity s0)
426cd6a6acSopenharmony_ci    (sensitivity s1)
436cd6a6acSopenharmony_ci    (sensitivity s2)
446cd6a6acSopenharmony_ci```
456cd6a6acSopenharmony_ci
466cd6a6acSopenharmony_cisensitivityalias
476cd6a6acSopenharmony_ci----------------
486cd6a6acSopenharmony_ci
496cd6a6acSopenharmony_ciDeclares a sensitivity alias identifier in the current namespace. See the [`sensitivityaliasactual`](cil_mls_labeling_statements.md#sensitivityaliasactual) statement for an example that associates the [`sensitivityalias`](cil_mls_labeling_statements.md#sensitivityalias) identifier.
506cd6a6acSopenharmony_ci
516cd6a6acSopenharmony_ci**Statement definition:**
526cd6a6acSopenharmony_ci
536cd6a6acSopenharmony_ci```secil
546cd6a6acSopenharmony_ci    (sensitivityalias sensitivityalias_id)
556cd6a6acSopenharmony_ci```
566cd6a6acSopenharmony_ci
576cd6a6acSopenharmony_ci**Where:**
586cd6a6acSopenharmony_ci
596cd6a6acSopenharmony_ci<table>
606cd6a6acSopenharmony_ci<colgroup>
616cd6a6acSopenharmony_ci<col width="25%" />
626cd6a6acSopenharmony_ci<col width="75%" />
636cd6a6acSopenharmony_ci</colgroup>
646cd6a6acSopenharmony_ci<tbody>
656cd6a6acSopenharmony_ci<tr class="odd">
666cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivityalias</code></p></td>
676cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivityalias</code> keyword.</p></td>
686cd6a6acSopenharmony_ci</tr>
696cd6a6acSopenharmony_ci<tr class="even">
706cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivityalias_id</code></p></td>
716cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivityalias</code> identifier.</p></td>
726cd6a6acSopenharmony_ci</tr>
736cd6a6acSopenharmony_ci</tbody>
746cd6a6acSopenharmony_ci</table>
756cd6a6acSopenharmony_ci
766cd6a6acSopenharmony_ci**Example:**
776cd6a6acSopenharmony_ci
786cd6a6acSopenharmony_ciSee the [`sensitivityaliasactual`](cil_mls_labeling_statements.md#sensitivityaliasactual) statement.
796cd6a6acSopenharmony_ci
806cd6a6acSopenharmony_cisensitivityaliasactual
816cd6a6acSopenharmony_ci----------------------
826cd6a6acSopenharmony_ci
836cd6a6acSopenharmony_ciAssociates a previously declared [`sensitivityalias`](cil_mls_labeling_statements.md#sensitivityalias) identifier to a previously declared [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) identifier.
846cd6a6acSopenharmony_ci
856cd6a6acSopenharmony_ci**Statement definition:**
866cd6a6acSopenharmony_ci
876cd6a6acSopenharmony_ci```secil
886cd6a6acSopenharmony_ci    (sensitivityaliasactual sensitivityalias_id sensitivity_id)
896cd6a6acSopenharmony_ci```
906cd6a6acSopenharmony_ci
916cd6a6acSopenharmony_ci**Where:**
926cd6a6acSopenharmony_ci
936cd6a6acSopenharmony_ci<table>
946cd6a6acSopenharmony_ci<colgroup>
956cd6a6acSopenharmony_ci<col width="29%" />
966cd6a6acSopenharmony_ci<col width="70%" />
976cd6a6acSopenharmony_ci</colgroup>
986cd6a6acSopenharmony_ci<tbody>
996cd6a6acSopenharmony_ci<tr class="odd">
1006cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivityaliasactual</code></p></td>
1016cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivityaliasactual</code> keyword.</p></td>
1026cd6a6acSopenharmony_ci</tr>
1036cd6a6acSopenharmony_ci<tr class="even">
1046cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivityalias_id</code></p></td>
1056cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>sensitivityalias</code> identifier.</p></td>
1066cd6a6acSopenharmony_ci</tr>
1076cd6a6acSopenharmony_ci<tr class="odd">
1086cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity_id</code></p></td>
1096cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>sensitivity</code> identifier.</p></td>
1106cd6a6acSopenharmony_ci</tr>
1116cd6a6acSopenharmony_ci</tbody>
1126cd6a6acSopenharmony_ci</table>
1136cd6a6acSopenharmony_ci
1146cd6a6acSopenharmony_ci**Example:**
1156cd6a6acSopenharmony_ci
1166cd6a6acSopenharmony_ciThis example will associate sensitivity `s0` with two sensitivity alias's:
1176cd6a6acSopenharmony_ci
1186cd6a6acSopenharmony_ci```secil
1196cd6a6acSopenharmony_ci    (sensitivity s0)
1206cd6a6acSopenharmony_ci    (sensitivityalias unclassified)
1216cd6a6acSopenharmony_ci    (sensitivityalias SystemLow)
1226cd6a6acSopenharmony_ci    (sensitivityaliasactual unclassified s0)
1236cd6a6acSopenharmony_ci    (sensitivityaliasactual SystemLow s0)
1246cd6a6acSopenharmony_ci```
1256cd6a6acSopenharmony_ci
1266cd6a6acSopenharmony_cisensitivityorder
1276cd6a6acSopenharmony_ci----------------
1286cd6a6acSopenharmony_ci
1296cd6a6acSopenharmony_ciDefine the sensitivity order - lowest to highest. Multiple [`sensitivityorder`](cil_mls_labeling_statements.md#sensitivityorder) statements in the policy will form an ordered list.
1306cd6a6acSopenharmony_ci
1316cd6a6acSopenharmony_ci**Statement definition:**
1326cd6a6acSopenharmony_ci
1336cd6a6acSopenharmony_ci```secil
1346cd6a6acSopenharmony_ci    (sensitivityorder (sensitivity_id ...))
1356cd6a6acSopenharmony_ci```
1366cd6a6acSopenharmony_ci
1376cd6a6acSopenharmony_ci**Where:**
1386cd6a6acSopenharmony_ci
1396cd6a6acSopenharmony_ci<table>
1406cd6a6acSopenharmony_ci<colgroup>
1416cd6a6acSopenharmony_ci<col width="25%" />
1426cd6a6acSopenharmony_ci<col width="75%" />
1436cd6a6acSopenharmony_ci</colgroup>
1446cd6a6acSopenharmony_ci<tbody>
1456cd6a6acSopenharmony_ci<tr class="odd">
1466cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivityorder</code></p></td>
1476cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivityorder</code> keyword.</p></td>
1486cd6a6acSopenharmony_ci</tr>
1496cd6a6acSopenharmony_ci<tr class="even">
1506cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity_id</code></p></td>
1516cd6a6acSopenharmony_ci<td align="left"><p>One or more previously declared <code>sensitivity</code> or <code>sensitivityalias</code> identifiers..</p></td>
1526cd6a6acSopenharmony_ci</tr>
1536cd6a6acSopenharmony_ci</tbody>
1546cd6a6acSopenharmony_ci</table>
1556cd6a6acSopenharmony_ci
1566cd6a6acSopenharmony_ci**Example:**
1576cd6a6acSopenharmony_ci
1586cd6a6acSopenharmony_ciThis example shows two [`sensitivityorder`](cil_mls_labeling_statements.md#sensitivityorder) statements that when compiled will form an ordered list. Note however that the second [`sensitivityorder`](cil_mls_labeling_statements.md#sensitivityorder) statement starts with `s2` so that the ordered list can be built.
1596cd6a6acSopenharmony_ci
1606cd6a6acSopenharmony_ci```secil
1616cd6a6acSopenharmony_ci    (sensitivity s0)
1626cd6a6acSopenharmony_ci    (sensitivityalias s0 SystemLow)
1636cd6a6acSopenharmony_ci    (sensitivity s1)
1646cd6a6acSopenharmony_ci    (sensitivity s2)
1656cd6a6acSopenharmony_ci    (sensitivityorder (SystemLow s1 s2))
1666cd6a6acSopenharmony_ci
1676cd6a6acSopenharmony_ci    (sensitivity s3)
1686cd6a6acSopenharmony_ci    (sensitivity s4)
1696cd6a6acSopenharmony_ci    (sensitivityalias s4 SystemHigh)
1706cd6a6acSopenharmony_ci    (sensitivityorder (s2 s3 SystemHigh))
1716cd6a6acSopenharmony_ci```
1726cd6a6acSopenharmony_ci
1736cd6a6acSopenharmony_cicategory
1746cd6a6acSopenharmony_ci--------
1756cd6a6acSopenharmony_ci
1766cd6a6acSopenharmony_ciDeclare a category identifier in the current namespace. Multiple category statements declared in the policy will form an ordered list.
1776cd6a6acSopenharmony_ci
1786cd6a6acSopenharmony_ci**Statement definition:**
1796cd6a6acSopenharmony_ci
1806cd6a6acSopenharmony_ci```secil
1816cd6a6acSopenharmony_ci    (category category_id)
1826cd6a6acSopenharmony_ci```
1836cd6a6acSopenharmony_ci
1846cd6a6acSopenharmony_ci**Where:**
1856cd6a6acSopenharmony_ci
1866cd6a6acSopenharmony_ci<table>
1876cd6a6acSopenharmony_ci<colgroup>
1886cd6a6acSopenharmony_ci<col width="25%" />
1896cd6a6acSopenharmony_ci<col width="75%" />
1906cd6a6acSopenharmony_ci</colgroup>
1916cd6a6acSopenharmony_ci<tbody>
1926cd6a6acSopenharmony_ci<tr class="odd">
1936cd6a6acSopenharmony_ci<td align="left"><p><code>category</code></p></td>
1946cd6a6acSopenharmony_ci<td align="left"><p>The <code>category</code> keyword.</p></td>
1956cd6a6acSopenharmony_ci</tr>
1966cd6a6acSopenharmony_ci<tr class="even">
1976cd6a6acSopenharmony_ci<td align="left"><p><code>category_id</code></p></td>
1986cd6a6acSopenharmony_ci<td align="left"><p>The <code>category</code> identifier.</p></td>
1996cd6a6acSopenharmony_ci</tr>
2006cd6a6acSopenharmony_ci</tbody>
2016cd6a6acSopenharmony_ci</table>
2026cd6a6acSopenharmony_ci
2036cd6a6acSopenharmony_ci**Example:**
2046cd6a6acSopenharmony_ci
2056cd6a6acSopenharmony_ciThis example declares a three [`category`](cil_mls_labeling_statements.md#category) identifiers:
2066cd6a6acSopenharmony_ci
2076cd6a6acSopenharmony_ci```secil
2086cd6a6acSopenharmony_ci    (category c0)
2096cd6a6acSopenharmony_ci    (category c1)
2106cd6a6acSopenharmony_ci    (category c2)
2116cd6a6acSopenharmony_ci```
2126cd6a6acSopenharmony_ci
2136cd6a6acSopenharmony_cicategoryalias
2146cd6a6acSopenharmony_ci-------------
2156cd6a6acSopenharmony_ci
2166cd6a6acSopenharmony_ciDeclares a category alias identifier in the current namespace. See the [`categoryaliasactual`](cil_mls_labeling_statements.md#categoryaliasactual) statement for an example that associates the [`categoryalias`](cil_mls_labeling_statements.md#categoryalias) identifier.
2176cd6a6acSopenharmony_ci
2186cd6a6acSopenharmony_ci**Statement definition:**
2196cd6a6acSopenharmony_ci
2206cd6a6acSopenharmony_ci```secil
2216cd6a6acSopenharmony_ci    (categoryalias categoryalias_id)
2226cd6a6acSopenharmony_ci```
2236cd6a6acSopenharmony_ci
2246cd6a6acSopenharmony_ci**Where:**
2256cd6a6acSopenharmony_ci
2266cd6a6acSopenharmony_ci<table>
2276cd6a6acSopenharmony_ci<colgroup>
2286cd6a6acSopenharmony_ci<col width="25%" />
2296cd6a6acSopenharmony_ci<col width="75%" />
2306cd6a6acSopenharmony_ci</colgroup>
2316cd6a6acSopenharmony_ci<tbody>
2326cd6a6acSopenharmony_ci<tr class="odd">
2336cd6a6acSopenharmony_ci<td align="left"><p><code>categoryalias</code></p></td>
2346cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryalias</code> keyword.</p></td>
2356cd6a6acSopenharmony_ci</tr>
2366cd6a6acSopenharmony_ci<tr class="even">
2376cd6a6acSopenharmony_ci<td align="left"><p><code>categoryalias_id</code></p></td>
2386cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryalias</code> identifier.</p></td>
2396cd6a6acSopenharmony_ci</tr>
2406cd6a6acSopenharmony_ci</tbody>
2416cd6a6acSopenharmony_ci</table>
2426cd6a6acSopenharmony_ci
2436cd6a6acSopenharmony_cicategoryaliasactual
2446cd6a6acSopenharmony_ci-------------------
2456cd6a6acSopenharmony_ci
2466cd6a6acSopenharmony_ciAssociates a previously declared [`categoryalias`](cil_mls_labeling_statements.md#categoryalias) identifier to a previously declared [`category`](cil_mls_labeling_statements.md#category) identifier.
2476cd6a6acSopenharmony_ci
2486cd6a6acSopenharmony_ci**Statement definition:**
2496cd6a6acSopenharmony_ci
2506cd6a6acSopenharmony_ci```secil
2516cd6a6acSopenharmony_ci    (categoryaliasactual categoryalias_id category_id)
2526cd6a6acSopenharmony_ci```
2536cd6a6acSopenharmony_ci
2546cd6a6acSopenharmony_ci**Where:**
2556cd6a6acSopenharmony_ci
2566cd6a6acSopenharmony_ci<table>
2576cd6a6acSopenharmony_ci<colgroup>
2586cd6a6acSopenharmony_ci<col width="25%" />
2596cd6a6acSopenharmony_ci<col width="75%" />
2606cd6a6acSopenharmony_ci</colgroup>
2616cd6a6acSopenharmony_ci<tbody>
2626cd6a6acSopenharmony_ci<tr class="odd">
2636cd6a6acSopenharmony_ci<td align="left"><p><code>categoryaliasactual</code></p></td>
2646cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryaliasactual</code> keyword.</p></td>
2656cd6a6acSopenharmony_ci</tr>
2666cd6a6acSopenharmony_ci<tr class="even">
2676cd6a6acSopenharmony_ci<td align="left"><p><code>categoryalias_id</code></p></td>
2686cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>categoryalias</code> identifier.</p></td>
2696cd6a6acSopenharmony_ci</tr>
2706cd6a6acSopenharmony_ci<tr class="odd">
2716cd6a6acSopenharmony_ci<td align="left"><p><code>category_id</code></p></td>
2726cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>category</code> identifier.</p></td>
2736cd6a6acSopenharmony_ci</tr>
2746cd6a6acSopenharmony_ci</tbody>
2756cd6a6acSopenharmony_ci</table>
2766cd6a6acSopenharmony_ci
2776cd6a6acSopenharmony_ci**Example:**
2786cd6a6acSopenharmony_ci
2796cd6a6acSopenharmony_ciDeclares a category `c0`, a category alias of `documents`, and then associates them:
2806cd6a6acSopenharmony_ci
2816cd6a6acSopenharmony_ci```secil
2826cd6a6acSopenharmony_ci    (category c0)
2836cd6a6acSopenharmony_ci    (categoryalias documents)
2846cd6a6acSopenharmony_ci    (categoryaliasactual documents c0)
2856cd6a6acSopenharmony_ci```
2866cd6a6acSopenharmony_ci
2876cd6a6acSopenharmony_cicategoryorder
2886cd6a6acSopenharmony_ci-------------
2896cd6a6acSopenharmony_ci
2906cd6a6acSopenharmony_ciDefine the category order. Multiple [`categoryorder`](cil_mls_labeling_statements.md#categoryorder) statements declared in the policy will form an ordered list. Note that this statement orders the categories to allow validation of category ranges.
2916cd6a6acSopenharmony_ci
2926cd6a6acSopenharmony_ci**Statement definition:**
2936cd6a6acSopenharmony_ci
2946cd6a6acSopenharmony_ci```secil
2956cd6a6acSopenharmony_ci    (categoryorder (category_id ...))
2966cd6a6acSopenharmony_ci```
2976cd6a6acSopenharmony_ci
2986cd6a6acSopenharmony_ci**Where:**
2996cd6a6acSopenharmony_ci
3006cd6a6acSopenharmony_ci<table>
3016cd6a6acSopenharmony_ci<colgroup>
3026cd6a6acSopenharmony_ci<col width="25%" />
3036cd6a6acSopenharmony_ci<col width="75%" />
3046cd6a6acSopenharmony_ci</colgroup>
3056cd6a6acSopenharmony_ci<tbody>
3066cd6a6acSopenharmony_ci<tr class="odd">
3076cd6a6acSopenharmony_ci<td align="left"><p><code>categoryorder</code></p></td>
3086cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryorder</code> keyword.</p></td>
3096cd6a6acSopenharmony_ci</tr>
3106cd6a6acSopenharmony_ci<tr class="even">
3116cd6a6acSopenharmony_ci<td align="left"><p><code>category_id</code></p></td>
3126cd6a6acSopenharmony_ci<td align="left"><p>One or more previously declared <code>category</code> or <code>categoryalias</code> identifiers.</p></td>
3136cd6a6acSopenharmony_ci</tr>
3146cd6a6acSopenharmony_ci</tbody>
3156cd6a6acSopenharmony_ci</table>
3166cd6a6acSopenharmony_ci
3176cd6a6acSopenharmony_ci**Example:**
3186cd6a6acSopenharmony_ci
3196cd6a6acSopenharmony_ciThis example orders one category alias and nine categories:
3206cd6a6acSopenharmony_ci
3216cd6a6acSopenharmony_ci```secil
3226cd6a6acSopenharmony_ci    (categoryorder (documents c1 c2 c3 c4 c5 c6 c7 c8 c9)
3236cd6a6acSopenharmony_ci```
3246cd6a6acSopenharmony_ci
3256cd6a6acSopenharmony_cicategoryset
3266cd6a6acSopenharmony_ci-----------
3276cd6a6acSopenharmony_ci
3286cd6a6acSopenharmony_ciDeclare an identifier for a set of contiguous or non-contiguous categories in the current namespace.
3296cd6a6acSopenharmony_ci
3306cd6a6acSopenharmony_ciNotes:
3316cd6a6acSopenharmony_ci
3326cd6a6acSopenharmony_ci-   Category expressions are allowed in [`categoryset`](cil_mls_labeling_statements.md#categoryset), [`sensitivitycategory`](cil_mls_labeling_statements.md#sensitivitycategory), [`level`](cil_mls_labeling_statements.md#level), and [`levelrange`](cil_mls_labeling_statements.md#levelrange) statements.
3336cd6a6acSopenharmony_ci
3346cd6a6acSopenharmony_ci-   Category sets are not allowed in [`categoryorder`](cil_mls_labeling_statements.md#categoryorder) statements.
3356cd6a6acSopenharmony_ci
3366cd6a6acSopenharmony_ci**Statement definition:**
3376cd6a6acSopenharmony_ci
3386cd6a6acSopenharmony_ci```secil
3396cd6a6acSopenharmony_ci    (categoryset categoryset_id (category_id ... | expr ...))
3406cd6a6acSopenharmony_ci```
3416cd6a6acSopenharmony_ci
3426cd6a6acSopenharmony_ci**Where:**
3436cd6a6acSopenharmony_ci
3446cd6a6acSopenharmony_ci<table>
3456cd6a6acSopenharmony_ci<colgroup>
3466cd6a6acSopenharmony_ci<col width="25%" />
3476cd6a6acSopenharmony_ci<col width="75%" />
3486cd6a6acSopenharmony_ci</colgroup>
3496cd6a6acSopenharmony_ci<tbody>
3506cd6a6acSopenharmony_ci<tr class="odd">
3516cd6a6acSopenharmony_ci<td align="left"><p><code>categoryset</code></p></td>
3526cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryset</code> keyword.</p></td>
3536cd6a6acSopenharmony_ci</tr>
3546cd6a6acSopenharmony_ci<tr class="even">
3556cd6a6acSopenharmony_ci<td align="left"><p><code>categoryset_id</code></p></td>
3566cd6a6acSopenharmony_ci<td align="left"><p>The <code>categoryset</code> identifier.</p></td>
3576cd6a6acSopenharmony_ci</tr>
3586cd6a6acSopenharmony_ci<tr class="odd">
3596cd6a6acSopenharmony_ci<td align="left"><p><code>category_id</code></p></td>
3606cd6a6acSopenharmony_ci<td align="left"><p>Zero or more previously declared <code>category</code> or <code>categoryalias</code> identifiers.</p>
3616cd6a6acSopenharmony_ci<p>Note that there must be at least one <code>category_id</code> identifier or <code>expr</code> parameter declared.</p></td>
3626cd6a6acSopenharmony_ci</tr>
3636cd6a6acSopenharmony_ci<tr class="even">
3646cd6a6acSopenharmony_ci<td align="left"><p><code>expr</code></p></td>
3656cd6a6acSopenharmony_ci<td align="left"><p>Zero or more <code>expr</code>'s, the valid operators and syntax are:</p>
3666cd6a6acSopenharmony_ci<p><code>    (and (category_id ...) (category_id ...))</code></p>
3676cd6a6acSopenharmony_ci<p><code>    (or  (category_id ...) (category_id ...))</code></p>
3686cd6a6acSopenharmony_ci<p><code>    (xor (category_id ...) (category_id ...))</code></p>
3696cd6a6acSopenharmony_ci<p><code>    (not (category_id ...))</code></p>
3706cd6a6acSopenharmony_ci<p><code>    (range category_id category_id)</code></p>
3716cd6a6acSopenharmony_ci<p><code>    (all)</code></p></td>
3726cd6a6acSopenharmony_ci</tr>
3736cd6a6acSopenharmony_ci</tbody>
3746cd6a6acSopenharmony_ci</table>
3756cd6a6acSopenharmony_ci
3766cd6a6acSopenharmony_ci**Examples:**
3776cd6a6acSopenharmony_ci
3786cd6a6acSopenharmony_ciThese examples show a selection of [`categoryset`](cil_mls_labeling_statements.md#categoryset) statements:
3796cd6a6acSopenharmony_ci
3806cd6a6acSopenharmony_ci```secil
3816cd6a6acSopenharmony_ci    ; Declare categories with two alias's:
3826cd6a6acSopenharmony_ci    (category c0)
3836cd6a6acSopenharmony_ci    (categoryalias documents)
3846cd6a6acSopenharmony_ci    (categoryaliasactual documents c0)
3856cd6a6acSopenharmony_ci    (category c1)
3866cd6a6acSopenharmony_ci    (category c2)
3876cd6a6acSopenharmony_ci    (category c3)
3886cd6a6acSopenharmony_ci    (category c4)
3896cd6a6acSopenharmony_ci    (categoryalias spreadsheets)
3906cd6a6acSopenharmony_ci    (categoryaliasactual spreadsheets c4)
3916cd6a6acSopenharmony_ci
3926cd6a6acSopenharmony_ci    ; Set the order to determine ranges:
3936cd6a6acSopenharmony_ci    (categoryorder (c0 c1 c2 c3 spreadsheets))
3946cd6a6acSopenharmony_ci
3956cd6a6acSopenharmony_ci    (categoryset catrange_1 (range c2 c3))
3966cd6a6acSopenharmony_ci
3976cd6a6acSopenharmony_ci    ; Two methods to associate all categories:
3986cd6a6acSopenharmony_ci    (categoryset all_cats (range c0 c4))
3996cd6a6acSopenharmony_ci    (categoryset all_cats1 (all))
4006cd6a6acSopenharmony_ci
4016cd6a6acSopenharmony_ci    (categoryset catset_1 (documents c1))
4026cd6a6acSopenharmony_ci    (categoryset catset_2 (c2 c3))
4036cd6a6acSopenharmony_ci    (categoryset catset_3 (c4))
4046cd6a6acSopenharmony_ci
4056cd6a6acSopenharmony_ci    (categoryset just_c0 (xor (c1 c2) (documents c1 c2)))
4066cd6a6acSopenharmony_ci```
4076cd6a6acSopenharmony_ci
4086cd6a6acSopenharmony_cisensitivitycategory
4096cd6a6acSopenharmony_ci-------------------
4106cd6a6acSopenharmony_ci
4116cd6a6acSopenharmony_ciAssociate a [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) identifier with one or more [category](#category)'s. Multiple definitions for the same [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) form an ordered list of categories for that sensitivity. This statement is required before a [`level`](cil_mls_labeling_statements.md#level) identifier can be declared.
4126cd6a6acSopenharmony_ci
4136cd6a6acSopenharmony_ci**Statement definition:**
4146cd6a6acSopenharmony_ci
4156cd6a6acSopenharmony_ci```secil
4166cd6a6acSopenharmony_ci    (sensitivitycategory sensitivity_id categoryset_id)
4176cd6a6acSopenharmony_ci```
4186cd6a6acSopenharmony_ci
4196cd6a6acSopenharmony_ci**Where:**
4206cd6a6acSopenharmony_ci
4216cd6a6acSopenharmony_ci<table>
4226cd6a6acSopenharmony_ci<colgroup>
4236cd6a6acSopenharmony_ci<col width="25%" />
4246cd6a6acSopenharmony_ci<col width="75%" />
4256cd6a6acSopenharmony_ci</colgroup>
4266cd6a6acSopenharmony_ci<tbody>
4276cd6a6acSopenharmony_ci<tr class="odd">
4286cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivitycategory</code></p></td>
4296cd6a6acSopenharmony_ci<td align="left"><p>The <code>sensitivitycategory</code> keyword.</p></td>
4306cd6a6acSopenharmony_ci</tr>
4316cd6a6acSopenharmony_ci<tr class="even">
4326cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity_id</code></p></td>
4336cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>sensitivity</code> or <code>sensitivityalias</code> identifier.</p></td>
4346cd6a6acSopenharmony_ci</tr>
4356cd6a6acSopenharmony_ci<tr class="odd">
4366cd6a6acSopenharmony_ci<td align="left"><p><code>categoryset_id</code></p></td>
4376cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>categoryset</code> (named or anonymous), or a list of <code>category</code> and/or <code>categoryalias</code> identifiers. The examples show each variation.</p></td>
4386cd6a6acSopenharmony_ci</tr>
4396cd6a6acSopenharmony_ci</tbody>
4406cd6a6acSopenharmony_ci</table>
4416cd6a6acSopenharmony_ci
4426cd6a6acSopenharmony_ci**Examples:**
4436cd6a6acSopenharmony_ci
4446cd6a6acSopenharmony_ciThese [`sensitivitycategory`](cil_mls_labeling_statements.md#sensitivitycategory) examples use a selection of [`category`](cil_mls_labeling_statements.md#category), [`categoryalias`](cil_mls_labeling_statements.md#categoryalias) and [`categoryset`](cil_mls_labeling_statements.md#categoryset)'s:
4456cd6a6acSopenharmony_ci
4466cd6a6acSopenharmony_ci```secil
4476cd6a6acSopenharmony_ci    (sensitivitycategory s0 catrange_1)
4486cd6a6acSopenharmony_ci    (sensitivitycategory s0 catset_1)
4496cd6a6acSopenharmony_ci    (sensitivitycategory s0 catset_3)
4506cd6a6acSopenharmony_ci    (sensitivitycategory s0 (all))
4516cd6a6acSopenharmony_ci    (sensitivitycategory unclassified (range documents c2))
4526cd6a6acSopenharmony_ci```
4536cd6a6acSopenharmony_ci
4546cd6a6acSopenharmony_cilevel
4556cd6a6acSopenharmony_ci-----
4566cd6a6acSopenharmony_ci
4576cd6a6acSopenharmony_ciDeclare a [`level`](cil_mls_labeling_statements.md#level) identifier in the current namespace and associate it to a previously declared [`sensitivity`](cil_mls_labeling_statements.md#sensitivity) and zero or more categories. Note that if categories are required, then before this statement can be resolved the [`sensitivitycategory`](cil_mls_labeling_statements.md#sensitivitycategory) statement must be used to associate categories with the sensitivity.
4586cd6a6acSopenharmony_ci
4596cd6a6acSopenharmony_ci**Statement definition:**
4606cd6a6acSopenharmony_ci
4616cd6a6acSopenharmony_ci```secil
4626cd6a6acSopenharmony_ci    (level level_id (sensitivity_id [categoryset_id]))
4636cd6a6acSopenharmony_ci```
4646cd6a6acSopenharmony_ci
4656cd6a6acSopenharmony_ci**Where:**
4666cd6a6acSopenharmony_ci
4676cd6a6acSopenharmony_ci<table>
4686cd6a6acSopenharmony_ci<colgroup>
4696cd6a6acSopenharmony_ci<col width="25%" />
4706cd6a6acSopenharmony_ci<col width="75%" />
4716cd6a6acSopenharmony_ci</colgroup>
4726cd6a6acSopenharmony_ci<tbody>
4736cd6a6acSopenharmony_ci<tr class="odd">
4746cd6a6acSopenharmony_ci<td align="left"><p><code>level</code></p></td>
4756cd6a6acSopenharmony_ci<td align="left"><p>The <code>level</code> keyword.</p></td>
4766cd6a6acSopenharmony_ci</tr>
4776cd6a6acSopenharmony_ci<tr class="even">
4786cd6a6acSopenharmony_ci<td align="left"><p><code>level_id</code></p></td>
4796cd6a6acSopenharmony_ci<td align="left"><p>The <code>level</code> identifier.</p></td>
4806cd6a6acSopenharmony_ci</tr>
4816cd6a6acSopenharmony_ci<tr class="odd">
4826cd6a6acSopenharmony_ci<td align="left"><p><code>sensitivity_id</code></p></td>
4836cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>sensitivity</code> or <code>sensitivityalias</code> identifier.</p></td>
4846cd6a6acSopenharmony_ci</tr>
4856cd6a6acSopenharmony_ci<tr class="even">
4866cd6a6acSopenharmony_ci<td align="left"><p><code>categoryset_id</code></p></td>
4876cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>categoryset</code> (named or anonymous), or a list of <code>category</code> and/or <code>categoryalias</code> identifiers. The examples show each variation.</p></td>
4886cd6a6acSopenharmony_ci</tr>
4896cd6a6acSopenharmony_ci</tbody>
4906cd6a6acSopenharmony_ci</table>
4916cd6a6acSopenharmony_ci
4926cd6a6acSopenharmony_ci**Examples:**
4936cd6a6acSopenharmony_ci
4946cd6a6acSopenharmony_ciThese [`level`](cil_mls_labeling_statements.md#level) examples use a selection of [`category`](cil_mls_labeling_statements.md#category), [`categoryalias`](cil_mls_labeling_statements.md#categoryalias) and [`categoryset`](cil_mls_labeling_statements.md#categoryset)'s:
4956cd6a6acSopenharmony_ci
4966cd6a6acSopenharmony_ci```secil
4976cd6a6acSopenharmony_ci    (level systemLow (s0))
4986cd6a6acSopenharmony_ci    (level level_1 (s0))
4996cd6a6acSopenharmony_ci    (level level_2 (s0 (catrange_1)))
5006cd6a6acSopenharmony_ci    (level level_3 (s0 (all_cats)))
5016cd6a6acSopenharmony_ci    (level level_4 (unclassified (c2 c3 c4)))
5026cd6a6acSopenharmony_ci```
5036cd6a6acSopenharmony_ci
5046cd6a6acSopenharmony_cilevelrange
5056cd6a6acSopenharmony_ci----------
5066cd6a6acSopenharmony_ci
5076cd6a6acSopenharmony_ciDeclare a level range identifier in the current namespace and associate a current and clearance level.
5086cd6a6acSopenharmony_ci
5096cd6a6acSopenharmony_ci**Statement definition:**
5106cd6a6acSopenharmony_ci
5116cd6a6acSopenharmony_ci```secil
5126cd6a6acSopenharmony_ci    (levelrange levelrange_id (low_level_id high_level_id))
5136cd6a6acSopenharmony_ci```
5146cd6a6acSopenharmony_ci
5156cd6a6acSopenharmony_ci**Where:**
5166cd6a6acSopenharmony_ci
5176cd6a6acSopenharmony_ci<table>
5186cd6a6acSopenharmony_ci<colgroup>
5196cd6a6acSopenharmony_ci<col width="25%" />
5206cd6a6acSopenharmony_ci<col width="75%" />
5216cd6a6acSopenharmony_ci</colgroup>
5226cd6a6acSopenharmony_ci<tbody>
5236cd6a6acSopenharmony_ci<tr class="odd">
5246cd6a6acSopenharmony_ci<td align="left"><p><code>levelrange</code></p></td>
5256cd6a6acSopenharmony_ci<td align="left"><p>The <code>levelrange</code> keyword.</p></td>
5266cd6a6acSopenharmony_ci</tr>
5276cd6a6acSopenharmony_ci<tr class="even">
5286cd6a6acSopenharmony_ci<td align="left"><p><code>levelrange_id</code></p></td>
5296cd6a6acSopenharmony_ci<td align="left"><p>The <code>levelrange</code> identifier.</p></td>
5306cd6a6acSopenharmony_ci</tr>
5316cd6a6acSopenharmony_ci<tr class="odd">
5326cd6a6acSopenharmony_ci<td align="left"><p><code>low_level_id</code></p></td>
5336cd6a6acSopenharmony_ci<td align="left"><p>The current level specified by a previously declared <code>level</code> identifier. This may be formed by named or anonymous components as discussed in the <code>level</code> section and shown in the examples.</p></td>
5346cd6a6acSopenharmony_ci</tr>
5356cd6a6acSopenharmony_ci<tr class="even">
5366cd6a6acSopenharmony_ci<td align="left"><p><code>high_level_id</code></p></td>
5376cd6a6acSopenharmony_ci<td align="left"><p>The clearance or high level specified by a previously declared <code>level</code> identifier. This may be formed by named or anonymous components as discussed in the <code>level</code> section and shown in the examples.</p></td>
5386cd6a6acSopenharmony_ci</tr>
5396cd6a6acSopenharmony_ci</tbody>
5406cd6a6acSopenharmony_ci</table>
5416cd6a6acSopenharmony_ci
5426cd6a6acSopenharmony_ci**Examples:**
5436cd6a6acSopenharmony_ci
5446cd6a6acSopenharmony_ciThis example policy shows [`levelrange`](cil_mls_labeling_statements.md#levelrange) statement and all the other MLS labeling statements discussed in this section and will compile as a standalone policy:
5456cd6a6acSopenharmony_ci
5466cd6a6acSopenharmony_ci```secil
5476cd6a6acSopenharmony_ci    (handleunknown allow)
5486cd6a6acSopenharmony_ci    (mls true)
5496cd6a6acSopenharmony_ci
5506cd6a6acSopenharmony_ci    ; There must be least one set of SID statements in a policy:
5516cd6a6acSopenharmony_ci    (sid kernel)
5526cd6a6acSopenharmony_ci    (sidorder (kernel))
5536cd6a6acSopenharmony_ci    (sidcontext kernel unconfined.context_1)
5546cd6a6acSopenharmony_ci
5556cd6a6acSopenharmony_ci    (sensitivitycategory s0 (c4 c2 c3 c1 c0 c3))
5566cd6a6acSopenharmony_ci
5576cd6a6acSopenharmony_ci    (category c0)
5586cd6a6acSopenharmony_ci    (categoryalias documents)
5596cd6a6acSopenharmony_ci    (categoryaliasactual documents c0)
5606cd6a6acSopenharmony_ci    (category c1)
5616cd6a6acSopenharmony_ci    (category c2)
5626cd6a6acSopenharmony_ci    (category c3)
5636cd6a6acSopenharmony_ci    (category c4)
5646cd6a6acSopenharmony_ci    (categoryalias spreadsheets)
5656cd6a6acSopenharmony_ci    (categoryaliasactual spreadsheets c4)
5666cd6a6acSopenharmony_ci
5676cd6a6acSopenharmony_ci    (categoryorder (c0 c1 c2 c3 spreadsheets))
5686cd6a6acSopenharmony_ci
5696cd6a6acSopenharmony_ci    (categoryset catrange_1 (range c2 c3))
5706cd6a6acSopenharmony_ci    (categoryset all_cats (range c0 c4))
5716cd6a6acSopenharmony_ci    (categoryset all_cats1 (all))
5726cd6a6acSopenharmony_ci
5736cd6a6acSopenharmony_ci    (categoryset catset_1 (documents c1))
5746cd6a6acSopenharmony_ci    (categoryset catset_2 (c2 c3))
5756cd6a6acSopenharmony_ci    (categoryset catset_3 (c4))
5766cd6a6acSopenharmony_ci
5776cd6a6acSopenharmony_ci    (categoryset just_c0 (xor (c1 c2) (documents c1 c2)))
5786cd6a6acSopenharmony_ci
5796cd6a6acSopenharmony_ci    (sensitivity s0)
5806cd6a6acSopenharmony_ci    (sensitivityalias unclassified)
5816cd6a6acSopenharmony_ci    (sensitivityaliasactual unclassified s0)
5826cd6a6acSopenharmony_ci
5836cd6a6acSopenharmony_ci    (sensitivityorder (s0))
5846cd6a6acSopenharmony_ci    (sensitivitycategory s0 (c0))
5856cd6a6acSopenharmony_ci
5866cd6a6acSopenharmony_ci    (sensitivitycategory s0 catrange_1)
5876cd6a6acSopenharmony_ci    (sensitivitycategory s0 catset_1)
5886cd6a6acSopenharmony_ci    (sensitivitycategory s0 catset_3)
5896cd6a6acSopenharmony_ci    (sensitivitycategory s0 (all))
5906cd6a6acSopenharmony_ci    (sensitivitycategory s0 (range documents c2))
5916cd6a6acSopenharmony_ci
5926cd6a6acSopenharmony_ci    (level systemLow (s0))
5936cd6a6acSopenharmony_ci    (level level_1 (s0))
5946cd6a6acSopenharmony_ci    (level level_2 (s0 (catrange_1)))
5956cd6a6acSopenharmony_ci    (level level_3 (s0 (all_cats)))
5966cd6a6acSopenharmony_ci    (level level_4 (unclassified (c2 c3 c4)))
5976cd6a6acSopenharmony_ci
5986cd6a6acSopenharmony_ci    (levelrange levelrange_2 (level_2 level_2))
5996cd6a6acSopenharmony_ci    (levelrange levelrange_1 ((s0) level_2))
6006cd6a6acSopenharmony_ci    (levelrange low_low (systemLow systemLow))
6016cd6a6acSopenharmony_ci
6026cd6a6acSopenharmony_ci    (context context_2 (unconfined.user object_r unconfined.object (level_1 level_3)))
6036cd6a6acSopenharmony_ci
6046cd6a6acSopenharmony_ci    ; Define object_r role. This must be assigned in CIL.
6056cd6a6acSopenharmony_ci    (role object_r)
6066cd6a6acSopenharmony_ci
6076cd6a6acSopenharmony_ci    (block unconfined
6086cd6a6acSopenharmony_ci        (user user)
6096cd6a6acSopenharmony_ci        (role role)
6106cd6a6acSopenharmony_ci        (type process)
6116cd6a6acSopenharmony_ci        (type object)
6126cd6a6acSopenharmony_ci        (userrange user (systemLow systemLow))
6136cd6a6acSopenharmony_ci        (userlevel user systemLow)
6146cd6a6acSopenharmony_ci        (userrole user role)
6156cd6a6acSopenharmony_ci        (userrole user object_r)
6166cd6a6acSopenharmony_ci        (roletype role process)
6176cd6a6acSopenharmony_ci        (roletype role object)
6186cd6a6acSopenharmony_ci        (roletype object_r object)
6196cd6a6acSopenharmony_ci
6206cd6a6acSopenharmony_ci        (class file (open execute read write))
6216cd6a6acSopenharmony_ci
6226cd6a6acSopenharmony_ci        ; There must be least one allow rule in a policy:
6236cd6a6acSopenharmony_ci        (allow process self (file (read)))
6246cd6a6acSopenharmony_ci
6256cd6a6acSopenharmony_ci        (context context_1 (user object_r object low_low))
6266cd6a6acSopenharmony_ci    ) ; End unconfined namespace
6276cd6a6acSopenharmony_ci```
6286cd6a6acSopenharmony_ci
6296cd6a6acSopenharmony_cirangetransition
6306cd6a6acSopenharmony_ci---------------
6316cd6a6acSopenharmony_ci
6326cd6a6acSopenharmony_ciAllows an objects level to transition to a different level. Generally used to ensure processes run with their correct MLS range, for example `init` would run at `SystemHigh` and needs to initialise / run other processes at their correct MLS range.
6336cd6a6acSopenharmony_ci
6346cd6a6acSopenharmony_ci**Statement definition:**
6356cd6a6acSopenharmony_ci
6366cd6a6acSopenharmony_ci```secil
6376cd6a6acSopenharmony_ci    (rangetransition source_id target_id class_id new_range_id)
6386cd6a6acSopenharmony_ci```
6396cd6a6acSopenharmony_ci
6406cd6a6acSopenharmony_ci**Where:**
6416cd6a6acSopenharmony_ci
6426cd6a6acSopenharmony_ci<table>
6436cd6a6acSopenharmony_ci<colgroup>
6446cd6a6acSopenharmony_ci<col width="25%" />
6456cd6a6acSopenharmony_ci<col width="75%" />
6466cd6a6acSopenharmony_ci</colgroup>
6476cd6a6acSopenharmony_ci<tbody>
6486cd6a6acSopenharmony_ci<tr class="odd">
6496cd6a6acSopenharmony_ci<td align="left"><p><code>rangetransition</code></p></td>
6506cd6a6acSopenharmony_ci<td align="left"><p>The <code>rangetransition</code> keyword.</p></td>
6516cd6a6acSopenharmony_ci</tr>
6526cd6a6acSopenharmony_ci<tr class="even">
6536cd6a6acSopenharmony_ci<td align="left"><p><code>source_type_id</code></p></td>
6546cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>type</code>, <code>typealias</code> or <code>typeattribute</code> identifier.</p></td>
6556cd6a6acSopenharmony_ci</tr>
6566cd6a6acSopenharmony_ci<tr class="odd">
6576cd6a6acSopenharmony_ci<td align="left"><p><code>target_type_id</code></p></td>
6586cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>type</code>, <code>typealias</code> or <code>typeattribute</code> identifier.</p></td>
6596cd6a6acSopenharmony_ci</tr>
6606cd6a6acSopenharmony_ci<tr class="even">
6616cd6a6acSopenharmony_ci<td align="left"><p><code>class_id</code></p></td>
6626cd6a6acSopenharmony_ci<td align="left"><p>A single previously declared <code>class</code> or <code>classmap</code> identifier.</p></td>
6636cd6a6acSopenharmony_ci</tr>
6646cd6a6acSopenharmony_ci<tr class="odd">
6656cd6a6acSopenharmony_ci<td align="left"><p><code>new_range_id</code></p></td>
6666cd6a6acSopenharmony_ci<td align="left"><p>The new MLS range for the object class that is a previously declared <code>levelrange</code> identifier. This entry may also be defined as an anonymous or named <code>level</code>, <code>sensitivity</code>, <code>sensitivityalias</code>, <code>category</code>, <code>categoryalias</code> or <code>categoryset</code> identifier.</p></td>
6676cd6a6acSopenharmony_ci</tr>
6686cd6a6acSopenharmony_ci</tbody>
6696cd6a6acSopenharmony_ci</table>
6706cd6a6acSopenharmony_ci
6716cd6a6acSopenharmony_ci**Examples:**
6726cd6a6acSopenharmony_ci
6736cd6a6acSopenharmony_ciThis rule will transition the range of `sshd.exec` to `s0 - s1:c0.c3` on execution from the `init.process`:
6746cd6a6acSopenharmony_ci
6756cd6a6acSopenharmony_ci```secil
6766cd6a6acSopenharmony_ci    (sensitivity s0)
6776cd6a6acSopenharmony_ci    (sensitivity s1)
6786cd6a6acSopenharmony_ci    (sensitivityorder s0 s1)
6796cd6a6acSopenharmony_ci    (category c0)
6806cd6a6acSopenharmony_ci    ...
6816cd6a6acSopenharmony_ci    (level systemlow (s0))
6826cd6a6acSopenharmony_ci    (level systemhigh (s1 (c0 c1 c2)))
6836cd6a6acSopenharmony_ci    (levelrange low_high (systemlow systemhigh))
6846cd6a6acSopenharmony_ci
6856cd6a6acSopenharmony_ci    (rangetransition init.process sshd.exec process low_high)
6866cd6a6acSopenharmony_ci```
687