16cd6a6acSopenharmony_ciPolicy Configuration Statements
26cd6a6acSopenharmony_ci===============================
36cd6a6acSopenharmony_ci
46cd6a6acSopenharmony_cimls
56cd6a6acSopenharmony_ci---
66cd6a6acSopenharmony_ci
76cd6a6acSopenharmony_ciDefines whether the policy is built as an MLS or non-MLS policy by the CIL compiler. There MUST only be one [`mls`](cil_policy_config_statements.md#mls) entry in the policy otherwise the compiler will exit with an error.
86cd6a6acSopenharmony_ci
96cd6a6acSopenharmony_ciNote that this can be over-ridden by the CIL compiler command line parameter `-M true|false` or `--mls true|false` flags.
106cd6a6acSopenharmony_ci
116cd6a6acSopenharmony_ci**Statement definition:**
126cd6a6acSopenharmony_ci
136cd6a6acSopenharmony_ci```secil
146cd6a6acSopenharmony_ci    (mls boolean)
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>mls</code></p></td>
276cd6a6acSopenharmony_ci<td align="left"><p>The <code>mls</code> keyword.</p></td>
286cd6a6acSopenharmony_ci</tr>
296cd6a6acSopenharmony_ci<tr class="even">
306cd6a6acSopenharmony_ci<td align="left"><p><code>boolean</code></p></td>
316cd6a6acSopenharmony_ci<td align="left"><p>Set to either <code>true</code> or <code>false</code>.</p></td>
326cd6a6acSopenharmony_ci</tr>
336cd6a6acSopenharmony_ci</tbody>
346cd6a6acSopenharmony_ci</table>
356cd6a6acSopenharmony_ci
366cd6a6acSopenharmony_ci**Example:**
376cd6a6acSopenharmony_ci
386cd6a6acSopenharmony_ci```secil
396cd6a6acSopenharmony_ci    (mls true)
406cd6a6acSopenharmony_ci```
416cd6a6acSopenharmony_ci
426cd6a6acSopenharmony_cihandleunknown
436cd6a6acSopenharmony_ci-------------
446cd6a6acSopenharmony_ci
456cd6a6acSopenharmony_ciDefines how the kernel will handle unknown object classes and permissions when loading the policy. There MUST only be one [`handleunknown`](cil_policy_config_statements.md#handleunknown) entry in the policy otherwise the compiler will exit with an error.
466cd6a6acSopenharmony_ci
476cd6a6acSopenharmony_ciNote that this can be over-ridden by the CIL compiler command line parameter `-U` or `--handle-unknown` flags.
486cd6a6acSopenharmony_ci
496cd6a6acSopenharmony_ci**Statement definition:**
506cd6a6acSopenharmony_ci
516cd6a6acSopenharmony_ci```secil
526cd6a6acSopenharmony_ci    (handleunknown action)
536cd6a6acSopenharmony_ci```
546cd6a6acSopenharmony_ci
556cd6a6acSopenharmony_ci**Where:**
566cd6a6acSopenharmony_ci
576cd6a6acSopenharmony_ci<table>
586cd6a6acSopenharmony_ci<colgroup>
596cd6a6acSopenharmony_ci<col width="20%" />
606cd6a6acSopenharmony_ci<col width="80%" />
616cd6a6acSopenharmony_ci</colgroup>
626cd6a6acSopenharmony_ci<tbody>
636cd6a6acSopenharmony_ci<tr class="odd">
646cd6a6acSopenharmony_ci<td align="left"><p><code>handleunknown</code></p></td>
656cd6a6acSopenharmony_ci<td align="left"><p>The <code>handleunknown</code> keyword.</p></td>
666cd6a6acSopenharmony_ci</tr>
676cd6a6acSopenharmony_ci<tr class="even">
686cd6a6acSopenharmony_ci<td align="left"><p><code>action</code></p></td>
696cd6a6acSopenharmony_ci<td align="left"><p>A keyword of either <code>allow</code>, <code>deny</code> or <code>reject</code>. The kernel will handle these keywords as follows:</p>
706cd6a6acSopenharmony_ci<p><code>    allow</code> unknown class / permissions. This will set the returned AV with all 1's.</p>
716cd6a6acSopenharmony_ci<p><code>    deny</code> unknown class / permissions (the default). This will set the returned AV with all 0's.</p>
726cd6a6acSopenharmony_ci<p><code>    reject</code> loading the policy if it does not contain all the object classes / permissions.</p></td>
736cd6a6acSopenharmony_ci</tr>
746cd6a6acSopenharmony_ci</tbody>
756cd6a6acSopenharmony_ci</table>
766cd6a6acSopenharmony_ci
776cd6a6acSopenharmony_ci**Example:**
786cd6a6acSopenharmony_ci
796cd6a6acSopenharmony_ciThis will allow unknown classes / permissions to be present in the policy:
806cd6a6acSopenharmony_ci
816cd6a6acSopenharmony_ci```secil
826cd6a6acSopenharmony_ci    (handleunknown allow)
836cd6a6acSopenharmony_ci```
846cd6a6acSopenharmony_ci
856cd6a6acSopenharmony_cipolicycap
866cd6a6acSopenharmony_ci---------
876cd6a6acSopenharmony_ci
886cd6a6acSopenharmony_ciAllow policy capabilities to be enabled via policy. These should be declared in the global namespace and be valid policy capabilities as they are checked against those known in libsepol by the CIL compiler.
896cd6a6acSopenharmony_ci
906cd6a6acSopenharmony_ci**Statement definition:**
916cd6a6acSopenharmony_ci
926cd6a6acSopenharmony_ci```secil
936cd6a6acSopenharmony_ci    (policycap policycap_id)
946cd6a6acSopenharmony_ci```
956cd6a6acSopenharmony_ci
966cd6a6acSopenharmony_ci**Where:**
976cd6a6acSopenharmony_ci
986cd6a6acSopenharmony_ci<table>
996cd6a6acSopenharmony_ci<colgroup>
1006cd6a6acSopenharmony_ci<col width="25%" />
1016cd6a6acSopenharmony_ci<col width="75%" />
1026cd6a6acSopenharmony_ci</colgroup>
1036cd6a6acSopenharmony_ci<tbody>
1046cd6a6acSopenharmony_ci<tr class="odd">
1056cd6a6acSopenharmony_ci<td align="left"><p><code>policycap</code></p></td>
1066cd6a6acSopenharmony_ci<td align="left"><p>The <code>policycap</code> keyword.</p></td>
1076cd6a6acSopenharmony_ci</tr>
1086cd6a6acSopenharmony_ci<tr class="even">
1096cd6a6acSopenharmony_ci<td align="left"><p><code>policycap_id</code></p></td>
1106cd6a6acSopenharmony_ci<td align="left"><p>The <code>policycap</code> identifier (e.g. <code>open_perms</code>).</p></td>
1116cd6a6acSopenharmony_ci</tr>
1126cd6a6acSopenharmony_ci</tbody>
1136cd6a6acSopenharmony_ci</table>
1146cd6a6acSopenharmony_ci
1156cd6a6acSopenharmony_ci**Example:**
1166cd6a6acSopenharmony_ci
1176cd6a6acSopenharmony_ciThese set two valid policy capabilities:
1186cd6a6acSopenharmony_ci
1196cd6a6acSopenharmony_ci```secil
1206cd6a6acSopenharmony_ci    ; Enable networking controls.
1216cd6a6acSopenharmony_ci    (policycap network_peer_controls)
1226cd6a6acSopenharmony_ci
1236cd6a6acSopenharmony_ci    ; Enable open permission check.
1246cd6a6acSopenharmony_ci    (policycap open_perms)
1256cd6a6acSopenharmony_ci```
126