blob: 8c6aa68b67bce3b2ad786a16fa0903bd619ddbc5 [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
30}
31
32
33#
34# Define a common prefix for socket access vectors.
35#
36
37common socket
38{
39# inherited from file
40 ioctl
41 read
42 write
43 create
44 getattr
45 setattr
46 lock
47 relabelfrom
48 relabelto
49 append
Stephen Smalley4397f082017-07-10 09:32:10 -040050 map
Stephen Smalley2dd4e512012-01-04 12:33:27 -050051# socket-specific
52 bind
53 connect
54 listen
55 accept
56 getopt
57 setopt
58 shutdown
59 recvfrom
60 sendto
Stephen Smalley2dd4e512012-01-04 12:33:27 -050061 name_bind
62}
63
64#
65# Define a common prefix for ipc access vectors.
66#
67
68common ipc
69{
70 create
71 destroy
72 getattr
73 setattr
74 read
75 write
76 associate
77 unix_read
78 unix_write
79}
80
81#
Stephen Smalley8a003602016-04-27 09:42:57 -040082# Define a common for capability access vectors.
83#
84common cap
85{
86 # The capabilities are defined in include/linux/capability.h
87 # Capabilities >= 32 are defined in the cap2 common.
88 # Care should be taken to ensure that these are consistent with
89 # those definitions. (Order matters)
90
91 chown
92 dac_override
93 dac_read_search
94 fowner
95 fsetid
96 kill
97 setgid
98 setuid
99 setpcap
100 linux_immutable
101 net_bind_service
102 net_broadcast
103 net_admin
104 net_raw
105 ipc_lock
106 ipc_owner
107 sys_module
108 sys_rawio
109 sys_chroot
110 sys_ptrace
111 sys_pacct
112 sys_admin
113 sys_boot
114 sys_nice
115 sys_resource
116 sys_time
117 sys_tty_config
118 mknod
119 lease
120 audit_write
121 audit_control
122 setfcap
123}
124
125common cap2
126{
127 mac_override # unused by SELinux
128 mac_admin # unused by SELinux
129 syslog
130 wake_alarm
131 block_suspend
132 audit_read
133}
134
135#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500136# Define the access vectors.
137#
138# class class_name [ inherits common_name ] { permission_name ... }
139
140
141#
142# Define the access vector interpretation for file-related objects.
143#
144
145class filesystem
146{
147 mount
148 remount
149 unmount
150 getattr
151 relabelfrom
152 relabelto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500153 associate
154 quotamod
155 quotaget
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700156 watch
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500157}
158
159class dir
160inherits file
161{
162 add_name
163 remove_name
164 reparent
165 search
166 rmdir
167 open
168 audit_access
169 execmod
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700170 watch
171 watch_mount
172 watch_sb
173 watch_with_perm
174 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500175}
176
177class file
178inherits file
179{
180 execute_no_trans
181 entrypoint
182 execmod
183 open
184 audit_access
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700185 watch
186 watch_mount
187 watch_sb
188 watch_with_perm
189 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500190}
191
192class lnk_file
193inherits file
194{
195 open
196 audit_access
197 execmod
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700198 watch
199 watch_mount
200 watch_sb
201 watch_with_perm
202 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500203}
204
205class chr_file
206inherits file
207{
208 execute_no_trans
209 entrypoint
210 execmod
211 open
212 audit_access
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700213 watch
214 watch_mount
215 watch_sb
216 watch_with_perm
217 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500218}
219
220class blk_file
221inherits file
222{
223 open
224 audit_access
225 execmod
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700226 watch
227 watch_mount
228 watch_sb
229 watch_with_perm
230 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500231}
232
233class sock_file
234inherits file
235{
236 open
237 audit_access
238 execmod
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700239 watch
240 watch_mount
241 watch_sb
242 watch_with_perm
243 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500244}
245
246class fifo_file
247inherits file
248{
249 open
250 audit_access
251 execmod
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700252 watch
253 watch_mount
254 watch_sb
255 watch_with_perm
256 watch_reads
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500257}
258
259class fd
260{
261 use
262}
263
264
265#
266# Define the access vector interpretation for network-related objects.
267#
268
269class socket
270inherits socket
271
272class tcp_socket
273inherits socket
274{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500275 node_bind
276 name_connect
277}
278
279class udp_socket
280inherits socket
281{
282 node_bind
283}
284
285class rawip_socket
286inherits socket
287{
288 node_bind
289}
290
291class node
292{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500293 recvfrom
294 sendto
295}
296
297class netif
298{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500299 ingress
300 egress
301}
302
303class netlink_socket
304inherits socket
305
306class packet_socket
307inherits socket
308
309class key_socket
310inherits socket
311
312class unix_stream_socket
313inherits socket
314{
315 connectto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500316}
317
318class unix_dgram_socket
319inherits socket
320
321#
322# Define the access vector interpretation for process-related objects
323#
324
325class process
326{
327 fork
328 transition
329 sigchld # commonly granted from child to parent
330 sigkill # cannot be caught or ignored
331 sigstop # cannot be caught or ignored
332 signull # for kill(pid, 0)
333 signal # all other signals
334 ptrace
335 getsched
336 setsched
337 getsession
338 getpgid
339 setpgid
340 getcap
341 setcap
342 share
343 getattr
344 setexec
345 setfscreate
346 noatsecure
347 siginh
348 setrlimit
349 rlimitinh
350 dyntransition
351 setcurrent
352 execmem
353 execstack
354 execheap
355 setkeycreate
356 setsockcreate
Stephen Smalley91a3eea2017-05-17 12:12:12 -0400357 getrlimit
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500358}
359
Nick Kralevich1b1d1332018-09-07 10:48:55 -0700360class process2
361{
362 nnp_transition
363 nosuid_transition
364}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500365
366#
367# Define the access vector interpretation for ipc-related objects
368#
369
370class ipc
371inherits ipc
372
373class sem
374inherits ipc
375
376class msgq
377inherits ipc
378{
379 enqueue
380}
381
382class msg
383{
384 send
385 receive
386}
387
388class shm
389inherits ipc
390{
391 lock
392}
393
394
395#
396# Define the access vector interpretation for the security server.
397#
398
399class security
400{
401 compute_av
402 compute_create
403 compute_member
404 check_context
405 load_policy
406 compute_relabel
407 compute_user
408 setenforce # was avc_toggle in system class
409 setbool
410 setsecparam
411 setcheckreqprot
412 read_policy
Stephen Smalley50992312017-07-10 14:45:15 -0400413 validate_trans
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500414}
415
416
417#
418# Define the access vector interpretation for system operations.
419#
420
421class system
422{
423 ipc_info
424 syslog_read
425 syslog_mod
426 syslog_console
427 module_request
Jeff Vander Stoepa16b0582016-04-07 11:06:05 -0700428 module_load
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500429}
430
431#
Stephen Smalley8a003602016-04-27 09:42:57 -0400432# Define the access vector interpretation for controlling capabilities
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500433#
434
435class capability
Stephen Smalley8a003602016-04-27 09:42:57 -0400436inherits cap
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500437
438class capability2
Stephen Smalley8a003602016-04-27 09:42:57 -0400439inherits cap2
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500440
441#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500442# Extended Netlink classes
443#
444class netlink_route_socket
445inherits socket
446{
447 nlmsg_read
448 nlmsg_write
Jeff Vander Stoepfb69c8e2019-10-16 15:19:40 +0200449 nlmsg_readpriv
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500450}
451
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500452class netlink_tcpdiag_socket
453inherits socket
454{
455 nlmsg_read
456 nlmsg_write
457}
458
459class netlink_nflog_socket
460inherits socket
461
462class netlink_xfrm_socket
463inherits socket
464{
465 nlmsg_read
466 nlmsg_write
467}
468
469class netlink_selinux_socket
470inherits socket
471
472class netlink_audit_socket
473inherits socket
474{
475 nlmsg_read
476 nlmsg_write
477 nlmsg_relay
478 nlmsg_readpriv
479 nlmsg_tty_audit
480}
481
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500482class netlink_dnrt_socket
483inherits socket
484
485# Define the access vector interpretation for controlling
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500486# access to IPSec network data by association
487#
488class association
489{
490 sendto
491 recvfrom
492 setcontext
493 polmatch
494}
495
496# Updated Netlink class for KOBJECT_UEVENT family.
497class netlink_kobject_uevent_socket
498inherits socket
499
500class appletalk_socket
501inherits socket
502
503class packet
504{
505 send
506 recv
507 relabelto
508 flow_in # deprecated
509 flow_out # deprecated
510 forward_in
511 forward_out
512}
513
514class key
515{
516 view
517 read
518 write
519 search
520 link
521 setattr
522 create
523}
524
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500525class dccp_socket
526inherits socket
527{
528 node_bind
529 name_connect
530}
531
532class memprotect
533{
534 mmap_zero
535}
536
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500537# network peer labels
538class peer
539{
540 recv
541}
542
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500543class kernel_service
544{
545 use_as_override
546 create_files_as
547}
548
549class tun_socket
550inherits socket
Nick Kralevichd7af45d2014-06-06 16:51:11 -0700551{
552 attach_queue
553}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500554
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500555class binder
556{
557 impersonate
558 call
559 set_context_mgr
560 transfer
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500561}
562
Stephen Smalley01d95c22015-05-21 16:17:26 -0400563class netlink_iscsi_socket
564inherits socket
565
566class netlink_fib_lookup_socket
567inherits socket
568
569class netlink_connector_socket
570inherits socket
571
572class netlink_netfilter_socket
573inherits socket
574
575class netlink_generic_socket
576inherits socket
577
578class netlink_scsitransport_socket
579inherits socket
580
581class netlink_rdma_socket
582inherits socket
583
584class netlink_crypto_socket
585inherits socket
586
Nick Kralevichea1775d2018-11-01 19:39:44 -0700587class infiniband_pkey
588{
589 access
590}
591
592class infiniband_endport
593{
594 manage_subnet
595}
596
Stephen Smalley8a003602016-04-27 09:42:57 -0400597#
598# Define the access vector interpretation for controlling capabilities
599# in user namespaces
600#
601
602class cap_userns
603inherits cap
604
605class cap2_userns
606inherits cap2
607
Stephen Smalley431bdd92016-12-08 13:35:27 -0500608
609#
610# Define the access vector interpretation for the new socket classes
611# enabled by the extended_socket_class policy capability.
612#
613
614#
615# The next two classes were previously mapped to rawip_socket and therefore
616# have the same definition as rawip_socket (until further permissions
617# are defined).
618#
619class sctp_socket
620inherits socket
621{
622 node_bind
Nick Kralevichea1775d2018-11-01 19:39:44 -0700623 name_connect
624 association
Stephen Smalley431bdd92016-12-08 13:35:27 -0500625}
626
627class icmp_socket
628inherits socket
629{
630 node_bind
631}
632
633#
634# The remaining network socket classes were previously
635# mapped to the socket class and therefore have the
636# same definition as socket.
637#
638
639class ax25_socket
640inherits socket
641
642class ipx_socket
643inherits socket
644
645class netrom_socket
646inherits socket
647
648class atmpvc_socket
649inherits socket
650
651class x25_socket
652inherits socket
653
654class rose_socket
655inherits socket
656
657class decnet_socket
658inherits socket
659
660class atmsvc_socket
661inherits socket
662
663class rds_socket
664inherits socket
665
666class irda_socket
667inherits socket
668
669class pppox_socket
670inherits socket
671
672class llc_socket
673inherits socket
674
675class can_socket
676inherits socket
677
678class tipc_socket
679inherits socket
680
681class bluetooth_socket
682inherits socket
683
684class iucv_socket
685inherits socket
686
687class rxrpc_socket
688inherits socket
689
690class isdn_socket
691inherits socket
692
693class phonet_socket
694inherits socket
695
696class ieee802154_socket
697inherits socket
698
699class caif_socket
700inherits socket
701
702class alg_socket
703inherits socket
704
705class nfc_socket
706inherits socket
707
708class vsock_socket
709inherits socket
710
711class kcm_socket
712inherits socket
713
714class qipcrtr_socket
715inherits socket
716
Stephen Smalley2be97992017-05-17 12:06:49 -0400717class smc_socket
718inherits socket
719
Nick Kralevichf5a1b1b2018-10-18 09:08:26 -0700720class bpf
721{
722 map_create
723 map_read
724 map_write
725 prog_load
726 prog_run
727}
728
Stephen Smalley124720a2012-04-04 10:11:16 -0400729class property_service
730{
731 set
732}
Riley Spahnf90c41f2014-06-05 15:52:02 -0700733
734class service_manager
735{
736 add
Riley Spahnb8511e02014-07-07 13:56:27 -0700737 find
738 list
Riley Spahnf90c41f2014-06-05 15:52:02 -0700739}
Riley Spahn1196d2a2014-06-17 14:58:52 -0700740
Martijn Coenenbc6d88d2017-04-06 09:24:41 -0700741class hwservice_manager
742{
743 add
744 find
745 list
746}
747
Riley Spahn1196d2a2014-06-17 14:58:52 -0700748class keystore_key
749{
Chad Brubakercbc8f792015-05-13 14:39:48 -0700750 get_state
Riley Spahn1196d2a2014-06-17 14:58:52 -0700751 get
752 insert
753 delete
754 exist
Chad Brubakercbc8f792015-05-13 14:39:48 -0700755 list
Riley Spahn1196d2a2014-06-17 14:58:52 -0700756 reset
757 password
758 lock
759 unlock
Chad Brubakercbc8f792015-05-13 14:39:48 -0700760 is_empty
Riley Spahn1196d2a2014-06-17 14:58:52 -0700761 sign
762 verify
763 grant
764 duplicate
765 clear_uid
Chad Brubaker89277722015-03-31 13:03:06 -0700766 add_auth
Chad Brubaker520bb812015-05-12 12:33:40 -0700767 user_changed
Shawn Willdena0c7f012017-04-11 09:41:25 -0600768 gen_unique_id
Riley Spahn1196d2a2014-06-17 14:58:52 -0700769}
Stephen Smalleyba992492014-07-24 15:25:43 -0400770
Riley Spahn70f75ce2014-07-02 12:42:59 -0700771class drmservice {
772 consumeRights
773 setPlaybackStatus
774 openDecryptSession
775 closeDecryptSession
776 initializeDecryptUnit
777 decrypt
778 finalizeDecryptUnit
779 pread
780}
Nick Kralevichea1775d2018-11-01 19:39:44 -0700781
782class xdp_socket
783inherits socket
Ryan Savitski80640c52020-01-08 17:30:26 +0000784
785class perf_event
786{
787 open
788 cpu
789 kernel
790 tracepoint
791 read
792 write
793}