blob: 1f1f4b2f6018de5f3599d02aff1811c4f3aa85ed [file] [log] [blame]
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -04001#define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
2 "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
3
4#define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \
Stephen Smalley42a96992015-06-04 16:22:17 -04005 "rename", "execute", "quotaon", "mounton", "audit_access", \
Eric Parisb4244852010-07-23 11:44:15 -04006 "open", "execmod"
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -04007
8#define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
9 "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom", \
Stephen Smalley42a96992015-06-04 16:22:17 -040010 "sendto", "name_bind"
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040011
12#define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
13 "write", "associate", "unix_read", "unix_write"
14
Stephen Smalley8e4ff6f2016-04-08 13:52:00 -040015#define COMMON_CAP_PERMS "chown", "dac_override", "dac_read_search", \
16 "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap", \
17 "linux_immutable", "net_bind_service", "net_broadcast", \
18 "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module", \
19 "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin", \
20 "sys_boot", "sys_nice", "sys_resource", "sys_time", \
21 "sys_tty_config", "mknod", "lease", "audit_write", \
22 "audit_control", "setfcap"
23
24#define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \
25 "wake_alarm", "block_suspend", "audit_read"
26
Harry Ciao4bc6c2d2011-03-02 13:46:08 +080027/*
28 * Note: The name for any socket class should be suffixed by "socket",
29 * and doesn't contain more than one substr of "socket".
30 */
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040031struct security_class_mapping secclass_map[] = {
32 { "security",
33 { "compute_av", "compute_create", "compute_member",
34 "check_context", "load_policy", "compute_relabel",
35 "compute_user", "setenforce", "setbool", "setsecparam",
Andrew Perepechkof9df6452015-12-24 11:09:41 -050036 "setcheckreqprot", "read_policy", "validate_trans", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040037 { "process",
38 { "fork", "transition", "sigchld", "sigkill",
39 "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
40 "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
41 "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
42 "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
43 "execmem", "execstack", "execheap", "setkeycreate",
44 "setsockcreate", NULL } },
45 { "system",
46 { "ipc_info", "syslog_read", "syslog_mod",
Jeff Vander Stoep61d612e2016-04-05 13:06:27 -070047 "syslog_console", "module_request", "module_load", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040048 { "capability",
Stephen Smalley8e4ff6f2016-04-08 13:52:00 -040049 { COMMON_CAP_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040050 { "filesystem",
51 { "mount", "remount", "unmount", "getattr",
Stephen Smalley42a96992015-06-04 16:22:17 -040052 "relabelfrom", "relabelto", "associate", "quotamod",
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040053 "quotaget", NULL } },
54 { "file",
55 { COMMON_FILE_PERMS,
Eric Parisb4244852010-07-23 11:44:15 -040056 "execute_no_trans", "entrypoint", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040057 { "dir",
58 { COMMON_FILE_PERMS, "add_name", "remove_name",
Eric Paris49b7b8d2010-07-23 11:44:09 -040059 "reparent", "search", "rmdir", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040060 { "fd", { "use", NULL } },
61 { "lnk_file",
62 { COMMON_FILE_PERMS, NULL } },
63 { "chr_file",
Eric Parisb4244852010-07-23 11:44:15 -040064 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040065 { "blk_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040066 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040067 { "sock_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040068 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040069 { "fifo_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040070 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040071 { "socket",
72 { COMMON_SOCK_PERMS, NULL } },
73 { "tcp_socket",
74 { COMMON_SOCK_PERMS,
Stephen Smalley42a96992015-06-04 16:22:17 -040075 "node_bind", "name_connect",
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040076 NULL } },
77 { "udp_socket",
78 { COMMON_SOCK_PERMS,
79 "node_bind", NULL } },
80 { "rawip_socket",
81 { COMMON_SOCK_PERMS,
82 "node_bind", NULL } },
83 { "node",
Stephen Smalley42a96992015-06-04 16:22:17 -040084 { "recvfrom", "sendto", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040085 { "netif",
Stephen Smalley42a96992015-06-04 16:22:17 -040086 { "ingress", "egress", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040087 { "netlink_socket",
88 { COMMON_SOCK_PERMS, NULL } },
89 { "packet_socket",
90 { COMMON_SOCK_PERMS, NULL } },
91 { "key_socket",
92 { COMMON_SOCK_PERMS, NULL } },
93 { "unix_stream_socket",
Stephen Smalley42a96992015-06-04 16:22:17 -040094 { COMMON_SOCK_PERMS, "connectto", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040095 { "unix_dgram_socket",
Stephen Smalley42a96992015-06-04 16:22:17 -040096 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040097 { "sem",
98 { COMMON_IPC_PERMS, NULL } },
99 { "msg", { "send", "receive", NULL } },
100 { "msgq",
101 { COMMON_IPC_PERMS, "enqueue", NULL } },
102 { "shm",
103 { COMMON_IPC_PERMS, "lock", NULL } },
104 { "ipc",
105 { COMMON_IPC_PERMS, NULL } },
106 { "netlink_route_socket",
107 { COMMON_SOCK_PERMS,
108 "nlmsg_read", "nlmsg_write", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400109 { "netlink_tcpdiag_socket",
110 { COMMON_SOCK_PERMS,
111 "nlmsg_read", "nlmsg_write", NULL } },
112 { "netlink_nflog_socket",
113 { COMMON_SOCK_PERMS, NULL } },
114 { "netlink_xfrm_socket",
115 { COMMON_SOCK_PERMS,
116 "nlmsg_read", "nlmsg_write", NULL } },
117 { "netlink_selinux_socket",
118 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalley6c6d2e92015-06-04 16:22:16 -0400119 { "netlink_iscsi_socket",
120 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400121 { "netlink_audit_socket",
122 { COMMON_SOCK_PERMS,
123 "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
124 "nlmsg_tty_audit", NULL } },
Stephen Smalley6c6d2e92015-06-04 16:22:16 -0400125 { "netlink_fib_lookup_socket",
126 { COMMON_SOCK_PERMS, NULL } },
127 { "netlink_connector_socket",
128 { COMMON_SOCK_PERMS, NULL } },
129 { "netlink_netfilter_socket",
130 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400131 { "netlink_dnrt_socket",
132 { COMMON_SOCK_PERMS, NULL } },
133 { "association",
134 { "sendto", "recvfrom", "setcontext", "polmatch", NULL } },
135 { "netlink_kobject_uevent_socket",
136 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalley6c6d2e92015-06-04 16:22:16 -0400137 { "netlink_generic_socket",
138 { COMMON_SOCK_PERMS, NULL } },
139 { "netlink_scsitransport_socket",
140 { COMMON_SOCK_PERMS, NULL } },
141 { "netlink_rdma_socket",
142 { COMMON_SOCK_PERMS, NULL } },
143 { "netlink_crypto_socket",
144 { COMMON_SOCK_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400145 { "appletalk_socket",
146 { COMMON_SOCK_PERMS, NULL } },
147 { "packet",
Eric Paris47ac19e2011-02-25 15:39:20 -0500148 { "send", "recv", "relabelto", "forward_in", "forward_out", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400149 { "key",
150 { "view", "read", "write", "search", "link", "setattr", "create",
151 NULL } },
152 { "dccp_socket",
153 { COMMON_SOCK_PERMS,
154 "node_bind", "name_connect", NULL } },
155 { "memprotect", { "mmap_zero", NULL } },
156 { "peer", { "recv", NULL } },
Eric Paris64919e62012-07-06 14:13:29 -0400157 { "capability2",
Stephen Smalley8e4ff6f2016-04-08 13:52:00 -0400158 { COMMON_CAP2_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400159 { "kernel_service", { "use_as_override", "create_files_as", NULL } },
160 { "tun_socket",
Paul Moore6f96c142013-01-14 07:12:13 +0000161 { COMMON_SOCK_PERMS, "attach_queue", NULL } },
Stephen Smalley79af7302015-01-21 10:54:10 -0500162 { "binder", { "impersonate", "call", "set_context_mgr", "transfer",
163 NULL } },
Stephen Smalley8e4ff6f2016-04-08 13:52:00 -0400164 { "cap_userns",
165 { COMMON_CAP_PERMS, NULL } },
166 { "cap2_userns",
167 { COMMON_CAP2_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -0400168 { NULL }
169 };