| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY identifier "[a-zA-Z][\w\-]*(?:\.?[\w\-])*"> |
| 5 |
<!ENTITY versionIdentifier "\d+(?:\.[\d_\.]*)?"> |
| 6 |
<!-- Documentation --> |
| 7 |
<!ENTITY tagName "(?:[a-zA-Z_](?:[\w\-\.]*\w)?\:)?[a-zA-Z_](?:[\w\-\.]*\w)?"> |
| 8 |
<!-- PCRE 2 RegExp --> |
| 9 |
<!ENTITY specialChars "*?.+"> |
| 10 |
<!ENTITY capGroup "\?(?:<[\=!]|P?<\w+>|'\w+'|[\=!:>\|R&\-#])"> <!-- Capturing & Groups --> |
| 11 |
<!-- M4 Macros --> |
| 12 |
<!ENTITY m4Args "\$(?:[1-9]\d*|0|[\#\*\@]|\{(?:[1-9]\d*|0)\})"> |
| 13 |
<!ENTITY m4Quotes "`'‘’“”"> <!-- Default Quotes (`') & Other Common Quotes --> |
| 14 |
<!-- For File Contexts --> |
| 15 |
<!ENTITY identifierWithArg "(?:[a-zA-Z]|&m4Args;)(?:\.?(?:[\w\-]|&m4Args;))*"> |
| 16 |
<!ENTITY mlsLevel "&identifierWithArg;(?:\:&identifierWithArg;(?:\s*,\s*&identifierWithArg;)*)?"> |
| 17 |
|
| 18 |
<!ENTITY url "\bhttps?://[^\s<>"'`]*[^\s<>"'`\}\)\]\.,;\|]"> |
| 19 |
<!ENTITY email "(?:(?:[^<>\(\)\[\]\\\.,;:\s@"]+(?:\.[^<>\(\)\[\]\\\.,;:\s@"]+)*)|(?:"[^"]+"))@(?:(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}])|(?:(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,}))\b"> |
| 20 |
|
| 21 |
<!ENTITY ipv4 "\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"> |
| 22 |
<!-- IPv6 (Source: https://community.helpsystems.com/forums/intermapper/miscellaneous-topics/5acc4fcf-fa83-e511-80cf-0050568460e4 ) --> |
| 23 |
<!ENTITY ipv6 "(?:(?:\b(?:[0-9A-Fa-f]{1,4}\:){7}(?:[0-9A-Fa-f]{1,4}|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){6}(?:\:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){5}(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,2})|\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){4}(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,3})|(?:(?:\:[0-9A-Fa-f]{1,4})?\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){3}(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,4})|(?:(?:\:[0-9A-Fa-f]{1,4}){0,2}\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){2}(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,5})|(?:(?:\:[0-9A-Fa-f]{1,4}){0,3}\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|\:))|(?:\b(?:[0-9A-Fa-f]{1,4}\:){1}(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,6})|(?:(?:\:[0-9A-Fa-f]{1,4}){0,4}\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|\:))|(?:\:(?:(?:(?:\:[0-9A-Fa-f]{1,4}){1,7})|(?:(?:\:[0-9A-Fa-f]{1,4}){0,5}\:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|\:)))"> <!-- End: (\%\w+\b)? --> |
| 24 |
|
| 25 |
<!-- Hexadecimal --> |
| 26 |
<!ENTITY escape1 "\\x(?:\{[\da-fA-F]+\}|[\da-fA-F]{2})"> |
| 27 |
<!-- Octal. NOTE: only ASCII chars. for \ddd --> |
| 28 |
<!ENTITY escape2 "\\(?:o\{[0-7]+\}|[0-3][0-7]{0,2}|[4-7][0-7]?)"> |
| 29 |
<!-- References --> |
| 30 |
<!ENTITY escape3 "\\[kg](?:<\w+>|'\w+'|\{\w+\})"> |
| 31 |
<!ENTITY escape4 "\\g(?:<[\+\-]?\d+>|'[\+\-]?\d+'|\{[\+\-]?\d+\}|[\+\-]?\d)"> |
| 32 |
<!-- Category Properties --> |
| 33 |
<!ENTITY escape5 "\\[pP](?:C[cfnos]?|L[lmotu&]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?)"> |
| 34 |
<!ENTITY escape6 "\\[pP]\{(?:Xan|Xps|Xsp|Xuc|Xwd|C[cfnos]?|L[lmotu&]?|M[cen]?|N[dlo]?|P[cdefios]?|S[ckmo]?|Z[lps]?)\}"> |
| 35 |
<!-- Script Names --> |
| 36 |
<!ENTITY escape7 "\\[pP]\{(?:Ahom|Anatolian_Hieroglyphs|Arabic|Armenian|Avestan|Balinese|Bamum|Bassa_Vah|Batak|Bengali|Bopomofo|Brahmi|Braille|Buginese|Buhid|Canadian_Aboriginal|Carian|Caucasian_Albanian|Chakma|Cham|Cherokee|Common|Coptic|Cuneiform|Cypriot|Cyrillic|Deseret|Devanagari|Duployan|Egyptian_Hieroglyphs|Elbasan|Ethiopic|Georgian|Glagolitic|Gothic|Grantha|Greek|Gujarati|Gurmukhi|Han|Hangul|Hanunoo|Hatran|Hebrew|Hiragana|Imperial_Aramaic|Inherited|Inscriptional_Pahlavi|Inscriptional_Parthian|Javanese|Kaithi|Kannada|Katakana|Kayah_Li|Kharoshthi|Khmer|Khojki|Khudawadi|Lao|Latin|Lepcha|Limbu|Linear_A|Linear_B|Lisu|Lycian|Lydian|Mahajani|Malayalam|Mandaic|Manichaean|Meetei_Mayek|Mende_Kikakui|Meroitic_Cursive|Meroitic_Hieroglyphs|Miao|Modi|Mongolian|Mro|Multani|Myanmar|Nabataean|New_Tai_Lue|Nko|Ogham|Ol_Chiki|Old_Hungarian|Old_Italic|Old_North_Arabian|Old_Permic|Old_Persian|Old_South_Arabian|Old_Turkic|Oriya|Osmanya|Pahawh_Hmong|Palmyrene|Pau_Cin_Hau|Phags_Pa|Phoenician|Psalter_Pahlavi|Rejang|Runic|Samaritan|Saurashtra|Sharada|Shavian|Siddham|SignWriting|Sinhala|Sora_Sompeng|Sundanese|Syloti_Nagri|Syriac|Tagalog|Tagbanwa|Tai_Le|Tai_Tham|Tai_Viet|Takri|Tamil|Telugu|Thaana|Thai|Tibetan|Tifinagh|Tirhuta|Ugaritic|Vai|Warang_Citi|Yi)\}"> |
| 37 |
<!-- Escaped Characters --> |
| 38 |
<!ENTITY escape8 "\\(?:Q.*\\E|c[a-zA-Z])"> |
| 39 |
<!-- Reserved characters --> |
| 40 |
<!ENTITY escape9 "\\[\ssSdDwWbBAZcCtrnaefvxhGHKNQRVXpPz\d]"> |
| 41 |
<!-- Punctuation Characters --> |
| 42 |
<!ENTITY escape10 "\\[[:punct:]]"> |
| 43 |
<!ENTITY escape11 "\\[\041-\057\072-\100\133-\140\173-\176]"> |
| 44 |
|
| 45 |
<!-- References & Option Settings --> |
| 46 |
<!ENTITY group_bracket1 "\?(?:&|P[>\=])\w+(?=\))"> |
| 47 |
<!ENTITY group_bracket2 "\?(?:xx|[iJmnsUxR]|C\d*|C"[^\s"]*"|[\-\+]?\d+)(?=\))"> |
| 48 |
<!-- Conditional Patterns --> |
| 49 |
<!ENTITY group_bracket3 "\?\((?:Rn?|R&\w+|[\+\-]?\d+|<\w+>|'\w+'|VERSION>?\=\d+(?:\.\d+)*|\w+)\)"> |
| 50 |
<!ENTITY group_bracket4 "\?(?=\()"> |
| 51 |
|
| 52 |
<!ENTITY mls_level_range_ident "&identifierWithArg;(?:\s*\:\s*&identifierWithArg;(?:\s*,\s*&identifierWithArg;)*)?"> |
| 53 |
]> |
| 54 |
|
| 55 |
<!-- |
| 56 |
SELinux Security Policies Syntax Highlighting Definition |
| 57 |
=========================================================================== |
| 58 |
|
| 59 |
This file is part of the KDE's KSyntaxHighlighting framework. |
| 60 |
|
| 61 |
SPDX-FileCopyrightText: 2018-2020 Nibaldo González S. <[email protected]> |
| 62 |
|
| 63 |
SPDX-License-Identifier: MIT |
| 64 |
|
| 65 |
=========================================================================== |
| 66 |
|
| 67 |
Last update: checkpolicy 3.0 |
| 68 |
Obtained from the SELinux checkpolicy parser: |
| 69 |
https://github.com/SELinuxProject/selinux/blob/master/checkpolicy/policy_parse.y |
| 70 |
https://github.com/SELinuxProject/selinux/blob/master/checkpolicy/policy_scan.l |
| 71 |
More details: |
| 72 |
https://selinuxproject.org/page/PolicyLanguage#Kernel_Policy_Language |
| 73 |
https://selinuxproject.org/page/Category:Notebook |
| 74 |
|
| 75 |
NOTE: |
| 76 |
- This file is required by "selinux-cil.xml" and "selinux-fc.xml". |
| 77 |
- This file depends on "m4.xml" and "apparmor.xml" (used only to include keywords). |
| 78 |
- About file extensions: Only the most relevant policy build files and config. files |
| 79 |
are highlighted by default, since some have very generic names. Files with |
| 80 |
definition of file contexts are highlighted by "selinux-fc.xml". |
| 81 |
|
| 82 |
Change log: |
| 83 |
* Version 5 [30-Sep-2020]: Use include-keywods and other minor changes. |
| 84 |
* Version 4 [09-Feb-2020]: Use non-capturing groups in RegExpr. |
| 85 |
* Version 3 [10-Dec-2019]: |
| 86 |
- Add "glblub" keyword (default_range). |
| 87 |
- Update permissions list. |
| 88 |
* Version 2 [09-Sep-2018]: |
| 89 |
- Update itemData's style for the new Solarized color schemes. |
| 90 |
* Version 1 [28-Aug-2018, by Nibaldo González]: |
| 91 |
- Initial version. Syntax based on checkpolicy v2.8. |
| 92 |
--> |
| 93 |
|
| 94 |
<language name="SELinux Policy" |
| 95 |
version="9" |
| 96 |
kateversion="5.53" |
| 97 |
section="Sources" |
| 98 |
extensions="*.te;*.if;*.spt;policy.conf;access_vectors;mls;mcs;mls_macros;te_macros;policy_capabilities;seapp_contexts;port_contexts" |
| 99 |
priority="6" |
| 100 |
mimetype="" |
| 101 |
author="Nibaldo González ([email protected])" |
| 102 |
license="MIT"> |
| 103 |
|
| 104 |
<highlighting> |
| 105 |
|
| 106 |
<list name="self"> |
| 107 |
<item>SELF</item> |
| 108 |
<item>self</item> |
| 109 |
</list> |
| 110 |
<list name="booleans"> |
| 111 |
<item>FALSE</item> |
| 112 |
<item>false</item> |
| 113 |
<item>TRUE</item> |
| 114 |
<item>true</item> |
| 115 |
</list> |
| 116 |
|
| 117 |
<!-- Statements --> |
| 118 |
<list name="statements_access"> |
| 119 |
<item>ALLOW</item> |
| 120 |
<item>allow</item> |
| 121 |
<item>NEVERALLOW</item> |
| 122 |
<item>neverallow</item> |
| 123 |
<item>AUDITALLOW</item> |
| 124 |
<item>auditallow</item> |
| 125 |
<item>AUDITDENY</item> |
| 126 |
<item>auditdeny</item> |
| 127 |
<item>DONTAUDIT</item> |
| 128 |
<item>dontaudit</item> |
| 129 |
<item>ALLOWXPERM</item> |
| 130 |
<item>allowxperm</item> |
| 131 |
<item>AUDITALLOWXPERM</item> |
| 132 |
<item>auditallowxperm</item> |
| 133 |
<item>DONTAUDITXPERM</item> |
| 134 |
<item>dontauditxperm</item> |
| 135 |
<item>NEVERALLOWXPERM</item> |
| 136 |
<item>neverallowxperm</item> |
| 137 |
</list> |
| 138 |
<list name="statements"> |
| 139 |
<item>ATTRIBUTE</item> |
| 140 |
<item>attribute</item> |
| 141 |
<item>ATTRIBUTE_ROLE</item> |
| 142 |
<item>attribute_role</item> |
| 143 |
<item>BOOL</item> |
| 144 |
<item>bool</item> |
| 145 |
<item>CATEGORY</item> |
| 146 |
<item>category</item> |
| 147 |
<item>COMMON</item> |
| 148 |
<item>common</item> |
| 149 |
<item>DOMINANCE</item> |
| 150 |
<item>dominance</item> |
| 151 |
<item>EXPANDATTRIBUTE</item> |
| 152 |
<item>expandattribute</item> |
| 153 |
<item>MODULE</item> |
| 154 |
<item>module</item> |
| 155 |
<item>PERMISSIVE</item> |
| 156 |
<item>permissive</item> |
| 157 |
<item>ROLE</item> |
| 158 |
<item>role</item> |
| 159 |
<item>ROLEATTRIBUTE</item> |
| 160 |
<item>roleattribute</item> |
| 161 |
<item>SENSITIVITY</item> |
| 162 |
<item>sensitivity</item> |
| 163 |
<item>TUNABLE</item> |
| 164 |
<item>tunable</item> |
| 165 |
<item>TYPE</item> |
| 166 |
<item>type</item> |
| 167 |
<item>TYPEALIAS</item> |
| 168 |
<item>typealias</item> |
| 169 |
<item>TYPEATTRIBUTE</item> |
| 170 |
<item>typeattribute</item> |
| 171 |
<item>TYPEBOUNDS</item> |
| 172 |
<item>typebounds</item> |
| 173 |
<item>USER</item> |
| 174 |
<item>user</item> |
| 175 |
<!-- Conditional --> |
| 176 |
<item>IF</item> |
| 177 |
<item>if</item> |
| 178 |
<item>ELSE</item> |
| 179 |
<item>else</item> |
| 180 |
<item>require</item> |
| 181 |
<item>REQUIRE</item> |
| 182 |
<item>optional</item> |
| 183 |
<item>OPTIONAL</item> |
| 184 |
</list> |
| 185 |
<!-- Statements that contain definition of file contexts --> |
| 186 |
<list name="statements_fc"> |
| 187 |
<item>DEVICETREECON</item> |
| 188 |
<item>devicetreecon</item> |
| 189 |
<item>FS_USE_TASK</item> |
| 190 |
<item>fs_use_task</item> |
| 191 |
<item>FS_USE_TRANS</item> |
| 192 |
<item>fs_use_trans</item> |
| 193 |
<item>FS_USE_XATTR</item> |
| 194 |
<item>fs_use_xattr</item> |
| 195 |
<item>FSCON</item> |
| 196 |
<item>fscon</item> |
| 197 |
<item>GENFSCON</item> |
| 198 |
<item>genfscon</item> |
| 199 |
<item>IBENDPORTCON</item> |
| 200 |
<item>ibendportcon</item> |
| 201 |
<item>IBPKEYCON</item> |
| 202 |
<item>ibpkeycon</item> |
| 203 |
<item>IOMEMCON</item> |
| 204 |
<item>iomemcon</item> |
| 205 |
<item>IOPORTCON</item> |
| 206 |
<item>ioportcon</item> |
| 207 |
<item>NETIFCON</item> |
| 208 |
<item>netifcon</item> |
| 209 |
<item>NODECON</item> |
| 210 |
<item>nodecon</item> |
| 211 |
<item>PCIDEVICECON</item> |
| 212 |
<item>pcidevicecon</item> |
| 213 |
<item>PIRQCON</item> |
| 214 |
<item>pirqcon</item> |
| 215 |
<item>PORTCON</item> |
| 216 |
<item>portcon</item> |
| 217 |
<item>SID</item> |
| 218 |
<item>sid</item> |
| 219 |
</list> |
| 220 |
<list name="statements_def"> |
| 221 |
<item>CLASS</item> |
| 222 |
<item>class</item> |
| 223 |
</list> |
| 224 |
<list name="statements_mls_level_def"> |
| 225 |
<item>LEVEL</item> |
| 226 |
<item>level</item> |
| 227 |
</list> |
| 228 |
<!-- Statements with special contexts --> |
| 229 |
<list name="statements_policycap"> |
| 230 |
<item>POLICYCAP</item> |
| 231 |
<item>policycap</item> |
| 232 |
</list> |
| 233 |
<list name="statements_type"> |
| 234 |
<item>TYPE_CHANGE</item> |
| 235 |
<item>type_change</item> |
| 236 |
<item>TYPE_MEMBER</item> |
| 237 |
<item>type_member</item> |
| 238 |
<item>TYPE_TRANSITION</item> |
| 239 |
<item>type_transition</item> |
| 240 |
</list> |
| 241 |
<list name="statements_role_transition"> |
| 242 |
<item>ROLE_TRANSITION</item> |
| 243 |
<item>role_transition</item> |
| 244 |
</list> |
| 245 |
<list name="statements_range_transition"> |
| 246 |
<item>RANGE_TRANSITION</item> |
| 247 |
<item>range_transition</item> |
| 248 |
</list> |
| 249 |
<list name="statements_default"> |
| 250 |
<item>DEFAULT_USER</item> |
| 251 |
<item>default_user</item> |
| 252 |
<item>DEFAULT_ROLE</item> |
| 253 |
<item>default_role</item> |
| 254 |
<item>DEFAULT_TYPE</item> |
| 255 |
<item>default_type</item> |
| 256 |
</list> |
| 257 |
<list name="statements_default_range"> |
| 258 |
<item>DEFAULT_RANGE</item> |
| 259 |
<item>default_range</item> |
| 260 |
</list> |
| 261 |
<list name="statements_cexpr"> |
| 262 |
<item>CONSTRAIN</item> |
| 263 |
<item>constrain</item> |
| 264 |
<item>VALIDATETRANS</item> |
| 265 |
<item>validatetrans</item> |
| 266 |
<item>MLSCONSTRAIN</item> |
| 267 |
<item>mlsconstrain</item> |
| 268 |
<item>MLSVALIDATETRANS</item> |
| 269 |
<item>mlsvalidatetrans</item> |
| 270 |
</list> |
| 271 |
|
| 272 |
<!-- Other reserved keywords --> |
| 273 |
<list name="keywords"> |
| 274 |
<item>ALIAS</item> |
| 275 |
<item>alias</item> |
| 276 |
<item>CLONE</item> <!-- Deprecated --> |
| 277 |
<item>clone</item> |
| 278 |
<item>INHERITS</item> |
| 279 |
<item>inherits</item> |
| 280 |
<item>ROLES</item> |
| 281 |
<item>roles</item> |
| 282 |
<item>TYPES</item> |
| 283 |
<item>types</item> |
| 284 |
</list> |
| 285 |
<list name="mls_range_def"> |
| 286 |
<item>RANGE</item> |
| 287 |
<item>range</item> |
| 288 |
</list> |
| 289 |
|
| 290 |
<list name="source_target"> |
| 291 |
<item>SOURCE</item> |
| 292 |
<item>source</item> |
| 293 |
<item>TARGET</item> |
| 294 |
<item>target</item> |
| 295 |
</list> |
| 296 |
<list name="sameuser"> |
| 297 |
<item>SAMEUSER</item> |
| 298 |
<item>sameuser</item> |
| 299 |
</list> |
| 300 |
<list name="range"> |
| 301 |
<item>low-high</item> |
| 302 |
<item>LOW-HIGH</item> |
| 303 |
<item>high</item> |
| 304 |
<item>HIGH</item> |
| 305 |
<item>low</item> |
| 306 |
<item>LOW</item> |
| 307 |
<item>glblub</item> |
| 308 |
<item>GLBLUB</item> |
| 309 |
</list> |
| 310 |
|
| 311 |
<list name="cond_operators"> |
| 312 |
<item>OR</item> |
| 313 |
<item>or</item> |
| 314 |
<item>AND</item> |
| 315 |
<item>and</item> |
| 316 |
<item>NOT</item> |
| 317 |
<item>not</item> |
| 318 |
<item>xor</item> |
| 319 |
<item>XOR</item> |
| 320 |
<item>eq</item> |
| 321 |
<item>EQ</item> |
| 322 |
</list> |
| 323 |
<list name="cexpr_operators"> |
| 324 |
<item>eq</item> |
| 325 |
<item>EQ</item> |
| 326 |
<item>dom</item> |
| 327 |
<item>DOM</item> |
| 328 |
<item>domby</item> |
| 329 |
<item>DOMBY</item> |
| 330 |
<item>INCOMP</item> |
| 331 |
<item>incomp</item> |
| 332 |
</list> |
| 333 |
<list name="cexpr_keywords"> |
| 334 |
<item>r1</item> |
| 335 |
<item>R1</item> |
| 336 |
<item>r2</item> |
| 337 |
<item>R2</item> |
| 338 |
<item>r3</item> |
| 339 |
<item>R3</item> |
| 340 |
<item>u1</item> |
| 341 |
<item>U1</item> |
| 342 |
<item>u2</item> |
| 343 |
<item>U2</item> |
| 344 |
<item>u3</item> |
| 345 |
<item>U3</item> |
| 346 |
<item>t1</item> |
| 347 |
<item>T1</item> |
| 348 |
<item>t2</item> |
| 349 |
<item>T2</item> |
| 350 |
<item>t3</item> |
| 351 |
<item>T3</item> |
| 352 |
<item>l1</item> |
| 353 |
<item>L1</item> |
| 354 |
<item>l2</item> |
| 355 |
<item>L2</item> |
| 356 |
<item>h1</item> |
| 357 |
<item>H1</item> |
| 358 |
<item>h2</item> |
| 359 |
<item>H2</item> |
| 360 |
</list> |
| 361 |
|
| 362 |
<!-- Policy Capabilities: /sys/fs/selinux/policy_capabilities/ |
| 363 |
More details: https://selinuxproject.org/page/NB_LSM#SELinux_Filesystem --> |
| 364 |
<list name="policy_capabilities"> |
| 365 |
<item>always_check_network</item> |
| 366 |
<item>always_use_network</item> |
| 367 |
<item>cgroup_seclabel</item> |
| 368 |
<item>extended_socket_class</item> |
| 369 |
<item>network_peer_controls</item> |
| 370 |
<item>nnp_nosuid_transition</item> |
| 371 |
<item>open_perms</item> |
| 372 |
<item>redhat1</item> |
| 373 |
</list> |
| 374 |
|
| 375 |
<!-- Access Vectors Permissions. |
| 376 |
More details: |
| 377 |
https://selinuxproject.org/page/ObjectClassesPerms |
| 378 |
Permissions & Classes: |
| 379 |
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/security/selinux/include/classmap.h |
| 380 |
https://github.com/SELinuxProject/refpolicy/blob/master/policy/flask/access_vectors --> |
| 381 |
<list name="av_permissions"> |
| 382 |
<item>accept</item> |
| 383 |
<item>acceptfrom</item> |
| 384 |
<item>access</item> |
| 385 |
<item>acquire_svc</item> |
| 386 |
<item>add</item> |
| 387 |
<item>add_child</item> |
| 388 |
<item>add_color</item> |
| 389 |
<item>add_glyph</item> |
| 390 |
<item>add_name</item> |
| 391 |
<item>admin</item> |
| 392 |
<item>append</item> |
| 393 |
<item>associate</item> |
| 394 |
<item>association</item> |
| 395 |
<item>attach_queue</item> |
| 396 |
<item>audit_access</item> |
| 397 |
<item>audit_control</item> |
| 398 |
<item>audit_read</item> |
| 399 |
<item>audit_write</item> |
| 400 |
<item>bell</item> |
| 401 |
<item>bind</item> |
| 402 |
<item>blend</item> |
| 403 |
<item>block_suspend</item> |
| 404 |
<item>call</item> |
| 405 |
<item>check_context</item> |
| 406 |
<item>chfn</item> |
| 407 |
<item>chown</item> |
| 408 |
<item>chsh</item> |
| 409 |
<item>compute_av</item> |
| 410 |
<item>compute_create</item> |
| 411 |
<item>compute_member</item> |
| 412 |
<item>compute_relabel</item> |
| 413 |
<item>compute_user</item> |
| 414 |
<item>connect</item> |
| 415 |
<item>connectto</item> |
| 416 |
<item>contains</item> |
| 417 |
<item>copy</item> |
| 418 |
<item>create</item> |
| 419 |
<item>create_files_as</item> |
| 420 |
<item>crontab</item> |
| 421 |
<item>dac_override</item> |
| 422 |
<item>dac_read_search</item> |
| 423 |
<item>dccp_recv</item> |
| 424 |
<item>dccp_send</item> |
| 425 |
<item>debug</item> |
| 426 |
<item>delete</item> |
| 427 |
<item>destroy</item> |
| 428 |
<item>disable</item> |
| 429 |
<item>drop</item> |
| 430 |
<item>dyntransition</item> |
| 431 |
<item>egress</item> |
| 432 |
<item>enable</item> |
| 433 |
<item>enforce_dest</item> |
| 434 |
<item>enqueue</item> |
| 435 |
<item>entrypoint</item> |
| 436 |
<item>execheap</item> |
| 437 |
<item>execmem</item> |
| 438 |
<item>execmod</item> |
| 439 |
<item>execstack</item> |
| 440 |
<item>execute</item> |
| 441 |
<item>execute_no_trans</item> |
| 442 |
<item>expand</item> |
| 443 |
<item>export</item> |
| 444 |
<item>force_cursor</item> |
| 445 |
<item>fork</item> |
| 446 |
<item>forward_in</item> |
| 447 |
<item>forward_out</item> |
| 448 |
<item>fowner</item> |
| 449 |
<item>freeze</item> |
| 450 |
<item>fsetid</item> |
| 451 |
<item>get_property</item> |
| 452 |
<item>get_value</item> |
| 453 |
<item>getattr</item> |
| 454 |
<item>getcap</item> |
| 455 |
<item>getfocus</item> |
| 456 |
<item>getgrp</item> |
| 457 |
<item>gethost</item> |
| 458 |
<item>getopt</item> |
| 459 |
<item>getpgid</item> |
| 460 |
<item>getpwd</item> |
| 461 |
<item>getrlimit</item> |
| 462 |
<item>getsched</item> |
| 463 |
<item>getserv</item> |
| 464 |
<item>getsession</item> |
| 465 |
<item>getstat</item> |
| 466 |
<item>grab</item> |
| 467 |
<item>halt</item> |
| 468 |
<item>hide</item> |
| 469 |
<item>hide_cursor</item> |
| 470 |
<item>impersonate</item> |
| 471 |
<item>implement</item> |
| 472 |
<item>import</item> |
| 473 |
<item>ingress</item> |
| 474 |
<item>insert</item> |
| 475 |
<item>install</item> |
| 476 |
<item>install_module</item> |
| 477 |
<item>ioctl</item> |
| 478 |
<item>ipc_info</item> |
| 479 |
<item>ipc_lock</item> |
| 480 |
<item>ipc_owner</item> |
| 481 |
<item>kill</item> |
| 482 |
<item>lease</item> |
| 483 |
<item>link</item> |
| 484 |
<item>linux_immutable</item> |
| 485 |
<item>list_child</item> |
| 486 |
<item>list_property</item> |
| 487 |
<item>listen</item> |
| 488 |
<item>load_module</item> |
| 489 |
<item>load_policy</item> |
| 490 |
<item>lock</item> |
| 491 |
<item>mac_admin</item> |
| 492 |
<item>mac_override</item> <!-- Unused by SELinux --> |
| 493 |
<item>manage</item> |
| 494 |
<item>manage_subnet</item> |
| 495 |
<item>map</item> |
| 496 |
<item>map_create</item> |
| 497 |
<item>map_read</item> |
| 498 |
<item>map_write</item> |
| 499 |
<item>mknod</item> |
| 500 |
<item>mmap_zero</item> |
| 501 |
<item>module_load</item> |
| 502 |
<item>module_request</item> |
| 503 |
<item>mount</item> |
| 504 |
<item>mounton</item> |
| 505 |
<item>name_bind</item> |
| 506 |
<item>name_connect</item> |
| 507 |
<item>net_admin</item> |
| 508 |
<item>net_bind_service</item> |
| 509 |
<item>net_broadcast</item> |
| 510 |
<item>net_raw</item> |
| 511 |
<item>newconn</item> |
| 512 |
<item>next_value</item> |
| 513 |
<item>nlmsg_read</item> |
| 514 |
<item>nlmsg_readpriv</item> |
| 515 |
<item>nlmsg_relay</item> |
| 516 |
<item>nlmsg_tty_audit</item> |
| 517 |
<item>nlmsg_write</item> |
| 518 |
<item>nnp_transition</item> |
| 519 |
<item>noatsecure</item> |
| 520 |
<item>node_bind</item> |
| 521 |
<item>nosuid_transition</item> |
| 522 |
<item>open</item> |
| 523 |
<item>override</item> |
| 524 |
<item>passwd</item> |
| 525 |
<item>paste</item> |
| 526 |
<item>paste_after_confirm</item> |
| 527 |
<item>polmatch</item> |
| 528 |
<item>prog_load</item> |
| 529 |
<item>prog_run</item> |
| 530 |
<item>ptrace</item> |
| 531 |
<item>query</item> |
| 532 |
<item>quotaget</item> |
| 533 |
<item>quotamod</item> |
| 534 |
<item>quotaon</item> |
| 535 |
<item>rawip_recv</item> |
| 536 |
<item>rawip_send</item> |
| 537 |
<item>read</item> |
| 538 |
<item>read_policy</item> |
| 539 |
<item>reboot</item> |
| 540 |
<item>receive</item> |
| 541 |
<item>record</item> |
| 542 |
<item>recv</item> |
| 543 |
<item>recv_msg</item> |
| 544 |
<item>recvfrom</item> |
| 545 |
<item>relabelfrom</item> |
| 546 |
<item>relabelto</item> |
| 547 |
<item>reload</item> |
| 548 |
<item>remount</item> |
| 549 |
<item>remove</item> |
| 550 |
<item>remove_child</item> |
| 551 |
<item>remove_color</item> |
| 552 |
<item>remove_glyph</item> |
| 553 |
<item>remove_name</item> |
| 554 |
<item>rename</item> |
| 555 |
<item>reparent</item> |
| 556 |
<item>rlimitinh</item> |
| 557 |
<item>rmdir</item> |
| 558 |
<item>rootok</item> |
| 559 |
<item>saver_getattr</item> |
| 560 |
<item>saver_hide</item> |
| 561 |
<item>saver_setattr</item> |
| 562 |
<item>saver_show</item> |
| 563 |
<item>search</item> |
| 564 |
<item>select</item> |
| 565 |
<item>send</item> |
| 566 |
<item>send_msg</item> |
| 567 |
<item>sendto</item> |
| 568 |
<item>set_context_mgr</item> |
| 569 |
<item>set_property</item> |
| 570 |
<item>set_value</item> |
| 571 |
<item>setattr</item> |
| 572 |
<item>setbool</item> |
| 573 |
<item>setcap</item> |
| 574 |
<item>setcheckreqprot</item> |
| 575 |
<item>setcontext</item> |
| 576 |
<item>setcurrent</item> |
| 577 |
<item>setenforce</item> |
| 578 |
<item>setexec</item> |
| 579 |
<item>setfcap</item> |
| 580 |
<item>setfocus</item> |
| 581 |
<item>setfscreate</item> |
| 582 |
<item>setgid</item> |
| 583 |
<item>setkeycreate</item> |
| 584 |
<item>setopt</item> |
| 585 |
<item>setpcap</item> |
| 586 |
<item>setpgid</item> |
| 587 |
<item>setrlimit</item> |
| 588 |
<item>setsched</item> |
| 589 |
<item>setsecparam</item> |
| 590 |
<item>setsockcreate</item> |
| 591 |
<item>setuid</item> |
| 592 |
<item>share</item> |
| 593 |
<item>shmemgrp</item> |
| 594 |
<item>shmemhost</item> |
| 595 |
<item>shmempwd</item> |
| 596 |
<item>shmemserv</item> |
| 597 |
<item>show</item> |
| 598 |
<item>show_cursor</item> |
| 599 |
<item>shutdown</item> |
| 600 |
<item>sigchld</item> |
| 601 |
<item>siginh</item> |
| 602 |
<item>sigkill</item> |
| 603 |
<item>signal</item> |
| 604 |
<item>signull</item> |
| 605 |
<item>sigstop</item> |
| 606 |
<item>start</item> |
| 607 |
<item>status</item> |
| 608 |
<item>stop</item> |
| 609 |
<item>swapon</item> |
| 610 |
<item>sys_admin</item> |
| 611 |
<item>sys_boot</item> |
| 612 |
<item>sys_chroot</item> |
| 613 |
<item>sys_module</item> |
| 614 |
<item>sys_nice</item> |
| 615 |
<item>sys_pacct</item> |
| 616 |
<item>sys_ptrace</item> |
| 617 |
<item>sys_rawio</item> |
| 618 |
<item>sys_resource</item> |
| 619 |
<item>sys_time</item> |
| 620 |
<item>sys_tty_config</item> |
| 621 |
<item>syslog</item> |
| 622 |
<item>syslog_console</item> |
| 623 |
<item>syslog_mod</item> |
| 624 |
<item>syslog_read</item> |
| 625 |
<item>tcp_recv</item> |
| 626 |
<item>tcp_send</item> |
| 627 |
<item>transfer</item> |
| 628 |
<item>transition</item> |
| 629 |
<item>udp_recv</item> |
| 630 |
<item>udp_send</item> |
| 631 |
<item>uninstall</item> |
| 632 |
<item>unix_read</item> |
| 633 |
<item>unix_write</item> |
| 634 |
<item>unlink</item> |
| 635 |
<item>unmount</item> |
| 636 |
<item>unused_perm</item> |
| 637 |
<item>update</item> |
| 638 |
<item>use</item> |
| 639 |
<item>use_as_override</item> |
| 640 |
<item>validate_trans</item> |
| 641 |
<item>view</item> |
| 642 |
<item>wake_alarm</item> |
| 643 |
<item>watch</item> |
| 644 |
<item>watch_mount</item> |
| 645 |
<item>watch_reads</item> |
| 646 |
<item>watch_sb</item> |
| 647 |
<item>watch_with_perm</item> |
| 648 |
<item>write</item> |
| 649 |
<!-- Deprecated: flow_in, flow_out, get_param, set_param --> |
| 650 |
</list> |
| 651 |
|
| 652 |
<!-- Additional AV Permissions for Android. |
| 653 |
Permissions & Classes: |
| 654 |
https://android.googlesource.com/platform/system/sepolicy/+/master/private/access_vectors |
| 655 |
https://android.googlesource.com/platform/system/security/+/master/keystore/permissions.cpp |
| 656 |
More details: |
| 657 |
https://selinuxproject.org/page/NB_SEforAndroid_1#Android_Classes_and_Permissions --> |
| 658 |
<list name="av_permissions_android"> |
| 659 |
<item>add_auth</item> |
| 660 |
<item>clear_uid</item> |
| 661 |
<item>closeDecryptSession</item> |
| 662 |
<item>consumeRights</item> |
| 663 |
<item>decrypt</item> |
| 664 |
<item>duplicate</item> |
| 665 |
<item>exist</item> |
| 666 |
<item>finalizeDecryptUnit</item> |
| 667 |
<item>find</item> |
| 668 |
<item>gen_unique_id</item> |
| 669 |
<item>get</item> |
| 670 |
<item>get_state</item> |
| 671 |
<item>grant</item> |
| 672 |
<item>initializeDecryptUnit</item> |
| 673 |
<item>is_empty</item> |
| 674 |
<item>list</item> |
| 675 |
<item>openDecryptSession</item> |
| 676 |
<item>password</item> |
| 677 |
<item>pread</item> |
| 678 |
<item>reset</item> |
| 679 |
<item>set</item> |
| 680 |
<item>setPlaybackStatus</item> |
| 681 |
<item>sign</item> |
| 682 |
<item>unlock</item> |
| 683 |
<item>user_changed</item> |
| 684 |
<item>verify</item> |
| 685 |
</list> |
| 686 |
|
| 687 |
<!-- FS & VFS Types --> |
| 688 |
<list name="filesystem"> |
| 689 |
<include>rule_mount_fstypes##AppArmor Security Profile</include> |
| 690 |
</list> |
| 691 |
|
| 692 |
<!-- Keywords/Functions provided by SELinux Reference Policy --> |
| 693 |
<list name="refpolicy_keywords"> |
| 694 |
<item>policy_module</item> |
| 695 |
<item>gen_require</item> |
| 696 |
<item>template</item> |
| 697 |
<item>interface</item> |
| 698 |
<item>optional_policy</item> |
| 699 |
<item>gen_tunable</item> |
| 700 |
<item>tunable_policy</item> |
| 701 |
<item>gen_user</item> |
| 702 |
<item>gen_context</item> |
| 703 |
<item>gen_bool</item> |
| 704 |
<item>gen_cats</item> |
| 705 |
<item>gen_sens</item> |
| 706 |
<item>gen_levels</item> |
| 707 |
<item>mls_systemlow</item> |
| 708 |
<item>mls_systemhigh</item> |
| 709 |
<item>mcs_systemlow</item> |
| 710 |
<item>mcs_systemhigh</item> |
| 711 |
<item>mcs_allcats</item> |
| 712 |
<item>ifndef</item> |
| 713 |
</list> |
| 714 |
|
| 715 |
<!-- M4 Built-in Keywords (obtained from "m4.xml") --> |
| 716 |
<list name="m4_builtin"> |
| 717 |
<include>builtins##GNU M4</include> |
| 718 |
<include>m4_builtins##GNU M4</include> |
| 719 |
</list> |
| 720 |
<list name="m4_builtin_regexp"> |
| 721 |
<item>regexp</item> |
| 722 |
<item>patsubst</item> |
| 723 |
<item>m4_regexp</item> |
| 724 |
<item>m4_patsubst</item> |
| 725 |
</list> |
| 726 |
|
| 727 |
<contexts> |
| 728 |
|
| 729 |
<context name="_normal" attribute="Normal Text" lineEndContext="#stay"> |
| 730 |
<IncludeRules context="_m4_preprocessor"/> |
| 731 |
<IncludeRules context="_find_all_comments"/> |
| 732 |
<IncludeRules context="_m4_special_arguments"/> |
| 733 |
|
| 734 |
<!-- Content Quoted (M4). |
| 735 |
NOTE: The default quotes (`text') are highlighted, |
| 736 |
but another type of quotation mark can be used. --> |
| 737 |
<IncludeRules context="_m4_string_simple"/> <!-- `simple text' --> |
| 738 |
<IncludeRules context="_m4_quotes"/> <!-- &m4Quotes; --> |
| 739 |
|
| 740 |
<DetectChar context="_quoted" attribute="Text Quoted" char="""/> |
| 741 |
<DetectChar context="_path" attribute="Path" char="/"/> |
| 742 |
<RegExpr context="_input_sel" attribute="Input Selector" String="\b&identifier;(?=\s*\=\s*[^\s\=,;\}\)\]#!\^:])"/> |
| 743 |
|
| 744 |
<!-- Keywords & Statements --> |
| 745 |
<keyword context="#stay" attribute="Booleans" String="booleans"/> |
| 746 |
<keyword context="#stay" attribute="Special Keys" String="self"/> |
| 747 |
<keyword context="_statement_policycap" attribute="Policy Config. Statements" String="statements_policycap"/> |
| 748 |
<!-- Highlight class --> |
| 749 |
<keyword context="_statement_find_class" attribute="Access Keys" String="statements_access"/> |
| 750 |
<keyword context="_statement_find_class" attribute="Statements" String="statements_type"/> |
| 751 |
<keyword context="_statement_find_class" attribute="Statements" String="statements_role_transition"/> |
| 752 |
<!-- Special contexts in statements --> |
| 753 |
<keyword context="_statement_range_transition" attribute="Statements" String="statements_range_transition"/> |
| 754 |
<keyword context="_statement_default" attribute="Statements" String="statements_default"/> |
| 755 |
<keyword context="_statement_default_range" attribute="Statements" String="statements_default_range"/> |
| 756 |
<keyword context="_statement_cexpr" attribute="Statements" String="statements_cexpr"/> |
| 757 |
<!-- Detect identifier after statement --> |
| 758 |
<keyword context="_find_identifier" attribute="Statements" String="statements_def"/> |
| 759 |
<keyword context="_find_mls_level" attribute="Statements" String="statements_mls_level_def"/> |
| 760 |
<keyword context="_find_mls_level_range" attribute="Statements" String="mls_range_def"/> |
| 761 |
|
| 762 |
<keyword context="#stay" attribute="Statements" String="statements"/> |
| 763 |
<keyword context="#stay" attribute="Statements" String="statements_fc"/> |
| 764 |
<keyword context="#stay" attribute="Statements" String="keywords"/> |
| 765 |
<keyword context="#stay" attribute="Expression Keys" String="cond_operators"/> |
| 766 |
|
| 767 |
<!-- Keywords/Functions of M4 & Reference Policy --> |
| 768 |
<WordDetect context="_function_gen_context" attribute="Refpolicy Keywords" String="gen_context"/> |
| 769 |
<keyword context="#stay" attribute="Refpolicy Keywords" String="refpolicy_keywords"/> |
| 770 |
<IncludeRules context="_m4_builtin_keywords"/> |
| 771 |
<RegExpr context="#stay" attribute="Function" String="\b&identifier;(?=\()"/> |
| 772 |
|
| 773 |
<!-- IP Addresses --> |
| 774 |
<IncludeRules context="_ip_addr"/> |
| 775 |
|
| 776 |
<!-- Keywords: Access Vectors Permissions & Filesystem --> |
| 777 |
<IncludeRules context="_av_permissions"/> |
| 778 |
<keyword context="#stay" attribute="Filesystem" String="filesystem"/> |
| 779 |
|
| 780 |
<!-- Boolean Operators --> |
| 781 |
<Detect2Chars context="#stay" attribute="Boolean Operators" char="=" char1="="/> |
| 782 |
<Detect2Chars context="#stay" attribute="Boolean Operators" char="!" char1="="/> |
| 783 |
<Detect2Chars context="#stay" attribute="Boolean Operators" char="&" char1="&"/> |
| 784 |
<Detect2Chars context="#stay" attribute="Boolean Operators" char="|" char1="|"/> |
| 785 |
<AnyChar context="#stay" attribute="Boolean Operators" String="!^"/> |
| 786 |
|
| 787 |
<!-- Symbols/Operators --> |
| 788 |
<DetectChar context="#stay" attribute="Operator" char="{" beginRegion="Bracket"/> |
| 789 |
<DetectChar context="#stay" attribute="Operator" char="}" endRegion="Bracket"/> |
| 790 |
<DetectChar context="#stay" char="(" beginRegion="ParenthesesBlock"/> |
| 791 |
<DetectChar context="#stay" char=")" endRegion="ParenthesesBlock"/> |
| 792 |
|
| 793 |
<Detect2Chars context="#stay" attribute="Operator" char="-" char1=">"/> |
| 794 |
<AnyChar context="#stay" attribute="Operator" String="~[]"/> |
| 795 |
<AnyChar context="#stay" attribute="Symbol" String=",;:-"/> |
| 796 |
|
| 797 |
<IncludeRules context="_common_special_char"/> |
| 798 |
<IncludeRules context="_line_continue_escape"/> |
| 799 |
|
| 800 |
<!-- File Contexts --> |
| 801 |
<RegExpr context="_file_contexts" attribute="File Contexts" String="\b&identifierWithArg;(?:\:&identifierWithArg;){2}(?:\:&mlsLevel;(?:\s*\-\s*&mlsLevel;)?)?\b" lookAhead="true"/> |
| 802 |
|
| 803 |
<!-- This avoids highlighting numbers in identifiers --> |
| 804 |
<RegExpr context="#stay" String="&identifier;"/> |
| 805 |
<!-- Numbers --> |
| 806 |
<RegExpr context="#stay" attribute="Number" String="\b&versionIdentifier;"/> |
| 807 |
<HlCHex context="#stay" attribute="Hexadecimal"/> |
| 808 |
<Float context="#stay" attribute="Number"/> |
| 809 |
<Int context="#stay" attribute="Number"/> |
| 810 |
|
| 811 |
<RegExpr context="#stay" attribute="Reserved Keywords" String="(?:\s|^)\-[bcdpls\-](?=\s|$)"/> |
| 812 |
<DetectChar context="#stay" attribute="Symbol" char="."/> |
| 813 |
</context> |
| 814 |
|
| 815 |
<!-- Statements --> |
| 816 |
|
| 817 |
<!-- Highlight class after ":", in some statements --> |
| 818 |
<context name="_statement_find_class" attribute="Normal Text" lineEndContext="#stay"> |
| 819 |
<DetectChar context="#pop!_class" attribute="Symbol" char=":"/> |
| 820 |
<DetectChar context="#pop" attribute="Symbol" char=";" lookAhead="true"/> <!-- End rule --> |
| 821 |
<IncludeRules context="_normal"/> |
| 822 |
</context> |
| 823 |
<context name="_class" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 824 |
<!-- Class --> |
| 825 |
<RegExpr context="#pop" attribute="Class" String="\s*&identifier;(?=[^:\w\-\.,]|$)"/> |
| 826 |
</context> |
| 827 |
|
| 828 |
<!-- Special keywords in some statements --> |
| 829 |
<context name="_statement_default" attribute="Normal Text" lineEndContext="#stay"> |
| 830 |
<keyword context="#stay" attribute="Reserved Keywords" String="source_target"/> |
| 831 |
<DetectChar context="#pop" attribute="Symbol" char=";" lookAhead="true"/> |
| 832 |
<IncludeRules context="_normal"/> |
| 833 |
</context> |
| 834 |
<context name="_statement_default_range" attribute="Normal Text" lineEndContext="#stay"> |
| 835 |
<keyword context="#stay" attribute="Range" String="range"/> |
| 836 |
<IncludeRules context="_statement_default"/> |
| 837 |
</context> |
| 838 |
<context name="_statement_cexpr" attribute="Normal Text" lineEndContext="#stay"> |
| 839 |
<keyword context="#stay" attribute="Expression Keys" String="cexpr_operators"/> |
| 840 |
<keyword context="#stay" attribute="Special Keys" String="cexpr_keywords"/> |
| 841 |
<keyword context="#stay" attribute="Reserved Keywords" String="source_target"/> |
| 842 |
<keyword context="#stay" attribute="Reserved Keywords" String="sameuser"/> |
| 843 |
<DetectChar context="#pop" attribute="Symbol" char=";" lookAhead="true"/> |
| 844 |
<IncludeRules context="_normal"/> |
| 845 |
</context> |
| 846 |
<context name="_statement_policycap" attribute="Normal Text" lineEndContext="#stay"> |
| 847 |
<keyword context="#stay" attribute="Policy Capability" String="policy_capabilities"/> |
| 848 |
<DetectChar context="#pop" attribute="Symbol" char=";" lookAhead="true"/> |
| 849 |
<IncludeRules context="_normal"/> |
| 850 |
</context> |
| 851 |
|
| 852 |
<!-- RANGE_TRANSITION: Highlight level/range and fix class after ":" --> |
| 853 |
<context name="_statement_range_transition" attribute="Normal Text" lineEndContext="#stay"> |
| 854 |
<DetectChar context="#pop" attribute="Symbol" char=";" lookAhead="true"/> |
| 855 |
<RegExpr context="_class_range_transition_statement" String="&identifierWithArg;\s*:\s*&identifierWithArg;\s+[a-zA-Z\$]" lookAhead="true"/> |
| 856 |
|
| 857 |
<RegExpr context="#pop!_mls_level_range" String="&mls_level_range_ident;\s+\-\s+&identifierWithArg;|&mls_level_range_ident;(?:\s*\-\s*&mls_level_range_ident;)?(?=\s*;)" lookAhead="true" minimal="1"/> |
| 858 |
<IncludeRules context="_normal"/> |
| 859 |
</context> |
| 860 |
<context name="_class_range_transition_statement" attribute="Normal Text" lineEndContext="#pop"> |
| 861 |
<DetectChar context="#pop!_class" attribute="Symbol" char=":"/> |
| 862 |
<IncludeRules context="_m4_special_arguments"/> |
| 863 |
<keyword context="#stay" attribute="Special Keys" String="self"/> |
| 864 |
</context> |
| 865 |
|
| 866 |
<!-- Detect identifier (highlight it as "Normal Text") --> |
| 867 |
<context name="_find_identifier" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 868 |
<IncludeRules context="_default_find_identifier"/> |
| 869 |
<RegExpr context="#pop" attribute="Normal Text" String="&identifier;"/> |
| 870 |
</context> |
| 871 |
<context name="_default_find_identifier" attribute="Normal Text" lineEndContext="#stay"> |
| 872 |
<DetectSpaces context="#stay"/> |
| 873 |
<IncludeRules context="_m4_preprocessor"/> |
| 874 |
<IncludeRules context="_find_all_comments"/> |
| 875 |
<RegExpr context="#pop" attribute="Function" String="\b&identifier;(?=\()" lookAhead="true"/> |
| 876 |
</context> |
| 877 |
|
| 878 |
<!-- Detect MLS/MCS Level (s0.s1:c0,c1) --> |
| 879 |
<context name="_find_mls_level" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 880 |
<IncludeRules context="_default_find_identifier"/> |
| 881 |
<RegExpr context="#pop!_mls_level" String="&identifierWithArg;" lookAhead="true" minimal="1"/> |
| 882 |
</context> |
| 883 |
<!-- Detect MLS/MCS Range (s0:c0 - s1:c1) --> |
| 884 |
<context name="_find_mls_level_range" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 885 |
<IncludeRules context="_default_find_identifier"/> |
| 886 |
<RegExpr context="#pop!_mls_level_range" String="&identifierWithArg;" lookAhead="true" minimal="1"/> |
| 887 |
</context> |
| 888 |
<!-- MLS/MCS Range: Sensitivity:Category - Sensitivity:Category --> |
| 889 |
<context name="_mls_level_range" attribute="MLS/MCS Level/Range" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 890 |
<RegExpr context="#pop!_mls_level_range_cat" attribute="Symbol" String=":(?=&identifierWithArg;)"/> <!-- Find Category --> |
| 891 |
<RegExpr context="#pop!_mls_level" attribute="Symbol" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range --> |
| 892 |
<RegExpr context="#stay" attribute="Symbol" String="\.(?=&identifierWithArg;)"/> |
| 893 |
<IncludeRules context="_default_mls_level"/> |
| 894 |
</context> |
| 895 |
<context name="_mls_level_range_cat" attribute="MLS/MCS Level/Range" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 896 |
<RegExpr context="#pop!_mls_level" attribute="Symbol" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range --> |
| 897 |
<RegExpr context="#stay" attribute="Symbol" String="(?:\.|\s*,\s*)(?=&identifierWithArg;)"/> |
| 898 |
<IncludeRules context="_default_mls_level"/> |
| 899 |
</context> |
| 900 |
<!-- MLS/MCS Level: Sensitivity:Category --> |
| 901 |
<context name="_mls_level" attribute="MLS/MCS Level/Range" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 902 |
<RegExpr context="#pop!_mls_level_cat" attribute="Symbol" String=":(?=&identifierWithArg;)"/> <!-- Find Category --> |
| 903 |
<RegExpr context="#stay" attribute="Symbol" String="\.(?=&identifierWithArg;)"/> |
| 904 |
<IncludeRules context="_default_mls_level"/> |
| 905 |
</context> |
| 906 |
<context name="_mls_level_cat" attribute="MLS/MCS Level/Range" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 907 |
<RegExpr context="#stay" attribute="Symbol" String="(?:\.|\s*,\s*)(?=&identifierWithArg;)"/> |
| 908 |
<IncludeRules context="_default_mls_level"/> |
| 909 |
</context> |
| 910 |
<context name="_default_mls_level" attribute="MLS/MCS Level/Range" lineEndContext="#pop"> |
| 911 |
<RegExpr context="#stay" attribute="MLS/MCS Level/Range" String="\w+"/> |
| 912 |
<DetectChar context="#stay" attribute="MLS/MCS Level/Range" char="-"/> |
| 913 |
<IncludeRules context="_m4_special_arguments"/> |
| 914 |
</context> |
| 915 |
|
| 916 |
<!-- Double Quotes String (does not support line breaks and line continuation escape) --> |
| 917 |
<context name="_quoted" attribute="Text Quoted" |
| 918 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_filename_quoted"> |
| 919 |
<RegExpr context="#pop!_path_quoted" attribute="Text Quoted" String="[^"/]*/" lookAhead="true"/> <!-- Find path --> |
| 920 |
</context> |
| 921 |
<context name="_filename_quoted" attribute="Text Quoted" lineEndContext="#pop"> |
| 922 |
<DetectChar context="#pop" attribute="Text Quoted" char="""/> |
| 923 |
<IncludeRules context="_m4_special_arguments"/> |
| 924 |
<RegExpr context="#stay" attribute="Text Quoted Open" String="[^\s"\\](?=\s*$)"/> |
| 925 |
</context> |
| 926 |
<context name="_path_quoted" attribute="Text Quoted" lineEndContext="#pop"> |
| 927 |
<DetectChar context="#pop" attribute="Text Quoted" char="""/> |
| 928 |
<!-- Quote escaped is not allowed? (see line 260-261 in "selinux/checkpolicy/policy_scan.l") --> |
| 929 |
<IncludeRules context="_m4_special_arguments"/> |
| 930 |
<IncludeRules context="_regex_quoted"/> |
| 931 |
<RegExpr context="#stay" attribute="Text Quoted Open" String="[^\s"\[\(\\](?=\s*$)"/> |
| 932 |
</context> |
| 933 |
|
| 934 |
<!-- Path --> |
| 935 |
<context name="_path" attribute="Path" lineEndContext="#pop"> |
| 936 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 937 |
<IncludeRules context="_m4_special_arguments"/> |
| 938 |
<IncludeRules context="_regex"/> |
| 939 |
</context> |
| 940 |
|
| 941 |
<!-- Input Selectors: selector=value |
| 942 |
NOTE: "seapp_contexts" in the Android policy use this. --> |
| 943 |
<context name="_input_sel" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 944 |
<DetectSpaces context="#stay"/> |
| 945 |
<DetectChar context="#stay" attribute="Symbol" char="="/> |
| 946 |
<keyword context="#pop" attribute="Booleans" String="booleans"/> |
| 947 |
<keyword context="#pop" attribute="Special Keys" String="self"/> |
| 948 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 949 |
<RegExpr context="#pop" attribute="Normal Text" String="&identifier;(?=[,;]?(?:\s|$))"/> |
| 950 |
<!-- Find RegExp --> |
| 951 |
<AnyChar context="#pop!_path" String="[(" lookAhead="true"/> |
| 952 |
<RegExpr context="#pop!_path" String="[^\=\s"\{\}\[\]\(\);#]+[\{\[\(\*\+\?]|[^\=\s"\{\}\[\]\(\);#\d]+\." lookAhead="true"/> |
| 953 |
</context> |
| 954 |
|
| 955 |
<!-- Special functions of Refpolicy --> |
| 956 |
<context name="_function_gen_context" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 957 |
<DetectChar context="#pop!_function_gen_context_find_fc" attribute="Normal Text" char="(" beginRegion="ParenthesesBlock"/> |
| 958 |
</context> |
| 959 |
<context name="_function_gen_context_find_fc" attribute="File Contexts" |
| 960 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_function_gen_context_content"> |
| 961 |
<RegExpr context="_file_contexts" String="&identifierWithArg;(?:\:&identifierWithArg;){2}\b" lookAhead="true"/> |
| 962 |
<DetectSpaces context="#stay"/> |
| 963 |
</context> |
| 964 |
<context name="_function_gen_context_content" attribute="File Contexts" lineEndContext="#pop"> |
| 965 |
<DetectChar context="#pop" attribute="Normal Text" char=")" endRegion="ParenthesesBlock"/> |
| 966 |
<AnyChar context="#stay" attribute="Normal Text" String=".:-"/> |
| 967 |
<AnyChar context="#stay" attribute="Symbol" String=",;"/> |
| 968 |
<IncludeRules context="_m4_special_arguments"/> |
| 969 |
<IncludeRules context="_find_all_comments"/> |
| 970 |
<IncludeRules context="_common_special_char"/> |
| 971 |
<IncludeRules context="_line_continue_escape"/> |
| 972 |
</context> |
| 973 |
|
| 974 |
<!-- File Contexts. |
| 975 |
NOTE: File contexts with spaces before and after each ":" are not highlighted. --> |
| 976 |
<!-- user:role:type --> |
| 977 |
<context name="_file_contexts" attribute="File Contexts" lineEndContext="#pop"> |
| 978 |
<DetectChar context="#pop!_fc_role" attribute="Symbol" char=":"/> |
| 979 |
<IncludeRules context="_m4_special_arguments"/> |
| 980 |
</context> |
| 981 |
<context name="_fc_role" attribute="File Contexts" lineEndContext="#pop"> |
| 982 |
<DetectChar context="#pop!_fc_type" attribute="Symbol" char=":"/> |
| 983 |
<IncludeRules context="_m4_special_arguments"/> |
| 984 |
</context> |
| 985 |
<context name="_fc_type" attribute="File Contexts (Type Enforcement)" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_after_fc"> |
| 986 |
<RegExpr context="#pop!_fc_level_range" attribute="Symbol" String=":(?=&mlsLevel;)"/> <!-- Find Level/Range --> |
| 987 |
<RegExpr context="#stay" attribute="File Contexts (Type Enforcement)" String="\.?[\w\-]+|\.(?=\$)"/> |
| 988 |
<IncludeRules context="_m4_special_arguments"/> |
| 989 |
</context> |
| 990 |
<!-- (MLS/MCS) user:role:type:level --> |
| 991 |
<context name="_fc_level_range" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_after_fc"> |
| 992 |
<RegExpr context="#pop!_fc_level_range_cat" attribute="Symbol" String=":(?=&identifierWithArg;)"/> <!-- Find Category --> |
| 993 |
<RegExpr context="#pop!_fc_level" attribute="Symbol" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range --> |
| 994 |
<RegExpr context="#stay" attribute="Symbol" String="\.(?=&identifierWithArg;)"/> |
| 995 |
<IncludeRules context="_default_fc_level"/> |
| 996 |
</context> |
| 997 |
<context name="_fc_level_range_cat" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_after_fc"> |
| 998 |
<RegExpr context="#pop!_fc_level" attribute="Symbol" String="\s*\-\s*(?=&mlsLevel;)"/> <!-- Find Range --> |
| 999 |
<RegExpr context="#stay" attribute="Symbol" String="(?:\.|\s*,\s*)(?=&identifierWithArg;)"/> |
| 1000 |
<IncludeRules context="_default_fc_level"/> |
| 1001 |
</context> |
| 1002 |
<!-- (MLS/MCS) user:role:type:level-level --> |
| 1003 |
<context name="_fc_level" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_after_fc"> |
| 1004 |
<RegExpr context="#pop!_fc_level_cat" attribute="Symbol" String=":(?=&identifierWithArg;)"/> <!-- Find Category --> |
| 1005 |
<RegExpr context="#stay" attribute="Symbol" String="\.(?=&identifierWithArg;)"/> |
| 1006 |
<IncludeRules context="_default_fc_level"/> |
| 1007 |
</context> |
| 1008 |
<context name="_fc_level_cat" attribute="File Contexts" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_after_fc"> |
| 1009 |
<RegExpr context="#stay" attribute="Symbol" String="(?:\.|\s*,\s*)(?=&identifierWithArg;)"/> |
| 1010 |
<IncludeRules context="_default_fc_level"/> |
| 1011 |
</context> |
| 1012 |
<context name="_default_fc_level" attribute="File Contexts" lineEndContext="#pop"> |
| 1013 |
<RegExpr context="#stay" attribute="File Contexts" String="\w+"/> |
| 1014 |
<DetectChar context="#stay" attribute="File Contexts" char="-"/> |
| 1015 |
<IncludeRules context="_m4_special_arguments"/> |
| 1016 |
</context> |
| 1017 |
|
| 1018 |
<context name="_after_fc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1019 |
<RegExpr context="#stay" attribute="Symbol" String=":(?=&identifierWithArg;)"/> |
| 1020 |
<RegExpr context="#stay" attribute="Normal Text" String="&identifier;"/> |
| 1021 |
<IncludeRules context="_m4_special_arguments"/> |
| 1022 |
</context> |
| 1023 |
|
| 1024 |
<!-- |
| 1025 |
======================================== |
| 1026 |
Comments & Documentation |
| 1027 |
======================================== --> |
| 1028 |
|
| 1029 |
<context name="_find_comments" attribute="Normal Text" lineEndContext="#stay"> |
| 1030 |
<Detect2Chars context="_doc_comment" attribute="Documentation" char="#" char1="#"/> |
| 1031 |
<DetectChar context="_comment" attribute="Comment" char="#"/> |
| 1032 |
</context> |
| 1033 |
<context name="_find_all_comments" attribute="Normal Text" lineEndContext="#stay"> |
| 1034 |
<IncludeRules context="_find_comments"/> |
| 1035 |
<!-- For Macros --> |
| 1036 |
<RegExpr context="_comment" attribute="Comment" String="\bdnl(?!\.?[\w\-])"/> |
| 1037 |
</context> |
| 1038 |
|
| 1039 |
<context name="_comment" attribute="Comment" lineEndContext="#pop"> |
| 1040 |
<DetectSpaces /> |
| 1041 |
<LineContinue context="#pop" attribute="Comment"/> |
| 1042 |
<IncludeRules context="##Comments"/> |
| 1043 |
<IncludeRules context="_default_comment"/> |
| 1044 |
</context> |
| 1045 |
<context name="_doc_comment" attribute="Documentation" lineEndContext="#pop"> |
| 1046 |
<IncludeRules context="_find_tags"/> |
| 1047 |
<IncludeRules context="_find_entityrefs"/> |
| 1048 |
<LineContinue context="#pop" attribute="Documentation"/> |
| 1049 |
<IncludeRules context="_comment"/> |
| 1050 |
</context> |
| 1051 |
|
| 1052 |
<context name="_find_tags" attribute="Documentation" lineEndContext="#pop"> |
| 1053 |
<RegExpr context="_element_tag" attribute="Doc. Element Tag" String="<\s*&tagName;" beginRegion="DocElement"/> |
| 1054 |
<RegExpr context="#stay" attribute="Doc. Element Tag" String="</\s*&tagName;\s*>" endRegion="DocElement"/> |
| 1055 |
</context> |
| 1056 |
<context name="_find_entityrefs" attribute="Documentation" lineEndContext="#pop"> |
| 1057 |
<RegExpr context="#stay" attribute="Doc. EntityRef" String="&(?:#[0-9]+|#[xX][0-9A-Fa-f]+|[a-zA-Z_](?:[\w\-]*\w)?);"/> |
| 1058 |
</context> |
| 1059 |
|
| 1060 |
<context name="_element_tag" attribute="Documentation" lineEndContext="#pop"> |
| 1061 |
<Detect2Chars context="#pop" attribute="Doc. Element Tag" char="/" char1=">" endRegion="DocElement"/> |
| 1062 |
<DetectChar context="#pop" attribute="Doc. Element Tag" char=">"/> |
| 1063 |
<RegExpr context="_attribute" attribute="Doc. Attribute" String="\s&tagName;"/> |
| 1064 |
<RegExpr context="#pop" attribute="Error" String="\S"/> |
| 1065 |
</context> |
| 1066 |
<context name="_attribute" attribute="Documentation" lineEndContext="#pop"> |
| 1067 |
<DetectChar context="#pop!_value" attribute="Documentation" char="="/> |
| 1068 |
<RegExpr context="#stay" attribute="Doc. Attribute" String="\s&tagName;"/> |
| 1069 |
<RegExpr context="#pop" attribute="Error" String="\S"/> |
| 1070 |
</context> |
| 1071 |
<context name="_value" attribute="Documentation" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1072 |
<RegExpr context="#pop!_value_dq" attribute="Doc. Value" String="\s*""/> |
| 1073 |
<RegExpr context="#pop!_value_sq" attribute="Doc. Value" String="\s*'"/> |
| 1074 |
<RegExpr context="#stay" attribute="Error" String="\s*\S+"/> |
| 1075 |
</context> |
| 1076 |
<context name="_value_dq" attribute="Doc. Value" lineEndContext="#pop"> |
| 1077 |
<RegExpr context="#pop" attribute="Error" String="\S(?=\s*$)"/> |
| 1078 |
<DetectChar context="#pop" attribute="Doc. Value" char="""/> |
| 1079 |
<IncludeRules context="_find_entityrefs"/> |
| 1080 |
</context> |
| 1081 |
<context name="_value_sq" attribute="Doc. Value" lineEndContext="#pop"> |
| 1082 |
<RegExpr context="#pop" attribute="Error" String="\S(?=\s*$)"/> |
| 1083 |
<DetectChar context="#pop" attribute="Doc. Value" char="'"/> |
| 1084 |
<IncludeRules context="_find_entityrefs"/> |
| 1085 |
</context> |
| 1086 |
|
| 1087 |
<!-- |
| 1088 |
==================================================================== |
| 1089 |
Common Rules for Syntax Highlighting of SELinux Policies |
| 1090 |
==================================================================== |
| 1091 |
NOTE: The following contexts are also used by "selinux-fc.xml" |
| 1092 |
and "selinux-cil.xml". --> |
| 1093 |
|
| 1094 |
<!-- Default Comment (only for single line comments!) --> |
| 1095 |
<context name="_default_comment" attribute="Normal Text" lineEndContext="#pop"> |
| 1096 |
<RegExpr context="#stay" attribute="URL in Comment" String="&url;|&email;"/> |
| 1097 |
</context> |
| 1098 |
|
| 1099 |
<!-- IP Addresses --> |
| 1100 |
<context name="_ip_addr" attribute="Normal Text" lineEndContext="#stay"> |
| 1101 |
<RegExpr context="#stay" attribute="IP Address" String="&ipv4;|&ipv6;"/> |
| 1102 |
<!-- NOTE: IPv6 in the SELinux parser ("selinux/checkpolicy/policy_scan.l"): "(?:[\da-fA-F]{0,4}\:){2}[\da-fA-F:\.]*" --> |
| 1103 |
</context> |
| 1104 |
|
| 1105 |
<!-- AV Permissions Keywords --> |
| 1106 |
<context name="_av_permissions" attribute="Normal Text" lineEndContext="#stay"> |
| 1107 |
<keyword context="#stay" attribute="AV Permissions" String="av_permissions"/> |
| 1108 |
<keyword context="#stay" attribute="Android AV Permissions" String="av_permissions_android"/> |
| 1109 |
</context> |
| 1110 |
|
| 1111 |
<!-- Special Characters --> |
| 1112 |
<context name="_common_special_char" attribute="Normal Text" lineEndContext="#stay"> |
| 1113 |
<DetectChar context="#stay" attribute="Special Char" char="*"/> |
| 1114 |
</context> |
| 1115 |
<!-- Line-Continuation Escape --> |
| 1116 |
<context name="_line_continue_escape" attribute="Normal Text" lineEndContext="#stay"> |
| 1117 |
<LineContinue context="#stay" attribute="Escape Char"/> |
| 1118 |
</context> |
| 1119 |
|
| 1120 |
<!-- SELinux M4 Macros --> |
| 1121 |
|
| 1122 |
<context name="_m4_special_arguments" attribute="Normal Text" lineEndContext="#stay"> |
| 1123 |
<RegExpr context="#stay" attribute="M4 Special Arguments" String="&m4Args;"/> |
| 1124 |
</context> |
| 1125 |
<context name="_m4_quotes" attribute="Normal Text" lineEndContext="#stay"> |
| 1126 |
<AnyChar context="#stay" attribute="Default M4 Quote" String="&m4Quotes;"/> |
| 1127 |
</context> |
| 1128 |
|
| 1129 |
<context name="_m4_builtin_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1130 |
<keyword context="_function_regexp" attribute="M4 Built-in Keywords" String="m4_builtin_regexp"/> |
| 1131 |
<keyword context="#stay" attribute="M4 Built-in Keywords" String="m4_builtin"/> |
| 1132 |
</context> |
| 1133 |
|
| 1134 |
<!-- #line --> |
| 1135 |
<context name="_m4_preprocessor" attribute="Normal Text" lineEndContext="#stay"> |
| 1136 |
<RegExpr context="_m4_preprocessor_line_num" attribute="M4 Preprocessor" String="#line[ ](?=\d)"/> |
| 1137 |
</context> |
| 1138 |
<context name="_m4_preprocessor_line_num" attribute="M4 Preprocessor" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1139 |
<!-- #line 1 "source" --> |
| 1140 |
<Detect2Chars context="_m4_preprocessor_line_source_file" attribute="M4 Preprocessor" char="1" char1=" "/> |
| 1141 |
<Int context="#pop" attribute="M4 Preprocessor"/> |
| 1142 |
</context> |
| 1143 |
<context name="_m4_preprocessor_line_source_file" attribute="M4 Preprocessor" |
| 1144 |
lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> |
| 1145 |
<RangeDetect context="#pop#pop" attribute="M4 Preprocessor" char=""" char1="""/> |
| 1146 |
</context> |
| 1147 |
|
| 1148 |
<!-- "regexp" function in M4 --> |
| 1149 |
<context name="_function_regexp" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1150 |
<DetectChar context="#pop!_function_regexp_content" attribute="Normal Text" char="(" beginRegion="ParenthesesBlock"/> |
| 1151 |
</context> |
| 1152 |
<context name="_function_regexp_content" attribute="Normal Text" lineEndContext="#stay"> |
| 1153 |
<DetectChar context="#pop" attribute="Normal Text" char=")" endRegion="ParenthesesBlock"/> |
| 1154 |
<DetectChar context="#stay" attribute="Normal Text" char=","/> |
| 1155 |
<!-- Default Quote: `text' --> |
| 1156 |
<RegExpr context="_simple_string_regexp" attribute="Text Quoted" String="`(?=(?:&m4Args;|[\w\-\s])*')"/> |
| 1157 |
<IncludeRules context="_m4_quotes"/> |
| 1158 |
|
| 1159 |
<IncludeRules context="_m4_special_arguments"/> |
| 1160 |
<IncludeRules context="_regex_general_otherquote"/> |
| 1161 |
<IncludeRules context="_find_all_comments"/> |
| 1162 |
</context> |
| 1163 |
<context name="_simple_string_regexp" attribute="Text Quoted" lineEndContext="#pop"> |
| 1164 |
<DetectChar context="#pop" attribute="Text Quoted" char="'"/> |
| 1165 |
<IncludeRules context="_m4_special_arguments"/> |
| 1166 |
</context> |
| 1167 |
|
| 1168 |
<!-- Highlight simple string using the default quotes: `text' --> |
| 1169 |
<context name="_m4_string_simple" attribute="Normal Text" lineEndContext="#stay"> |
| 1170 |
<DetectChar context="_find_m4_string_simple" char="`" lookAhead="true"/> |
| 1171 |
</context> |
| 1172 |
<context name="_find_m4_string_simple" attribute="Text Quoted" lineEndContext="#pop"> |
| 1173 |
<RegExpr context="#pop!_block_quoted_simple" attribute="Text Quoted" String="`(?=(?:&m4Args;|[\w\-\.\s]|\(\))*')"/> |
| 1174 |
<DetectChar context="#pop" attribute="Default M4 Quote" char="`"/> <!-- &m4Quotes; --> |
| 1175 |
</context> |
| 1176 |
<context name="_block_quoted_simple" attribute="Text Quoted" lineEndContext="#pop"> |
| 1177 |
<DetectChar context="#pop" attribute="Text Quoted" char="'"/> |
| 1178 |
<IncludeRules context="_m4_special_arguments"/> |
| 1179 |
</context> |
| 1180 |
|
| 1181 |
<!-- |
| 1182 |
================================= |
| 1183 |
PCRE2 RegExp |
| 1184 |
================================= --> |
| 1185 |
|
| 1186 |
<context name="_default_regex" attribute="Normal Text" lineEndContext="#stay"> |
| 1187 |
<IncludeRules context="_special_chars"/> |
| 1188 |
<IncludeRules context="_brackets_error"/> |
| 1189 |
<IncludeRules context="_quantification_brackets"/> |
| 1190 |
</context> |
| 1191 |
|
| 1192 |
<!-- SELinux RegExp --> |
| 1193 |
<!-- For paths: not allow spaces & line breaks --> |
| 1194 |
<context name="_regex" attribute="Normal Text" lineEndContext="#stay"> |
| 1195 |
<IncludeRules context="_default_regex"/> |
| 1196 |
<DetectChar context="_square_brackets" attribute="RegExp Brackets" char="["/> |
| 1197 |
<DetectChar context="_round_brackets" attribute="RegExp Brackets" char="("/> |
| 1198 |
</context> |
| 1199 |
<!-- For double quote string ("str"): allow spaces, but not line breaks --> |
| 1200 |
<context name="_regex_quoted" attribute="Normal Text" lineEndContext="#stay"> |
| 1201 |
<IncludeRules context="_default_regex"/> |
| 1202 |
<DetectChar context="_square_brackets_quoted" attribute="RegExp Brackets" char="["/> |
| 1203 |
<DetectChar context="_round_brackets_quoted" attribute="RegExp Brackets" char="("/> |
| 1204 |
</context> |
| 1205 |
|
| 1206 |
<!-- General RegExp: |
| 1207 |
- Allow escapes unsupported by SELinux. |
| 1208 |
- Do not end with a quote. |
| 1209 |
- Allow spaces & line breaks. |
| 1210 |
- Allow comments in round brackets. --> |
| 1211 |
<context name="_regex_general_otherquote" attribute="Normal Text" lineEndContext="#stay"> |
| 1212 |
<IncludeRules context="_line_continue_escape"/> |
| 1213 |
<IncludeRules context="_fix_escape"/> |
| 1214 |
<IncludeRules context="_default_regex"/> |
| 1215 |
<DetectChar context="_square_brackets_otherquote" attribute="RegExp Brackets" char="["/> |
| 1216 |
<DetectChar context="_round_brackets_otherquote" attribute="RegExp Brackets" char="("/> |
| 1217 |
</context> |
| 1218 |
|
| 1219 |
<context name="_special_chars" attribute="Normal Text" lineEndContext="#stay"> |
| 1220 |
<AnyChar context="#stay" attribute="Special Char" String="&specialChars;"/> |
| 1221 |
<IncludeRules context="_escape"/> |
| 1222 |
</context> |
| 1223 |
|
| 1224 |
<!-- Escapes --> |
| 1225 |
<context name="_escape" attribute="Normal Text" lineEndContext="#stay"> |
| 1226 |
<!-- Escapes Not Supported by SELinux --> |
| 1227 |
<RegExpr context="#stay" attribute="Error" String="\\(?:[LlUu]|N\{\w+\})"/> |
| 1228 |
<RegExpr context="#stay" attribute="Escape Char" String="&escape1;|&escape2;|&escape3;|&escape4;|&escape5;|&escape6;|&escape7;|&escape8;|&escape9;|&escape10;|&escape11;"/> |
| 1229 |
</context> |
| 1230 |
<context name="_fix_escape" attribute="Normal Text" lineEndContext="#stay"> |
| 1231 |
<AnyChar context="#stay" attribute="Special Char" String="^$"/> |
| 1232 |
<RegExpr context="#stay" attribute="Escape Char" String="\\(?:u[\da-fA-F]{4}|[LlUu]|N\{\w+\}|[0-7]{1,3})"/> |
| 1233 |
</context> |
| 1234 |
|
| 1235 |
<!-- Special Characters in Groups: (?...). Also see: &capGroup; --> |
| 1236 |
<context name="_special_group_round_brackets" attribute="Normal Text" lineEndContext="#stay"> |
| 1237 |
<RegExpr context="#stay" attribute="Special Char of Brackets" String="&group_bracket1;|&group_bracket2;|&group_bracket3;|&group_bracket4;"/> |
| 1238 |
</context> |
| 1239 |
|
| 1240 |
<!-- {n} {min,} {,max} {min,max} --> |
| 1241 |
<context name="_quantification_brackets" attribute="Normal Text" lineEndContext="#stay"> |
| 1242 |
<RegExpr context="_quantification_brackets_content" attribute="RegExp Brackets" String="\{(?=(?:\d+(?:,\d*)?|,\d+)\})"/> |
| 1243 |
</context> |
| 1244 |
<context name="_quantification_brackets_content" attribute="RegExp Brackets Content" lineEndContext="#pop"> |
| 1245 |
<DetectChar context="#stay" attribute="Special Char of Brackets" char=","/> |
| 1246 |
<DetectChar context="#pop" attribute="RegExp Brackets" char="}"/> |
| 1247 |
</context> |
| 1248 |
|
| 1249 |
<!-- Groups: [ ] and ( ) --> |
| 1250 |
<context name="_default_square_brackets" attribute="RegExp Brackets Content" lineEndContext="#stay"> |
| 1251 |
<DetectChar context="#stay" attribute="Error" char="["/> |
| 1252 |
<IncludeRules context="_special_chars"/> |
| 1253 |
</context> |
| 1254 |
<context name="_default_round_brackets" attribute="RegExp Brackets Content" lineEndContext="#stay"> |
| 1255 |
<DetectChar context="#stay" attribute="Special Char of Brackets" char="|"/> |
| 1256 |
<IncludeRules context="_default_regex"/> |
| 1257 |
</context> |
| 1258 |
<context name="_brackets_error" attribute="Normal Text" lineEndContext="#stay"> |
| 1259 |
<Detect2Chars context="#stay" attribute="Error" char="[" char1="]"/> |
| 1260 |
</context> |
| 1261 |
|
| 1262 |
<!-- Groups Brackets in Paths (do not allow spaces and line breaks) --> |
| 1263 |
<context name="_square_brackets" attribute="RegExp Brackets Content" |
| 1264 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_square_brackets_content"> |
| 1265 |
<!-- Negative Characters --> |
| 1266 |
<RegExpr context="#pop!_square_brackets_content" attribute="Special Char of Brackets" String="\^(?=[^\s\]])"/> |
| 1267 |
</context> |
| 1268 |
<context name="_square_brackets_content" attribute="RegExp Brackets Content" lineEndContext="#pop"> |
| 1269 |
<DetectChar context="#pop" attribute="RegExp Brackets" char="]"/> |
| 1270 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 1271 |
<RegExpr context="#stay" attribute="Open RegExp Brackets" String="[^\s\[\]\\](?=\s|$)"/> |
| 1272 |
<IncludeRules context="_default_square_brackets"/> |
| 1273 |
</context> |
| 1274 |
|
| 1275 |
<context name="_round_brackets" attribute="RegExp Brackets Content" |
| 1276 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_round_brackets_content"> |
| 1277 |
<IncludeRules context="_special_group_round_brackets"/> |
| 1278 |
<RegExpr context="#pop!_round_brackets_content" attribute="Special Char of Brackets" String="&capGroup;(?=[^\)\s])"/> |
| 1279 |
<DetectChar context="#pop!_round_brackets_content" char="?"/> |
| 1280 |
</context> |
| 1281 |
<context name="_round_brackets_content" attribute="RegExp Brackets Content" lineEndContext="#pop"> |
| 1282 |
<DetectChar context="#pop" attribute="RegExp Brackets" char=")"/> |
| 1283 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 1284 |
<RegExpr context="#stay" attribute="Open RegExp Brackets" String="[^\s\[\(\)\\](?=\s|$)"/> |
| 1285 |
<IncludeRules context="_default_round_brackets"/> |
| 1286 |
<DetectChar context="_square_brackets" attribute="RegExp Brackets" char="["/> |
| 1287 |
<DetectChar context="_round_brackets" attribute="RegExp Brackets" char="("/> |
| 1288 |
</context> |
| 1289 |
|
| 1290 |
<!-- Groups Brackets in Double Quoted Strings (allow spaces, but not line breaks) --> |
| 1291 |
<context name="_square_brackets_quoted" attribute="RegExp Brackets Content" |
| 1292 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_square_brackets_quoted_content"> |
| 1293 |
<RegExpr context="#pop!_square_brackets_quoted_content" attribute="Special Char of Brackets" String="\^(?=[^\]])"/> |
| 1294 |
</context> |
| 1295 |
<context name="_square_brackets_quoted_content" attribute="RegExp Brackets Content" lineEndContext="#pop"> |
| 1296 |
<DetectChar context="#pop" attribute="RegExp Brackets" char="]"/> |
| 1297 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1298 |
<RegExpr context="#stay" attribute="Open RegExp Brackets" String="[^\s\[\]"\\](?=\s*(?:"|$))"/> |
| 1299 |
<IncludeRules context="_default_square_brackets"/> |
| 1300 |
</context> |
| 1301 |
|
| 1302 |
<context name="_round_brackets_quoted" attribute="RegExp Brackets Content" |
| 1303 |
lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_round_brackets_quoted_content"> |
| 1304 |
<IncludeRules context="_special_group_round_brackets"/> |
| 1305 |
<RegExpr context="#pop!_round_brackets_quoted_content" attribute="Special Char of Brackets" String="&capGroup;(?=[^\)])"/> |
| 1306 |
<DetectChar context="#pop!_round_brackets_quoted_content" char="?"/> |
| 1307 |
</context> |
| 1308 |
<context name="_round_brackets_quoted_content" attribute="RegExp Brackets Content" lineEndContext="#pop"> |
| 1309 |
<DetectChar context="#pop" attribute="RegExp Brackets" char=")"/> |
| 1310 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1311 |
<RegExpr context="#stay" attribute="Open RegExp Brackets" String="[^\s\[\(\)"\\](?=\s*(?:"|$))"/> |
| 1312 |
<IncludeRules context="_default_round_brackets"/> |
| 1313 |
<DetectChar context="_square_brackets_quoted" attribute="RegExp Brackets" char="["/> |
| 1314 |
<DetectChar context="_round_brackets_quoted" attribute="RegExp Brackets" char="("/> |
| 1315 |
</context> |
| 1316 |
|
| 1317 |
<!-- Groups Brackets in Unknown Quotes (allow spaces and line breaks) --> |
| 1318 |
<context name="_square_brackets_otherquote" attribute="RegExp Brackets Content" |
| 1319 |
lineEndContext="#pop!_square_brackets_otherquote_content" fallthrough="true" fallthroughContext="#pop!_square_brackets_otherquote_content"> |
| 1320 |
<RegExpr context="#pop!_square_brackets_otherquote_content" attribute="Special Char of Brackets" String="\^(?=[^\]]|$)"/> |
| 1321 |
</context> |
| 1322 |
<context name="_square_brackets_otherquote_content" attribute="RegExp Brackets Content" lineEndContext="#stay"> |
| 1323 |
<DetectChar context="#pop" attribute="RegExp Brackets" char="]"/> |
| 1324 |
<IncludeRules context="_default_square_brackets"/> |
| 1325 |
</context> |
| 1326 |
|
| 1327 |
<context name="_round_brackets_otherquote" attribute="RegExp Brackets Content" |
| 1328 |
lineEndContext="#pop!_round_brackets_otherquote_content" fallthrough="true" fallthroughContext="#pop!_round_brackets_otherquote_content"> |
| 1329 |
<IncludeRules context="_special_group_round_brackets"/> |
| 1330 |
<RegExpr context="#pop!_round_brackets_otherquote_content" attribute="Special Char of Brackets" String="&capGroup;(?=[^\)]|$)"/> |
| 1331 |
<DetectChar context="#pop!_round_brackets_otherquote_content" char="?"/> |
| 1332 |
</context> |
| 1333 |
<context name="_round_brackets_otherquote_content" attribute="RegExp Brackets Content" lineEndContext="#stay"> |
| 1334 |
<DetectChar context="#pop" attribute="RegExp Brackets" char=")"/> |
| 1335 |
<IncludeRules context="_fix_escape"/> |
| 1336 |
<IncludeRules context="_default_round_brackets"/> |
| 1337 |
<IncludeRules context="_line_continue_escape"/> |
| 1338 |
<DetectChar context="_square_brackets_otherquote" attribute="RegExp Brackets" char="["/> |
| 1339 |
<DetectChar context="_round_brackets_otherquote" attribute="RegExp Brackets" char="("/> |
| 1340 |
<RegExpr context="_comment" attribute="Comment" String="(?:^|\s)\#"/> |
| 1341 |
</context> |
| 1342 |
|
| 1343 |
</contexts> |
| 1344 |
|
| 1345 |
<itemDatas> |
| 1346 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 1347 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 1348 |
<itemData name="URL in Comment" defStyleNum="dsComment" underline="1" spellChecking="false"/> |
| 1349 |
<itemData name="Path" defStyleNum="dsNormal" spellChecking="false"/> |
| 1350 |
<itemData name="Text Quoted" defStyleNum="dsString" spellChecking="false"/> |
| 1351 |
|
| 1352 |
<itemData name="IP Address" defStyleNum="dsFloat" spellChecking="false"/> |
| 1353 |
<itemData name="AV Permissions" defStyleNum="dsVerbatimString" spellChecking="false"/> |
| 1354 |
<itemData name="Android AV Permissions" defStyleNum="dsVerbatimString" italic="1" spellChecking="false"/> |
| 1355 |
<itemData name="Policy Capability" defStyleNum="dsPreprocessor" bold="0" italic="0" underline="0" spellChecking="false"/> |
| 1356 |
<itemData name="Filesystem" defStyleNum="dsNormal" italic="1" spellChecking="false"/> |
| 1357 |
|
| 1358 |
<itemData name="Statements" defStyleNum="dsKeyword" bold="1" spellChecking="false"/> |
| 1359 |
<itemData name="Policy Config. Statements" defStyleNum="dsPreprocessor" bold="1" italic="0" underline="0" spellChecking="false"/> |
| 1360 |
<itemData name="Access Keys" defStyleNum="dsWarning" bold="1" italic="0" underline="0" spellChecking="false"/> |
| 1361 |
<itemData name="Expression Keys" defStyleNum="dsVariable" bold="1" italic="0" underline="0" spellChecking="false"/> |
| 1362 |
<itemData name="Boolean Operators" defStyleNum="dsVariable" bold="1" italic="0" underline="0" spellChecking="false"/> |
| 1363 |
<itemData name="Special Keys" defStyleNum="dsOthers" spellChecking="false"/> |
| 1364 |
<itemData name="Reserved Keywords" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1365 |
|
| 1366 |
<itemData name="Booleans" defStyleNum="dsExtension" bold="1" underline="0" spellChecking="false"/> |
| 1367 |
<itemData name="Range" defStyleNum="dsDecVal" bold="1" spellChecking="false"/> |
| 1368 |
<itemData name="Class" defStyleNum="dsDataType" bold="0" underline="0" spellChecking="false"/> |
| 1369 |
<itemData name="MLS/MCS Level/Range" defStyleNum="dsDocumentation" bold="0" italic="0" underline="0" spellChecking="false"/> |
| 1370 |
<itemData name="File Contexts" defStyleNum="dsPreprocessor" bold="0" italic="0" underline="0" spellChecking="false"/> |
| 1371 |
<itemData name="File Contexts (Type Enforcement)" defStyleNum="dsChar" bold="0" italic="0" underline="0" spellChecking="false"/> |
| 1372 |
<itemData name="Input Selector" defStyleNum="dsAttribute" spellChecking="false"/> |
| 1373 |
<itemData name="Operator" defStyleNum="dsKeyword" spellChecking="false"/> |
| 1374 |
<itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/> |
| 1375 |
<itemData name="Number" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1376 |
<itemData name="Hexadecimal" defStyleNum="dsBaseN" spellChecking="false"/> |
| 1377 |
|
| 1378 |
<!-- Documentation --> |
| 1379 |
<itemData name="Documentation" defStyleNum="dsComment"/> |
| 1380 |
<itemData name="Doc. Element Tag" defStyleNum="dsAnnotation" bold="1" spellChecking="false"/> |
| 1381 |
<itemData name="Doc. EntityRef" defStyleNum="dsInformation" spellChecking="false"/> |
| 1382 |
<itemData name="Doc. Attribute" defStyleNum="dsAttribute" spellChecking="false"/> |
| 1383 |
<itemData name="Doc. Value" defStyleNum="dsString" spellChecking="false"/> |
| 1384 |
|
| 1385 |
<!-- Reference Policy --> |
| 1386 |
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> |
| 1387 |
<itemData name="Refpolicy Keywords" defStyleNum="dsFunction" italic="1" spellChecking="false"/> |
| 1388 |
<!-- M4 Macros --> |
| 1389 |
<itemData name="M4 Built-in Keywords" defStyleNum="dsBuiltIn" spellChecking="false"/> |
| 1390 |
<itemData name="M4 Special Arguments" defStyleNum="dsVariable" spellChecking="false"/> |
| 1391 |
<itemData name="M4 Preprocessor" defStyleNum="dsPreprocessor" spellChecking="false"/> |
| 1392 |
<itemData name="Default M4 Quote" defStyleNum="dsString" bold="1" spellChecking="false"/> |
| 1393 |
|
| 1394 |
<!-- RegExp --> |
| 1395 |
<itemData name="Escape Char" defStyleNum="dsChar" spellChecking="false"/> |
| 1396 |
<itemData name="Special Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 1397 |
<itemData name="Special Char of Brackets" defStyleNum="dsAnnotation" bold="0" italic="0" underline="0" spellChecking="false"/> |
| 1398 |
<itemData name="RegExp Brackets" defStyleNum="dsSpecialString" spellChecking="false"/> |
| 1399 |
<itemData name="RegExp Brackets Content" defStyleNum="dsSpecialString" spellChecking="false"/> |
| 1400 |
<itemData name="Open RegExp Brackets" defStyleNum="dsSpecialString" underline="1" spellChecking="false"/> |
| 1401 |
<itemData name="Text Quoted Open" defStyleNum="dsString" underline="1" spellChecking="false"/> |
| 1402 |
|
| 1403 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 1404 |
</itemDatas> |
| 1405 |
|
| 1406 |
</highlighting> |
| 1407 |
|
| 1408 |
<general> |
| 1409 |
<keywords casesensitive="true" additionalDeliminator=""'`" weakDeliminator="-"/> |
| 1410 |
<comments> |
| 1411 |
<comment name="singleLine" start="#"/> |
| 1412 |
</comments> |
| 1413 |
</general> |
| 1414 |
|
| 1415 |
</language> |
| 1416 |
<!-- kate: replace-tabs off; tab-width 3; indent-width 3; remove-trailing-spaces mod; dynamic-word-wrap off; --> |