-
Notifications
You must be signed in to change notification settings - Fork 0
/
apparmor.xml
1640 lines (1533 loc) · 75.8 KB
/
apparmor.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY varName "[A-Za-z]\w*">
<!ENTITY variable "@\{&varName;\}">
<!ENTITY exec "[pPcC]?[iuU]?x">
<!ENTITY globbChars "*?">
<!-- Characters not allowed in a path -->
<!ENTITY noPathChar "\s\)"">
<!ENTITY noPathCharWithoutSpace ")"">
<!ENTITY endPath ",(?:[\s"]|$)">
<!ENTITY url "\bhttps?://[^\s<>"'`]*[^\s<>"'`\}\)\]\.,;\|]">
<!-- Email (Source: http://emailregex.com) -->
<!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">
<!-- Access Modes / File Permissions -->
<!ENTITY _perm_correction_in_p "p[iUu]?x(?:[rwakml]|p[iUu]?x)*[PcC]?[iUu]?">
<!ENTITY _perm_correction_in_P "P[iUu]?x(?:[rwakml]|P[iUu]?x)*[pcC]?[iUu]?">
<!ENTITY _perm_correction_in_c "c[iUu]?x(?:[rwakml]|c[iUu]?x)*[PpC]?[iUu]?">
<!ENTITY _perm_correction_in_C "C[iUu]?x(?:[rwakml]|C[iUu]?x)*[Ppc]?[iUu]?">
<!ENTITY _perm_correction_in_i "[PpCc]?ix(?:[rwakml]|[PpCc]?ix)*[PpCc]?[Uu]?">
<!ENTITY _perm_correction_in_u "[PpCc]?ux(?:[rwakml]|[PpCc]?ux)*[PpCc]?[iU]?">
<!ENTITY _perm_correction_in_U "[PpCc]?Ux(?:[rwakml]|[PpCc]?Ux)*[PpCc]?[iu]?">
<!ENTITY _perm_correction_in_x1 "[iuU]?x(?:[rwakml]|[iuU]?x)*[PpCc][iuU]?"> <!-- x, ix, ux or Ux followed by P, p, C or c -->
<!ENTITY _perm_correction_in_x2 "x[rwakmlx]*[iuU]"> <!-- x followed by ix, ux or Ux -->
<!ENTITY perm_correction_in "(?:^|\s)[rwakml]*(?:&_perm_correction_in_p;|&_perm_correction_in_P;|&_perm_correction_in_c;|&_perm_correction_in_C;|&_perm_correction_in_i;|&_perm_correction_in_u;|&_perm_correction_in_U;|&_perm_correction_in_x1;|&_perm_correction_in_x2;)x(?:[rwakml]|&exec;)*(?:[\s,]|$)"> <!-- x followed by ix, ux or Ux -->
]>
<!--
AppArmor Profiles Syntax Highlighting Definition
===========================================================================
This file is part of the KDE's KSyntaxHighlighting framework.
SPDX-FileCopyrightText: 2017-2021 Nibaldo González S. <nibgonz@gmail.com>
SPDX-License-Identifier: MIT
===========================================================================
Last update:
Syntax highlighting based on AppArmor 3.0.0
For more details about the syntax of AppArmor profiles, visit:
https://gitlab.com/apparmor/apparmor/wikis/Documentation
https://manpages.ubuntu.com/manpages/focal/en/man5/apparmor.d.5.html
Change log:
* Version 12 [02-Oct-2020]: (AppArmor 3.0) Add ABI rules and new profile flags.
* Version 11 [30-Sep-2020]: Update itemData's and rule_mount_fstypes list.
* Version 10 [25-Oct-2019]: Use non-capturing groups in RegExpr.
* Version 9 [20-Jun-2019]: (AppArmor 2.13.3):
- Add new network domain keywords.
- Fixes: drop unsupported 'to' operator for link rules and only highlight the 'in'
operator in mount rules. Only highlight valid numbers in rlimit rules.
* Version 8 [02-Apr-2019]: (AppArmor 2.13.2)
- Do not highlight variable assignments and alias rules within profiles.
- Add keywords of "tunables/share" variables.
- Change style of "Other Option" attribute and remove one indentation.
* Version 7 [15-Sep-2018]:
- Update itemData's style for the new Solarized color schemes.
- Fixes in "_end_rule_irnc".
* Version 6 [24-Jul-2018, by Nibaldo G.]: (AppArmor 2.13.0)
- Fixes for Include rules, add 'if exists'. Fix escapes & globbing in text quoted.
- Improvements in paths that start with variables, hats, comments and variable
assignments and others. Add some abstractions & filesystems.
* Version 4 [25-Jan-2018, by Nibaldo G.]: (AppArmor 2.12.0)
- New keywords: network and mount rules, default abstractions, variables and others.
- Multiple improvements and fixes.
- Do not allow comments within rules and in variable assignment lines.
* Version 3 [24-Sep-2017, by Nibaldo G.]:
- Fix incorrect highlighting of the DBus rule 'name' keyword.
* Version 2 [29-Aug-2017, by Nibaldo G.]:
- Improvements and bug fixes.
- Each rule has its own context.
- The profile name is highlighted in the profile header and profile transition rules.
* Version 1 [22-Feb-2017, by Nibaldo González]:
- Initial version. Support for profile syntax of Apparmor 2.11.
-->
<language name="AppArmor Security Profile"
version="15"
kateversion="5.0"
section="Markup"
extensions="usr.bin.*;usr.sbin.*;bin.*;sbin.*;usr.lib.*;usr.lib64.*;usr.lib32.*;usr.libx32.*;usr.libexec.*;usr.local.bin.*;usr.local.sbin.*;usr.local.lib*;opt.*;etc.cron.*;snap.*;snap-update-ns.*;snap-confine.*"
priority="0"
mimetype=""
author="Nibaldo González (nibgonz@gmail.com)"
license="MIT">
<highlighting>
<!-- Profile Header -->
<list name="profile_head">
<item>profile</item>
<item>hat</item>
</list>
<list name="profile_options">
<item>flags</item>
<item>xattrs</item>
</list>
<list name="profile_flags">
<item>audit</item>
<item>complain</item>
<item>enforce</item>
<item>kill</item>
<item>unconfined</item>
<item>mediate_deleted</item>
<item>attach_disconnected</item>
<item>chroot_relative</item>
<!-- Others -->
<item>chroot_attach</item>
<item>chroot_no_attach</item>
<item>delegate_deleted</item>
<item>no_attach_disconnected</item>
<item>namespace_relative</item>
</list>
<!-- Rule Qualifiers -->
<list name="rule_access_qualifiers">
<item>allow</item>
<item>deny</item>
</list>
<list name="file_rule_qualifiers">
<item>owner</item>
<item>other</item>
</list>
<list name="rule_qualifiers">
<item>audit</item>
<!-- noaudit/quiet, defined, not -->
</list>
<!-- Conditional: if, else -->
<!-- Capabilities, Capability Rule.
Lowercase capability name without 'CAP_' prefix.
http://man7.org/linux/man-pages/man7/capabilities.7.html -->
<list name="rule_capability">
<item>audit_control</item>
<item>audit_read</item>
<item>audit_write</item>
<item>block_suspend</item>
<item>chown</item>
<item>dac_override</item>
<item>dac_read_search</item>
<item>fowner</item>
<item>fsetid</item>
<item>ipc_lock</item>
<item>ipc_owner</item>
<item>kill</item>
<item>lease</item>
<item>linux_immutable</item>
<item>mac_admin</item>
<item>mac_override</item>
<item>mknod</item>
<item>net_admin</item>
<item>net_bind_service</item>
<item>net_broadcast</item>
<item>net_raw</item>
<item>setgid</item>
<item>setfcap</item>
<item>setpcap</item>
<item>setuid</item>
<item>sys_admin</item>
<item>sys_boot</item>
<item>sys_chroot</item>
<item>sys_module</item>
<item>sys_nice</item>
<item>sys_pacct</item>
<item>sys_ptrace</item>
<item>sys_rawio</item>
<item>sys_resource</item>
<item>sys_time</item>
<item>sys_tty_config</item>
<item>syslog</item>
<item>wake_alarm</item>
</list>
<!-- Network Rule -->
<list name="rule_network">
<!-- Domain.
Also: unix -->
<item>inet</item>
<item>ax25</item>
<item>ipx</item>
<item>appletalk</item>
<item>netrom</item>
<item>bridge</item>
<item>atmpvc</item>
<item>x25</item>
<item>inet6</item>
<item>rose</item>
<item>netbeui</item>
<item>security</item>
<item>key</item>
<item>packet</item>
<item>ash</item>
<item>econet</item>
<item>atmsvc</item>
<item>sna</item>
<item>irda</item>
<item>pppox</item>
<item>wanpipe</item>
<item>bluetooth</item>
<item>netlink</item>
<item>rds</item>
<item>llc</item>
<item>can</item>
<item>tipc</item>
<item>iucv</item>
<item>rxrpc</item>
<item>isdn</item>
<item>phonet</item>
<item>ieee802154</item>
<item>caif</item>
<item>alg</item>
<item>nfc</item>
<item>vsock</item>
<item>mpls</item>
<item>ib</item>
<item>kcm</item>
<item>smc</item>
<item>qipcrtr</item>
<item>xdp</item>
<!-- Type.
Also: packet -->
<item>stream</item>
<item>dgram</item>
<item>seqpacket</item>
<item>rdm</item>
<item>raw</item>
<!-- Protocol -->
<item>tcp</item>
<item>udp</item>
<item>icmp</item>
</list>
<list name="rule_network_unix">
<!-- NOTE: This keyword is placed in a separate list,
to avoid conflicts with the 'unix' rule name. -->
<item>unix</item>
</list>
<!-- Mount Rule -->
<list name="rule_mount_options">
<item>fstype</item>
<item>vfstype</item>
<item>options</item>
<item>option</item>
</list>
<list name="rule_mount_flags">
<item>r</item>
<item>w</item>
<item>rw</item>
<item>ro</item>
<item>read-only</item>
<item>suid</item>
<item>nosuid</item>
<item>dev</item>
<item>nodev</item>
<item>exec</item>
<item>noexec</item>
<item>sync</item>
<item>async</item>
<item>remount</item>
<item>mand</item>
<item>nomand</item>
<item>dirsync</item>
<item>atime</item>
<item>noatime</item>
<item>diratime</item>
<item>nodiratime</item>
<item>bind</item>
<item>B</item>
<item>move</item>
<item>M</item>
<item>rbind</item>
<item>R</item>
<item>verbose</item>
<item>silent</item>
<item>loud</item>
<item>acl</item>
<item>noacl</item>
<item>unbindable</item>
<item>make-unbindable</item>
<item>runbindable</item>
<item>make-runbindable</item>
<item>private</item>
<item>make-private</item>
<item>rprivate</item>
<item>make-rprivate</item>
<item>slave</item>
<item>make-slave</item>
<item>rslave</item>
<item>make-rslave</item>
<item>shared</item>
<item>make-shared</item>
<item>rshared</item>
<item>make-rshared</item>
<item>relatime</item>
<item>norelatime</item>
<item>iversion</item>
<item>noiversion</item>
<item>strictatime</item>
<item>user</item>
<item>nouser</item>
</list>
<list name="rule_mount_fstypes">
<!-- Stackable FS -->
<item>ecryptfs</item>
<item>cryfs</item>
<item>encfs</item>
<item>overlayfs</item>
<item>unionfs</item>
<!-- Specialpurpose FS -->
<item>devtmpfs</item>
<item>ramfs</item>
<item>tmpfs</item>
<!-- Block-based, Network & Pseudo FS -->
<item>adfs</item>
<item>affs</item>
<item>afs</item>
<item>apfs</item>
<item>apparmorfs</item>
<item>autofs</item>
<item>bdev</item>
<item>bfs</item>
<item>bpf</item>
<item>btrfs</item>
<item>cachefs</item>
<item>ceph</item>
<item>cgroup2</item>
<item>cgroup</item>
<item>cifs</item>
<item>coda</item>
<item>coherent</item>
<item>configfs</item>
<item>cpuset</item>
<item>cramfs</item>
<item>debugfs</item>
<item>devfs</item>
<item>devpts</item>
<item>efs</item>
<item>exfat</item>
<item>ext2</item>
<item>ext3</item>
<item>ext4</item>
<item>f2fs</item>
<item>fatx</item>
<item>functionfs</item>
<item>fuse</item>
<item>fuseblk</item>
<item>fusectl</item>
<item>futexfs</item>
<item>gfs</item>
<item>hfs</item>
<item>hfsplus</item>
<item>hpfs</item>
<item>hugetlbfs</item>
<item>ifs</item>
<item>inotifyfs</item>
<item>iso9660</item>
<item>jffs2</item>
<item>jffs</item>
<item>jfs</item>
<item>kernfs</item>
<item>labeledfs</item>
<item>lvm2</item>
<item>minix</item>
<item>mqueue</item>
<item>msdos</item>
<item>ncpfs</item>
<item>nfs4</item>
<item>nfs</item>
<item>nilfs2</item>
<item>nilfs</item>
<item>ntfs-3g</item>
<item>ntfs</item>
<item>ocfs</item>
<item>oemfs</item>
<item>pipefs</item>
<item>proc</item>
<item>procfs</item>
<item>pstore</item>
<item>pstorefs</item>
<item>qnx4</item>
<item>qnx6</item>
<item>reiser4</item>
<item>reiserfs</item>
<item>romfs</item>
<item>rootfs</item>
<item>sdcardfs</item>
<item>securityfs</item>
<item>selinuxfs</item>
<item>shm</item>
<item>smbfs</item>
<item>sockfs</item>
<item>specfs</item>
<item>squashfs</item>
<item>swap</item>
<item>swapfs</item>
<item>sysfs</item>
<item>sysv</item>
<item>tracefs</item>
<item>ubifs</item>
<item>udf</item>
<item>ufs</item>
<item>umsdos</item>
<item>urefs</item>
<item>usbfs</item>
<item>vfat</item>
<item>xenix</item>
<item>xfs</item>
<item>yaffs2</item>
<item>yaffs</item>
<item>zfs</item>
<!-- Not included: ext, usbdevfs, xiafs -->
</list>
<!-- Pivot Root Rule -->
<list name="rule_pivotroot_options">
<item>oldroot</item>
</list>
<!-- Ptrace Rule -->
<list name="rule_ptrace_options">
<item>peer</item>
</list>
<list name="rule_ptrace_access">
<!-- Also: r, w, rw, read -->
<item>readby</item>
<item>trace</item>
<item>tracedby</item>
</list>
<!-- Signal Rule -->
<list name="rule_signal_options">
<item>set</item>
<item>peer</item>
</list>
<list name="rule_signal">
<!-- Also: rtmin+0 ... rtmin+32 -->
<item>bus</item>
<item>hup</item>
<item>int</item>
<item>quit</item>
<item>ill</item>
<item>trap</item>
<item>abrt</item>
<item>fpe</item>
<item>kill</item>
<item>usr1</item>
<item>segv</item>
<item>usr2</item>
<item>pipe</item>
<item>alrm</item>
<item>term</item>
<item>stkflt</item>
<item>chld</item>
<item>cont</item>
<item>stop</item>
<item>stp</item>
<item>ttin</item>
<item>ttou</item>
<item>urg</item>
<item>xcpu</item>
<item>xfsz</item>
<item>vtalrm</item>
<item>prof</item>
<item>winch</item>
<item>io</item>
<item>pwr</item>
<item>sys</item>
<item>emt</item>
<item>exists</item>
</list>
<list name="rule_signal_access">
<!-- Also: r, w, rw, read, write -->
<item>send</item>
<item>receive</item>
</list>
<!-- DBus Rule -->
<list name="rule_dbus_options">
<item>peer</item>
<item>bus</item>
<item>path</item>
<item>interface</item>
<item>member</item>
<item>name</item>
</list>
<list name="rule_dbus_peer">
<item>name</item>
<item>label</item>
</list>
<list name="rule_dbus_access">
<!-- Also: r, w, rw, read, write -->
<item>send</item>
<item>receive</item>
<item>bind</item>
<item>eavesdrop</item>
</list>
<list name="rule_dbus_bus">
<item>system</item>
<item>session</item>
</list>
<!-- Unix Rule -->
<list name="rule_unix_options">
<item>peer</item>
<item>set</item>
<item>label</item>
<item>type</item>
<item>protocol</item>
<item>addr</item>
<item>attr</item>
<item>opt</item>
</list>
<list name="rule_unix_access">
<!-- Also: r, w, rw, read, write -->
<item>send</item>
<item>receive</item>
<item>bind</item>
<item>create</item>
<item>listen</item>
<item>accept</item>
<item>connect</item>
<item>shutdown</item>
<item>getattr</item>
<item>setattr</item>
<item>getopt</item>
<item>setopt</item>
</list>
<!-- Rlimit Rule -->
<list name="rule_rlimit">
<item>cpu</item>
<item>fsize</item>
<item>data</item>
<item>stack</item>
<item>core</item>
<item>rss</item>
<item>nofile</item>
<item>ofile</item>
<item>as</item>
<item>nproc</item>
<item>memlock</item>
<item>locks</item>
<item>sigpending</item>
<item>msgqueue</item>
<item>nice</item>
<item>rtprio</item>
<item>rttime</item>
</list>
<!-- Link Rule -->
<list name="rule_link">
<item>subset</item>
</list>
<!-- Change Profile Rule -->
<list name="rule_changeprofile">
<item>safe</item>
<item>unsafe</item>
</list>
<!-- Include Rule -->
<list name="rule_include">
<item>if</item>
<item>exists</item>
</list>
<!-- Permissions -->
<list name="base_accesses">
<item>rw</item>
<item>r</item>
<item>w</item>
<item>read</item>
<item>write</item>
</list>
<!-- Abstractions and variables defined in the provided AppArmor policy.
NOTE: The following keywords are not used for highlighting. The purpose of these
is to provide autocomplete suggestions when writing Include rules and variables. -->
<list name="default_variables">
<item>profile_name</item> <!-- Special variable -->
<item>HOME</item>
<item>HOMEDIRS</item>
<item>multiarch</item>
<item>pid</item>
<item>pids</item>
<item>PROC</item>
<item>securityfs</item>
<item>apparmorfs</item>
<item>sys</item>
<item>tid</item>
<item>XDG_DESKTOP_DIR</item>
<item>XDG_DOWNLOAD_DIR</item>
<item>XDG_TEMPLATES_DIR</item>
<item>XDG_PUBLICSHARE_DIR</item>
<item>XDG_DOCUMENTS_DIR</item>
<item>XDG_MUSIC_DIR</item>
<item>XDG_PICTURES_DIR</item>
<item>XDG_VIDEOS_DIR</item>
<item>flatpak_exports_root</item>
<item>system_share_dirs</item>
<item>user_share_dirs</item>
</list>
<list name="default_abstractions">
<item>abstractions/</item>
<item>apache2-common</item>
<item>aspell</item>
<item>audio</item>
<item>authentication</item>
<item>base</item>
<item>bash</item>
<item>consoles</item>
<item>cups-client</item>
<item>dbus</item>
<item>dbus-accessibility</item>
<item>dbus-accessibility-strict</item>
<item>dbus-session</item>
<item>dbus-session-strict</item>
<item>dbus-strict</item>
<item>dconf</item>
<item>dovecot-common</item>
<item>dri-common</item>
<item>dri-enumerate</item>
<item>enchant</item>
<item>fcitx</item>
<item>fcitx-strict</item>
<item>fonts</item>
<item>freedesktop.org</item>
<item>gnome</item>
<item>gnupg</item>
<item>ibus</item>
<item>kde-icon-cache-write</item>
<item>kde-globals-write</item>
<item>kde-language-write</item>
<item>kde</item>
<item>kerberosclient</item>
<item>launchpad-integration</item>
<item>ldapclient</item>
<item>libpam-systemd</item>
<item>likewise</item>
<item>mdns</item>
<item>mesa</item>
<item>mir</item>
<item>mozc</item>
<item>mysql</item>
<item>nameservice</item>
<item>nis</item>
<item>nvidia</item>
<item>opencl</item>
<item>opencl-common</item>
<item>opencl-intel</item>
<item>opencl-mesa</item>
<item>opencl-nvidia</item>
<item>opencl-pocl</item>
<item>openssl</item>
<item>orbit2</item>
<item>p11-kit</item>
<item>perl</item>
<item>php</item>
<item>php5</item>
<item>postfix-common</item>
<item>private-files</item>
<item>private-files-strict</item>
<item>python</item>
<item>qt5-compose-cache-write</item>
<item>qt5-settings-write</item>
<item>qt5</item>
<item>recent-documents-write</item>
<item>ruby</item>
<item>samba</item>
<item>smbpass</item>
<item>ssl_certs</item>
<item>ssl_keys</item>
<item>svn-repositories</item>
<item>ubuntu-bittorrent-clients</item>
<item>ubuntu-browsers</item>
<item>ubuntu-console-browsers</item>
<item>ubuntu-console-email</item>
<item>ubuntu-email</item>
<item>ubuntu-feed-readers</item>
<item>ubuntu-gnome-terminal</item>
<item>ubuntu-helpers</item>
<item>ubuntu-konsole</item>
<item>ubuntu-media-players</item>
<item>ubuntu-unity7-base</item>
<item>ubuntu-unity7-launcher</item>
<item>ubuntu-unity7-messaging</item>
<item>ubuntu-xterm</item>
<item>user-download</item>
<item>user-mail</item>
<item>user-manpages</item>
<item>user-tmp</item>
<item>user-write</item>
<item>video</item>
<item>vulkan</item>
<item>wayland</item>
<item>web-data</item>
<item>winbind</item>
<item>wutmp</item>
<item>X</item>
<item>xad</item>
<item>xdg-desktop</item>
<item>ubuntu-browsers.d/</item>
<item>java</item>
<item>mailto</item>
<item>multimedia</item>
<item>plugins-common</item>
<item>productivity</item>
<item>text-editors</item>
<item>ubuntu-integration</item>
<item>ubuntu-integration-xul</item>
<item>user-files</item>
<item>apparmor_api/</item>
<item>change_profile</item>
<item>examine</item>
<item>find_mountpoint</item>
<item>introspect</item>
<item>is_enabled</item>
<item>tunables/</item>
<item>alias</item>
<item>apparmorfs</item>
<item>dovecot</item>
<item>global</item>
<item>home</item>
<item>kernelvars</item>
<item>multiarch</item>
<item>ntpd</item>
<item>proc</item>
<item>securityfs</item>
<item>sys</item>
<item>xdg-user-dirs</item>
<item>home.d/</item>
<item>multiarch.d/</item>
<item>xdg-user-dirs.d/</item>
<item>site.local</item>
<item>local/</item>
</list>
<list name="boolean">
<item>true</item>
<item>false</item>
</list>
<list name="other_words">
<item>unspec</item>
<item>none</item>
<item>unconfined</item>
</list>
<!-- Rule Names.
NOTE:
- Each rule name is a keyword in separate lists, since each
has a different context and for a correct delimitation of the words.
- The content of a rule is found in the contexts "_default_rule"
and "_default_rule_with_comments".
- When adding a new rule, add it also in "_end_rule_irnc"! -->
<list name="rule_name_mount">
<item>mount</item>
<item>remount</item>
<item>umount</item>
</list>
<list name="rule_name_abi"><item>abi</item></list>
<list name="rule_name_alias"><item>alias</item></list>
<list name="rule_name_file"><item>file</item></list>
<list name="rule_name_capability"><item>capability</item></list>
<list name="rule_name_network"><item>network</item></list>
<list name="rule_name_pivotroot"><item>pivot_root</item></list>
<list name="rule_name_ptrace"><item>ptrace</item></list>
<list name="rule_name_signal"><item>signal</item></list>
<list name="rule_name_dbus"><item>dbus</item></list>
<list name="rule_name_unix"><item>unix</item></list>
<list name="rule_name_link"><item>link</item></list>
<list name="rule_name_changeprofile"><item>change_profile</item></list>
<list name="rule_name_rlimit"><item>rlimit</item></list>
<list name="rule_name_set"><item>set</item></list>
<contexts>
<context name="_normal" attribute="Normal Text" lineEndContext="#stay">
<!-- Preamble -->
<!-- Variable Assignment.
NOTE:
- Variable assignments are not allowed within profiles (when writing assignments within
profiles, the parser shows an error because it does not allow + or = after a variable).
- [Jul 24, 2018] Variables of type "@VAR" will only be highlighted in assignments, as long
as they are not fully supported (apparently, they will be used in conditional expressions). -->
<Detect2Chars context="_variable_assignment" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/>
<RegExpr context="_variable_assignment_operator" attribute="Variable" String="@&varName;(?=\s*(?:\+?\=|$|\s#))" firstNonSpace="true"/>
<DetectChar context="_variable_assignment_line_general" attribute="Operator 1" char="=" firstNonSpace="true"/>
<Detect2Chars context="_variable_assignment_line" attribute="Operator 1" char="+" char1="=" firstNonSpace="true"/>
<!-- Alias rule -->
<keyword context="_default_rule_with_comments" attribute="Rule" String="rule_name_alias" beginRegion="Rule"/>
<!-- Profile Content (also highlight rules, for abstractions) -->
<IncludeRules context="_default_profile"/>
</context>
<!-- Profile Content, within { ... } -->
<context name="_profile" attribute="Normal Text" lineEndContext="#stay">
<DetectChar context="#pop" attribute="Operator 1" char="}" endRegion="Profile"/>
<Detect2Chars context="_variable_assignment_error" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/>
<IncludeRules context="_default_profile"/>
<WordDetect context="#stay" attribute="Error" String="alias"/> <!-- rule_name_alias -->
</context>
<context name="_default_profile" attribute="Normal Text" lineEndContext="#stay">
<!-- Profile Header -->
<keyword context="_profile_name" attribute="Profile Head" String="profile_head"/>
<RegExpr context="_profile_name" attribute="Profile Head" String="(?:^|\s)\^(?=\S)"/>
<keyword context="#stay" attribute="Option" String="profile_options"/>
<!-- Line Rules -->
<StringDetect context="_include" attribute="Preprocessor" String="#include" insensitive="true"/>
<RegExpr context="_include" attribute="Preprocessor" String="(?:^|\s)include(?=\s)"/>
<DetectChar context="_comment" attribute="Comment" char="#"/>
<!-- Variables -->
<Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/>
<Detect2Chars context="_boolean" attribute="Variable" char="$" char1="{" lookAhead="true"/>
<keyword context="#stay" attribute="Other Option" String="boolean" insensitive="true"/>
<RegExpr context="#stay" attribute="Variable" String="\$&varName;(?=[\s\(\)\{\}"@\$#\=\+]|$)"/>
<!-- Brackets -->
<IncludeRules context="_brackets_error"/> <!-- {} -->
<DetectChar context="_profile" attribute="Operator 1" char="{" beginRegion="Profile"/>
<DetectChar context="_parentheses_block_profile" attribute="Normal Text" char="("/>
<DetectChar context="_r_square_brackets" attribute="Globbing Brackets" char="["/>
<!-- Rule Qualifiers -->
<keyword context="#stay" attribute="Rule Access Qualifier" String="rule_access_qualifiers"/>
<keyword context="#stay" attribute="Rule Qualifier" String="rule_qualifiers"/>
<keyword context="#stay" attribute="File Rule Qualifier" String="file_rule_qualifiers"/>
<!-- Rules -->
<keyword context="_rule_abi" attribute="Rule" String="rule_name_abi" beginRegion="Rule"/>
<keyword context="_rule_file" attribute="Rule" String="rule_name_file" beginRegion="Rule"/>
<keyword context="_rule_mount" attribute="Rule" String="rule_name_mount" beginRegion="Rule"/>
<keyword context="_rule_capability" attribute="Rule" String="rule_name_capability" beginRegion="Rule"/>
<keyword context="_rule_network" attribute="Rule" String="rule_name_network" beginRegion="Rule"/>
<keyword context="_rule_pivotroot" attribute="Rule" String="rule_name_pivotroot" beginRegion="Rule"/>
<keyword context="_rule_ptrace" attribute="Rule" String="rule_name_ptrace" beginRegion="Rule"/>
<keyword context="_rule_signal" attribute="Rule" String="rule_name_signal" beginRegion="Rule"/>
<keyword context="_rule_dbus" attribute="Rule" String="rule_name_dbus" beginRegion="Rule"/>
<keyword context="_rule_unix" attribute="Rule" String="rule_name_unix" beginRegion="Rule"/>
<keyword context="_rule_link" attribute="Rule" String="rule_name_link" beginRegion="Rule"/>
<keyword context="_rule_changeprofile" attribute="Rule" String="rule_name_changeprofile" beginRegion="Rule"/>
<keyword context="_rule_rlimit" attribute="Rule Error" String="rule_name_rlimit" beginRegion="Rule"/> <!-- set rlimit -->
<keyword context="_rule_set" attribute="Rule" String="rule_name_set"/>
<!-- Paths, text in quotes, file permissions and others -->
<IncludeRules context="_operators"/>
<IncludeRules context="_find_path"/>
<IncludeRules context="_find_text_quoted"/>
<IncludeRules context="_file_rule_permissions"/>
<keyword context="#stay" String="default_variables"/>
</context>
<!-- Within rules and blocks of parentheses -->
<context name="_common" attribute="Normal Text" lineEndContext="#stay">
<StringDetect context="#stay" attribute="Error" String="#include" insensitive="true"/>
<RegExpr context="#stay" attribute="Error" String="include(?=\s)" firstNonSpace="true"/>
<IncludeRules context="_brackets_error"/>
<IncludeRules context="_operators"/>
<IncludeRules context="_find_text_quoted"/>
<keyword context="#stay" attribute="Other Data" String="other_words" insensitive="true"/>
<keyword context="#stay" attribute="Other Data" String="boolean" insensitive="true"/>
</context>
<!-- Comment -->
<context name="_comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<LineContinue context="#pop" attribute="Comment"/>
<IncludeRules context="##Comments"/>
<RegExpr context="#stay" attribute="URL in Comment" String="&url;|&email;"/>
</context>
<!-- Profile Header:
Highlight the name of the profile.
The profile name label is written after the hat character (^) or a profile keyword.
AppArmor 3.0 deprecates the use of pathnames as the profiles name. -->
<context name="_profile_name" attribute="Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces context="#stay" attribute="Normal Text"/>
<!-- Not highlighting paths and paths quoted.
NOTE: Some profile labels may contain "/" (like [/]). These cases are not considered. -->
<RegExpr context="#pop" attribute="Normal Text" String=""(?:[^/"\\]|\\.)*/" lookAhead="true"/>
<RegExpr context="#pop!_path_content" attribute="Path" String="(?:[^\s"\\]|\\.)*/" lookAhead="true"/>
<DetectChar context="#pop!_profile_name_quoted" attribute="Profile Name" char="""/>
<!-- First word (the profile name) -->
<RegExpr context="#pop!_profile_name_content" attribute="Normal Text" String="[^\s/\^\{]" lookAhead="true"/>
</context>
<context name="_profile_name_content" attribute="Profile Name" lineEndContext="#pop">
<!-- NOTE: "(" generates errors when calling "get_profiles()" (apparmor_status). This forces to put a space before. -->
<RegExpr context="#pop" attribute="Error" String="\(\S*\)?"/>
<!-- End of the profile name label -->
<DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/>
<!-- The quote ends the profile name, but it is ideal to put a space before -->
<DetectChar context="#pop" attribute="Normal Text" char=""" lookAhead="true"/>
<RegExpr context="#stay" attribute="Profile Name Error" String="[^\s\(\\](?=["\(])"/>
<StringDetect context="#pop" attribute="Error" String="#include" insensitive="true"/>
<IncludeRules context="_variable_simple"/>
<IncludeRules context="_escape"/>
</context>
<context name="_profile_name_quoted" attribute="Profile Name" lineEndContext="#stay">
<DetectChar context="#pop" attribute="Profile Name" char="""/>
<IncludeRules context="_variable_simple"/>
<IncludeRules context="_escape"/>
</context>
<!-- Include Rule: include <abstraction/path> -->
<context name="_include" attribute="Preprocessor" lineEndContext="#pop">
<Detect2Chars context="#pop" attribute="Error" char=""" char1="""/>
<Detect2Chars context="#pop" attribute="Error" char="<" char1=">"/>
<RegExpr context="#stay" attribute="Error" String="<+(?=[<\s])"/>
<RegExpr context="#pop!_include_preplib_thanquot" attribute="Prep. Lib" String="<\s*(?=")"/> <!-- <"path"> -->
<DetectChar context="#pop!_include_preplib_than" attribute="Prep. Lib" char="<" lookAhead="true"/> <!-- <magic/path> -->
<DetectChar context="#pop!_include_preplib_quot" attribute="Prep. Lib" char="""/> <!-- "/abs/path" -->
<keyword context="#stay" attribute="Preprocessor" String="rule_include"/>
<RegExpr context="#pop" attribute="Prep. Lib" String="[^\s/"<>]*/\S*(?=\s|$)"/> <!-- /abs/path -->
</context>
<context name="_include_preplib_than" attribute="Prep. Lib" lineEndContext="#pop">
<DetectChar context="#pop" attribute="Prep. Lib" char=">"/>
<keyword context="#stay" attribute="Prep. Lib" String="default_abstractions"/>
<RegExpr context="#pop" attribute="Open Prep. Lib" String="[^>\s](?=\s*$)"/>
</context>
<context name="_include_preplib_quot" attribute="Prep. Lib" lineEndContext="#pop">
<DetectChar context="#pop" attribute="Prep. Lib" char="""/>
<keyword context="#stay" attribute="Prep. Lib" String="default_abstractions"/>
<RegExpr context="#pop" attribute="Open Prep. Lib" String="[^"\s](?=\s*$)"/>
</context>
<context name="_include_preplib_thanquot" attribute="Prep. Lib" lineEndContext="#pop">
<DetectChar context="_include_preplib_quot" attribute="Prep. Lib" char="""/>
<IncludeRules context="_include_preplib_than"/>
</context>
<!-- ABI Rule -->
<context name="_rule_abi" attribute="Error" lineEndContext="#stay">
<DetectSpaces attribute="Normal Text"/>
<RegExpr context="#pop!_abi_path_thanquot" attribute="Prep. Lib" String="<\s*(?=")"/> <!-- <"path"> -->
<DetectChar context="#pop!_abi_path_than" attribute="Prep. Lib" char="<" lookAhead="true"/> <!-- <magic/path> -->
<DetectChar context="#pop!_abi_path_quot" attribute="Prep. Lib" char="""/> <!-- "/abs/path" -->
<IncludeRules context="_end_rule"/>
<DetectChar context="_comment" attribute="Comment" char="#"/>
<!-- /abs/path -->
<RegExpr context="#stay" attribute="Error" String="[^\s"<]+(?=["<])"/>
<RegExpr context="#pop!_abi_path_text" attribute="Prep. Lib" String="[^\s"<]" lookAhead="true"/>
</context>
<context name="_abi_path_text" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path">
<RegExpr context="#pop!_rule_abi_after_path" String="&endPath;" lookAhead="true"/>
<DetectSpaces context="#pop!_rule_abi_after_path" lookAhead="true"/>
<AnyChar context="#stay" attribute="Error" String=""<>"/>
</context>
<context name="_abi_path_quot" attribute="Prep. Lib" lineEndContext="#stay">
<DetectChar context="#pop!_rule_abi_after_path" attribute="Prep. Lib" char="""/>
<IncludeRules context="_escape"/>
</context>
<context name="_abi_path_than" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path">
<DetectChar context="#pop!_rule_abi_after_path" attribute="Prep. Lib" char=">"/>
<RegExpr context="#pop!_rule_abi_after_path" attribute="Open Prep. Lib" String="[^>\s](?=\s*$)"/>
</context>
<context name="_abi_path_thanquot" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path">
<DetectChar context="_abi_path_thanquot_quot" attribute="Prep. Lib" char="""/>
<IncludeRules context="_abi_path_than"/>
</context>
<context name="_abi_path_thanquot_quot" attribute="Prep. Lib" lineEndContext="#stay">
<DetectChar context="#pop" attribute="Prep. Lib" char="""/>
<IncludeRules context="_escape"/>
</context>
<context name="_rule_abi_after_path" attribute="Error" lineEndContext="#stay">
<DetectSpaces attribute="Normal Text"/>
<IncludeRules context="_end_rule"/>
<DetectChar context="_comment" attribute="Comment" char="#"/>
</context>
<!-- @{VARIABLE} -->
<context name="_variable" attribute="Variable" lineEndContext="#pop">
<RegExpr context="#pop!_find_path_after_variable" attribute="Variable" String="&variable;"/>
<DetectChar context="#pop" attribute="Error" char="@"/>
</context>
<context name="_parentheses_variable" attribute="Variable" lineEndContext="#pop">
<RegExpr context="#pop!_parentheses_find_path_after_variable" attribute="Variable" String="&variable;"/>
<DetectChar context="#pop" attribute="Error" char="@"/>
</context>
<context name="_variable_simple" attribute="Normal Text" lineEndContext="#stay">
<RegExpr context="#stay" attribute="Variable" String="&variable;"/>
</context>
<!-- Find path after a variable -->
<context name="_find_path_after_variable" attribute="Path" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_path_content">