blob: 6edcd1f57f29cf12c1db9ded79f77fd5c6401067 [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001#
2# Define common prefixes for access vectors
3#
4# common common_name { permission_name ... }
5
6
7#
8# Define a common prefix for file access vectors.
9#
10
11common file
12{
13 ioctl
14 read
15 write
16 create
17 getattr
18 setattr
19 lock
20 relabelfrom
21 relabelto
22 append
Stephen Smalley4397f082017-07-10 09:32:10 -040023 map
Stephen Smalley2dd4e512012-01-04 12:33:27 -050024 unlink
25 link
26 rename
27 execute
Stephen Smalley2dd4e512012-01-04 12:33:27 -050028 quotaon
29 mounton
Stephen Smalleycd62a4a2020-01-14 14:27:45 -050030 audit_access
31 open
32 execmod
33 watch
34 watch_mount
35 watch_sb
36 watch_with_perm
37 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -050038}
39
40
41#
42# Define a common prefix for socket access vectors.
43#
44
45common socket
46{
47# inherited from file
48 ioctl
49 read
50 write
51 create
52 getattr
53 setattr
54 lock
55 relabelfrom
56 relabelto
57 append
Stephen Smalley4397f082017-07-10 09:32:10 -040058 map
Stephen Smalley2dd4e512012-01-04 12:33:27 -050059# socket-specific
60 bind
61 connect
62 listen
63 accept
64 getopt
65 setopt
66 shutdown
67 recvfrom
68 sendto
Stephen Smalley2dd4e512012-01-04 12:33:27 -050069 name_bind
70}
71
72#
73# Define a common prefix for ipc access vectors.
74#
75
76common ipc
77{
78 create
79 destroy
80 getattr
81 setattr
82 read
83 write
84 associate
85 unix_read
86 unix_write
87}
88
89#
Stephen Smalley8a003602016-04-27 09:42:57 -040090# Define a common for capability access vectors.
91#
92common cap
93{
94 # The capabilities are defined in include/linux/capability.h
95 # Capabilities >= 32 are defined in the cap2 common.
96 # Care should be taken to ensure that these are consistent with
97 # those definitions. (Order matters)
98
99 chown
100 dac_override
101 dac_read_search
102 fowner
103 fsetid
104 kill
105 setgid
106 setuid
107 setpcap
108 linux_immutable
109 net_bind_service
110 net_broadcast
111 net_admin
112 net_raw
113 ipc_lock
114 ipc_owner
115 sys_module
116 sys_rawio
117 sys_chroot
118 sys_ptrace
119 sys_pacct
120 sys_admin
121 sys_boot
122 sys_nice
123 sys_resource
124 sys_time
125 sys_tty_config
126 mknod
127 lease
128 audit_write
129 audit_control
130 setfcap
131}
132
133common cap2
134{
135 mac_override # unused by SELinux
Stephen Smalley87154602020-01-16 10:29:15 -0500136 mac_admin
Stephen Smalley8a003602016-04-27 09:42:57 -0400137 syslog
138 wake_alarm
139 block_suspend
140 audit_read
Alistair Delva178f0ac2020-06-05 10:15:30 -0700141 perfmon
Stephen Smalley8a003602016-04-27 09:42:57 -0400142}
143
144#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500145# Define the access vectors.
146#
147# class class_name [ inherits common_name ] { permission_name ... }
148
149
150#
151# Define the access vector interpretation for file-related objects.
152#
153
154class filesystem
155{
156 mount
157 remount
158 unmount
159 getattr
160 relabelfrom
161 relabelto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500162 associate
163 quotamod
164 quotaget
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700165 watch
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500166}
167
168class dir
169inherits file
170{
171 add_name
172 remove_name
173 reparent
174 search
175 rmdir
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500176}
177
178class file
179inherits file
180{
181 execute_no_trans
182 entrypoint
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500183}
184
Lokesh Gidra06edcd82021-03-11 11:32:47 -0800185class anon_inode
186inherits file
187
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500188class lnk_file
189inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500190
191class chr_file
192inherits file
193{
194 execute_no_trans
195 entrypoint
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500196}
197
198class blk_file
199inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500200
201class sock_file
202inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500203
204class fifo_file
205inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500206
207class fd
208{
209 use
210}
211
212
213#
214# Define the access vector interpretation for network-related objects.
215#
216
217class socket
218inherits socket
219
220class tcp_socket
221inherits socket
222{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500223 node_bind
224 name_connect
225}
226
227class udp_socket
228inherits socket
229{
230 node_bind
231}
232
233class rawip_socket
234inherits socket
235{
236 node_bind
237}
238
239class node
240{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500241 recvfrom
242 sendto
243}
244
245class netif
246{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500247 ingress
248 egress
249}
250
251class netlink_socket
252inherits socket
253
254class packet_socket
255inherits socket
256
257class key_socket
258inherits socket
259
260class unix_stream_socket
261inherits socket
262{
263 connectto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500264}
265
266class unix_dgram_socket
267inherits socket
268
269#
270# Define the access vector interpretation for process-related objects
271#
272
273class process
274{
275 fork
276 transition
277 sigchld # commonly granted from child to parent
278 sigkill # cannot be caught or ignored
279 sigstop # cannot be caught or ignored
280 signull # for kill(pid, 0)
281 signal # all other signals
282 ptrace
283 getsched
284 setsched
285 getsession
286 getpgid
287 setpgid
288 getcap
289 setcap
290 share
291 getattr
292 setexec
293 setfscreate
294 noatsecure
295 siginh
296 setrlimit
297 rlimitinh
298 dyntransition
299 setcurrent
300 execmem
301 execstack
302 execheap
303 setkeycreate
304 setsockcreate
Stephen Smalley91a3eea2017-05-17 12:12:12 -0400305 getrlimit
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500306}
307
Nick Kralevich1b1d1332018-09-07 10:48:55 -0700308class process2
309{
310 nnp_transition
311 nosuid_transition
312}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500313
314#
315# Define the access vector interpretation for ipc-related objects
316#
317
318class ipc
319inherits ipc
320
321class sem
322inherits ipc
323
324class msgq
325inherits ipc
326{
327 enqueue
328}
329
330class msg
331{
332 send
333 receive
334}
335
336class shm
337inherits ipc
338{
339 lock
340}
341
342
343#
344# Define the access vector interpretation for the security server.
345#
346
347class security
348{
349 compute_av
350 compute_create
351 compute_member
352 check_context
353 load_policy
354 compute_relabel
355 compute_user
356 setenforce # was avc_toggle in system class
357 setbool
358 setsecparam
359 setcheckreqprot
360 read_policy
Stephen Smalley50992312017-07-10 14:45:15 -0400361 validate_trans
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500362}
363
364
365#
366# Define the access vector interpretation for system operations.
367#
368
369class system
370{
371 ipc_info
372 syslog_read
373 syslog_mod
374 syslog_console
375 module_request
Jeff Vander Stoepa16b0582016-04-07 11:06:05 -0700376 module_load
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500377}
378
379#
Stephen Smalley8a003602016-04-27 09:42:57 -0400380# Define the access vector interpretation for controlling capabilities
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500381#
382
383class capability
Stephen Smalley8a003602016-04-27 09:42:57 -0400384inherits cap
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500385
386class capability2
Stephen Smalley8a003602016-04-27 09:42:57 -0400387inherits cap2
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500388
389#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500390# Extended Netlink classes
391#
392class netlink_route_socket
393inherits socket
394{
395 nlmsg_read
396 nlmsg_write
Jeff Vander Stoepfb69c8e2019-10-16 15:19:40 +0200397 nlmsg_readpriv
Bram Bonnéea5460a2021-05-12 14:19:24 +0200398 nlmsg_getneigh
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500399}
400
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500401class netlink_tcpdiag_socket
402inherits socket
403{
404 nlmsg_read
405 nlmsg_write
406}
407
408class netlink_nflog_socket
409inherits socket
410
411class netlink_xfrm_socket
412inherits socket
413{
414 nlmsg_read
415 nlmsg_write
416}
417
418class netlink_selinux_socket
419inherits socket
420
421class netlink_audit_socket
422inherits socket
423{
424 nlmsg_read
425 nlmsg_write
426 nlmsg_relay
427 nlmsg_readpriv
428 nlmsg_tty_audit
429}
430
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500431class netlink_dnrt_socket
432inherits socket
433
434# Define the access vector interpretation for controlling
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500435# access to IPSec network data by association
436#
437class association
438{
439 sendto
440 recvfrom
441 setcontext
442 polmatch
443}
444
445# Updated Netlink class for KOBJECT_UEVENT family.
446class netlink_kobject_uevent_socket
447inherits socket
448
449class appletalk_socket
450inherits socket
451
452class packet
453{
454 send
455 recv
456 relabelto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500457 forward_in
458 forward_out
459}
460
461class key
462{
463 view
464 read
465 write
466 search
467 link
468 setattr
469 create
470}
471
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500472class dccp_socket
473inherits socket
474{
475 node_bind
476 name_connect
477}
478
479class memprotect
480{
481 mmap_zero
482}
483
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500484# network peer labels
485class peer
486{
487 recv
488}
489
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500490class kernel_service
491{
492 use_as_override
493 create_files_as
494}
495
496class tun_socket
497inherits socket
Nick Kralevichd7af45d2014-06-06 16:51:11 -0700498{
499 attach_queue
500}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500501
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500502class binder
503{
504 impersonate
505 call
506 set_context_mgr
507 transfer
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500508}
509
Stephen Smalley01d95c22015-05-21 16:17:26 -0400510class netlink_iscsi_socket
511inherits socket
512
513class netlink_fib_lookup_socket
514inherits socket
515
516class netlink_connector_socket
517inherits socket
518
519class netlink_netfilter_socket
520inherits socket
521
522class netlink_generic_socket
523inherits socket
524
525class netlink_scsitransport_socket
526inherits socket
527
528class netlink_rdma_socket
529inherits socket
530
531class netlink_crypto_socket
532inherits socket
533
Nick Kralevichea1775d2018-11-01 19:39:44 -0700534class infiniband_pkey
535{
536 access
537}
538
539class infiniband_endport
540{
541 manage_subnet
542}
543
Stephen Smalley8a003602016-04-27 09:42:57 -0400544#
545# Define the access vector interpretation for controlling capabilities
546# in user namespaces
547#
548
549class cap_userns
550inherits cap
551
552class cap2_userns
553inherits cap2
554
Stephen Smalley431bdd92016-12-08 13:35:27 -0500555
556#
557# Define the access vector interpretation for the new socket classes
558# enabled by the extended_socket_class policy capability.
559#
560
561#
562# The next two classes were previously mapped to rawip_socket and therefore
563# have the same definition as rawip_socket (until further permissions
564# are defined).
565#
566class sctp_socket
567inherits socket
568{
569 node_bind
Nick Kralevichea1775d2018-11-01 19:39:44 -0700570 name_connect
571 association
Stephen Smalley431bdd92016-12-08 13:35:27 -0500572}
573
574class icmp_socket
575inherits socket
576{
577 node_bind
578}
579
580#
581# The remaining network socket classes were previously
582# mapped to the socket class and therefore have the
583# same definition as socket.
584#
585
586class ax25_socket
587inherits socket
588
589class ipx_socket
590inherits socket
591
592class netrom_socket
593inherits socket
594
595class atmpvc_socket
596inherits socket
597
598class x25_socket
599inherits socket
600
601class rose_socket
602inherits socket
603
604class decnet_socket
605inherits socket
606
607class atmsvc_socket
608inherits socket
609
610class rds_socket
611inherits socket
612
613class irda_socket
614inherits socket
615
616class pppox_socket
617inherits socket
618
619class llc_socket
620inherits socket
621
622class can_socket
623inherits socket
624
625class tipc_socket
626inherits socket
627
628class bluetooth_socket
629inherits socket
630
631class iucv_socket
632inherits socket
633
634class rxrpc_socket
635inherits socket
636
637class isdn_socket
638inherits socket
639
640class phonet_socket
641inherits socket
642
643class ieee802154_socket
644inherits socket
645
646class caif_socket
647inherits socket
648
649class alg_socket
650inherits socket
651
652class nfc_socket
653inherits socket
654
655class vsock_socket
656inherits socket
657
658class kcm_socket
659inherits socket
660
661class qipcrtr_socket
662inherits socket
663
Stephen Smalley2be97992017-05-17 12:06:49 -0400664class smc_socket
665inherits socket
666
Nick Kralevichf5a1b1b2018-10-18 09:08:26 -0700667class bpf
668{
669 map_create
670 map_read
671 map_write
672 prog_load
673 prog_run
674}
675
Stephen Smalley124720a2012-04-04 10:11:16 -0400676class property_service
677{
678 set
679}
Riley Spahnf90c41f2014-06-05 15:52:02 -0700680
681class service_manager
682{
683 add
Riley Spahnb8511e02014-07-07 13:56:27 -0700684 find
685 list
Riley Spahnf90c41f2014-06-05 15:52:02 -0700686}
Riley Spahn1196d2a2014-06-17 14:58:52 -0700687
Martijn Coenenbc6d88d2017-04-06 09:24:41 -0700688class hwservice_manager
689{
690 add
691 find
692 list
693}
694
Riley Spahn1196d2a2014-06-17 14:58:52 -0700695class keystore_key
696{
Chad Brubakercbc8f792015-05-13 14:39:48 -0700697 get_state
Riley Spahn1196d2a2014-06-17 14:58:52 -0700698 get
699 insert
700 delete
701 exist
Chad Brubakercbc8f792015-05-13 14:39:48 -0700702 list
Riley Spahn1196d2a2014-06-17 14:58:52 -0700703 reset
704 password
705 lock
706 unlock
Chad Brubakercbc8f792015-05-13 14:39:48 -0700707 is_empty
Riley Spahn1196d2a2014-06-17 14:58:52 -0700708 sign
709 verify
710 grant
711 duplicate
712 clear_uid
Chad Brubaker89277722015-03-31 13:03:06 -0700713 add_auth
Chad Brubaker520bb812015-05-12 12:33:40 -0700714 user_changed
Shawn Willdena0c7f012017-04-11 09:41:25 -0600715 gen_unique_id
Riley Spahn1196d2a2014-06-17 14:58:52 -0700716}
Stephen Smalleyba992492014-07-24 15:25:43 -0400717
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700718class keystore2
719{
720 add_auth
Hasini Gunasinghe685ca0c2021-01-27 01:01:45 +0000721 change_password
722 change_user
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700723 clear_ns
Hasini Gunasinghe685ca0c2021-01-27 01:01:45 +0000724 clear_uid
Satya Tangirala5ef86862021-03-11 03:57:03 -0800725 early_boot_ended
Hasini Gunasinghedb88d152020-12-03 21:40:53 +0000726 get_auth_token
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700727 get_state
Janis Danisevskis144c8222020-09-24 08:55:28 -0700728 list
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700729 lock
Hasini Gunasinghe4334d352021-06-10 15:05:49 +0000730 pull_metrics
Janis Danisevskis7ca6b482021-03-23 19:01:06 -0700731 report_off_body
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700732 reset
733 unlock
Paul Crowleybf29c3a2021-08-06 15:11:53 -0700734 delete_all_keys
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700735}
736
737class keystore2_key
738{
Satya Tangirala06533742021-03-08 09:48:42 -0800739 convert_storage_key_to_ephemeral
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700740 delete
741 gen_unique_id
742 get_info
743 grant
Janis Danisevskis24f3dce2020-07-25 13:08:15 -0700744 manage_blob
745 rebind
746 req_forced_op
747 update
748 use
749 use_dev_id
750}
751
Riley Spahn70f75ce2014-07-02 12:42:59 -0700752class drmservice {
753 consumeRights
754 setPlaybackStatus
755 openDecryptSession
756 closeDecryptSession
757 initializeDecryptUnit
758 decrypt
759 finalizeDecryptUnit
760 pread
761}
Nick Kralevichea1775d2018-11-01 19:39:44 -0700762
763class xdp_socket
764inherits socket
Ryan Savitski80640c52020-01-08 17:30:26 +0000765
766class perf_event
767{
768 open
769 cpu
770 kernel
771 tracepoint
772 read
773 write
774}
Nick Kraleviche4686b42020-02-13 12:57:27 -0800775
776class lockdown
777{
778 integrity
779 confidentiality
780}