blob: cd1ad12fab9f92f2d2d08f62a7d169c914e2245a [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
136 mac_admin # unused by SELinux
137 syslog
138 wake_alarm
139 block_suspend
140 audit_read
141}
142
143#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500144# Define the access vectors.
145#
146# class class_name [ inherits common_name ] { permission_name ... }
147
148
149#
150# Define the access vector interpretation for file-related objects.
151#
152
153class filesystem
154{
155 mount
156 remount
157 unmount
158 getattr
159 relabelfrom
160 relabelto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500161 associate
162 quotamod
163 quotaget
Nick Kralevichdddbaaf2019-08-27 15:29:02 -0700164 watch
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500165}
166
167class dir
168inherits file
169{
170 add_name
171 remove_name
172 reparent
173 search
174 rmdir
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500175}
176
177class file
178inherits file
179{
180 execute_no_trans
181 entrypoint
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500182}
183
184class lnk_file
185inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500186
187class chr_file
188inherits file
189{
190 execute_no_trans
191 entrypoint
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500192}
193
194class blk_file
195inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500196
197class sock_file
198inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500199
200class fifo_file
201inherits file
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500202
203class fd
204{
205 use
206}
207
208
209#
210# Define the access vector interpretation for network-related objects.
211#
212
213class socket
214inherits socket
215
216class tcp_socket
217inherits socket
218{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500219 node_bind
220 name_connect
221}
222
223class udp_socket
224inherits socket
225{
226 node_bind
227}
228
229class rawip_socket
230inherits socket
231{
232 node_bind
233}
234
235class node
236{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500237 recvfrom
238 sendto
239}
240
241class netif
242{
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500243 ingress
244 egress
245}
246
247class netlink_socket
248inherits socket
249
250class packet_socket
251inherits socket
252
253class key_socket
254inherits socket
255
256class unix_stream_socket
257inherits socket
258{
259 connectto
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500260}
261
262class unix_dgram_socket
263inherits socket
264
265#
266# Define the access vector interpretation for process-related objects
267#
268
269class process
270{
271 fork
272 transition
273 sigchld # commonly granted from child to parent
274 sigkill # cannot be caught or ignored
275 sigstop # cannot be caught or ignored
276 signull # for kill(pid, 0)
277 signal # all other signals
278 ptrace
279 getsched
280 setsched
281 getsession
282 getpgid
283 setpgid
284 getcap
285 setcap
286 share
287 getattr
288 setexec
289 setfscreate
290 noatsecure
291 siginh
292 setrlimit
293 rlimitinh
294 dyntransition
295 setcurrent
296 execmem
297 execstack
298 execheap
299 setkeycreate
300 setsockcreate
Stephen Smalley91a3eea2017-05-17 12:12:12 -0400301 getrlimit
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500302}
303
Nick Kralevich1b1d1332018-09-07 10:48:55 -0700304class process2
305{
306 nnp_transition
307 nosuid_transition
308}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500309
310#
311# Define the access vector interpretation for ipc-related objects
312#
313
314class ipc
315inherits ipc
316
317class sem
318inherits ipc
319
320class msgq
321inherits ipc
322{
323 enqueue
324}
325
326class msg
327{
328 send
329 receive
330}
331
332class shm
333inherits ipc
334{
335 lock
336}
337
338
339#
340# Define the access vector interpretation for the security server.
341#
342
343class security
344{
345 compute_av
346 compute_create
347 compute_member
348 check_context
349 load_policy
350 compute_relabel
351 compute_user
352 setenforce # was avc_toggle in system class
353 setbool
354 setsecparam
355 setcheckreqprot
356 read_policy
Stephen Smalley50992312017-07-10 14:45:15 -0400357 validate_trans
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500358}
359
360
361#
362# Define the access vector interpretation for system operations.
363#
364
365class system
366{
367 ipc_info
368 syslog_read
369 syslog_mod
370 syslog_console
371 module_request
Jeff Vander Stoepa16b0582016-04-07 11:06:05 -0700372 module_load
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500373}
374
375#
Stephen Smalley8a003602016-04-27 09:42:57 -0400376# Define the access vector interpretation for controlling capabilities
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500377#
378
379class capability
Stephen Smalley8a003602016-04-27 09:42:57 -0400380inherits cap
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500381
382class capability2
Stephen Smalley8a003602016-04-27 09:42:57 -0400383inherits cap2
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500384
385#
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500386# Extended Netlink classes
387#
388class netlink_route_socket
389inherits socket
390{
391 nlmsg_read
392 nlmsg_write
Jeff Vander Stoepfb69c8e2019-10-16 15:19:40 +0200393 nlmsg_readpriv
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500394}
395
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500396class netlink_tcpdiag_socket
397inherits socket
398{
399 nlmsg_read
400 nlmsg_write
401}
402
403class netlink_nflog_socket
404inherits socket
405
406class netlink_xfrm_socket
407inherits socket
408{
409 nlmsg_read
410 nlmsg_write
411}
412
413class netlink_selinux_socket
414inherits socket
415
416class netlink_audit_socket
417inherits socket
418{
419 nlmsg_read
420 nlmsg_write
421 nlmsg_relay
422 nlmsg_readpriv
423 nlmsg_tty_audit
424}
425
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500426class netlink_dnrt_socket
427inherits socket
428
429# Define the access vector interpretation for controlling
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500430# access to IPSec network data by association
431#
432class association
433{
434 sendto
435 recvfrom
436 setcontext
437 polmatch
438}
439
440# Updated Netlink class for KOBJECT_UEVENT family.
441class netlink_kobject_uevent_socket
442inherits socket
443
444class appletalk_socket
445inherits socket
446
447class packet
448{
449 send
450 recv
451 relabelto
452 flow_in # deprecated
453 flow_out # deprecated
454 forward_in
455 forward_out
456}
457
458class key
459{
460 view
461 read
462 write
463 search
464 link
465 setattr
466 create
467}
468
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500469class dccp_socket
470inherits socket
471{
472 node_bind
473 name_connect
474}
475
476class memprotect
477{
478 mmap_zero
479}
480
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500481# network peer labels
482class peer
483{
484 recv
485}
486
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500487class kernel_service
488{
489 use_as_override
490 create_files_as
491}
492
493class tun_socket
494inherits socket
Nick Kralevichd7af45d2014-06-06 16:51:11 -0700495{
496 attach_queue
497}
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500498
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500499class binder
500{
501 impersonate
502 call
503 set_context_mgr
504 transfer
Stephen Smalley2dd4e512012-01-04 12:33:27 -0500505}
506
Stephen Smalley01d95c22015-05-21 16:17:26 -0400507class netlink_iscsi_socket
508inherits socket
509
510class netlink_fib_lookup_socket
511inherits socket
512
513class netlink_connector_socket
514inherits socket
515
516class netlink_netfilter_socket
517inherits socket
518
519class netlink_generic_socket
520inherits socket
521
522class netlink_scsitransport_socket
523inherits socket
524
525class netlink_rdma_socket
526inherits socket
527
528class netlink_crypto_socket
529inherits socket
530
Nick Kralevichea1775d2018-11-01 19:39:44 -0700531class infiniband_pkey
532{
533 access
534}
535
536class infiniband_endport
537{
538 manage_subnet
539}
540
Stephen Smalley8a003602016-04-27 09:42:57 -0400541#
542# Define the access vector interpretation for controlling capabilities
543# in user namespaces
544#
545
546class cap_userns
547inherits cap
548
549class cap2_userns
550inherits cap2
551
Stephen Smalley431bdd92016-12-08 13:35:27 -0500552
553#
554# Define the access vector interpretation for the new socket classes
555# enabled by the extended_socket_class policy capability.
556#
557
558#
559# The next two classes were previously mapped to rawip_socket and therefore
560# have the same definition as rawip_socket (until further permissions
561# are defined).
562#
563class sctp_socket
564inherits socket
565{
566 node_bind
Nick Kralevichea1775d2018-11-01 19:39:44 -0700567 name_connect
568 association
Stephen Smalley431bdd92016-12-08 13:35:27 -0500569}
570
571class icmp_socket
572inherits socket
573{
574 node_bind
575}
576
577#
578# The remaining network socket classes were previously
579# mapped to the socket class and therefore have the
580# same definition as socket.
581#
582
583class ax25_socket
584inherits socket
585
586class ipx_socket
587inherits socket
588
589class netrom_socket
590inherits socket
591
592class atmpvc_socket
593inherits socket
594
595class x25_socket
596inherits socket
597
598class rose_socket
599inherits socket
600
601class decnet_socket
602inherits socket
603
604class atmsvc_socket
605inherits socket
606
607class rds_socket
608inherits socket
609
610class irda_socket
611inherits socket
612
613class pppox_socket
614inherits socket
615
616class llc_socket
617inherits socket
618
619class can_socket
620inherits socket
621
622class tipc_socket
623inherits socket
624
625class bluetooth_socket
626inherits socket
627
628class iucv_socket
629inherits socket
630
631class rxrpc_socket
632inherits socket
633
634class isdn_socket
635inherits socket
636
637class phonet_socket
638inherits socket
639
640class ieee802154_socket
641inherits socket
642
643class caif_socket
644inherits socket
645
646class alg_socket
647inherits socket
648
649class nfc_socket
650inherits socket
651
652class vsock_socket
653inherits socket
654
655class kcm_socket
656inherits socket
657
658class qipcrtr_socket
659inherits socket
660
Stephen Smalley2be97992017-05-17 12:06:49 -0400661class smc_socket
662inherits socket
663
Nick Kralevichf5a1b1b2018-10-18 09:08:26 -0700664class bpf
665{
666 map_create
667 map_read
668 map_write
669 prog_load
670 prog_run
671}
672
Stephen Smalley124720a2012-04-04 10:11:16 -0400673class property_service
674{
675 set
676}
Riley Spahnf90c41f2014-06-05 15:52:02 -0700677
678class service_manager
679{
680 add
Riley Spahnb8511e02014-07-07 13:56:27 -0700681 find
682 list
Riley Spahnf90c41f2014-06-05 15:52:02 -0700683}
Riley Spahn1196d2a2014-06-17 14:58:52 -0700684
Martijn Coenenbc6d88d2017-04-06 09:24:41 -0700685class hwservice_manager
686{
687 add
688 find
689 list
690}
691
Riley Spahn1196d2a2014-06-17 14:58:52 -0700692class keystore_key
693{
Chad Brubakercbc8f792015-05-13 14:39:48 -0700694 get_state
Riley Spahn1196d2a2014-06-17 14:58:52 -0700695 get
696 insert
697 delete
698 exist
Chad Brubakercbc8f792015-05-13 14:39:48 -0700699 list
Riley Spahn1196d2a2014-06-17 14:58:52 -0700700 reset
701 password
702 lock
703 unlock
Chad Brubakercbc8f792015-05-13 14:39:48 -0700704 is_empty
Riley Spahn1196d2a2014-06-17 14:58:52 -0700705 sign
706 verify
707 grant
708 duplicate
709 clear_uid
Chad Brubaker89277722015-03-31 13:03:06 -0700710 add_auth
Chad Brubaker520bb812015-05-12 12:33:40 -0700711 user_changed
Shawn Willdena0c7f012017-04-11 09:41:25 -0600712 gen_unique_id
Riley Spahn1196d2a2014-06-17 14:58:52 -0700713}
Stephen Smalleyba992492014-07-24 15:25:43 -0400714
Riley Spahn70f75ce2014-07-02 12:42:59 -0700715class drmservice {
716 consumeRights
717 setPlaybackStatus
718 openDecryptSession
719 closeDecryptSession
720 initializeDecryptUnit
721 decrypt
722 finalizeDecryptUnit
723 pread
724}
Nick Kralevichea1775d2018-11-01 19:39:44 -0700725
726class xdp_socket
727inherits socket
Ryan Savitski80640c52020-01-08 17:30:26 +0000728
729class perf_event
730{
731 open
732 cpu
733 kernel
734 tracepoint
735 read
736 write
737}