blob: 41990cbba76040e192093b98d9f83601112476a9 [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", \
Eric Paris49b7b8d2010-07-23 11:44:09 -04005 "rename", "execute", "swapon", "quotaon", "mounton", "audit_access", \
6 "open"
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", \
10 "sendto", "recv_msg", "send_msg", "name_bind"
11
12#define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
13 "write", "associate", "unix_read", "unix_write"
14
15struct security_class_mapping secclass_map[] = {
16 { "security",
17 { "compute_av", "compute_create", "compute_member",
18 "check_context", "load_policy", "compute_relabel",
19 "compute_user", "setenforce", "setbool", "setsecparam",
20 "setcheckreqprot", NULL } },
21 { "process",
22 { "fork", "transition", "sigchld", "sigkill",
23 "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
24 "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
25 "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
26 "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
27 "execmem", "execstack", "execheap", "setkeycreate",
28 "setsockcreate", NULL } },
29 { "system",
30 { "ipc_info", "syslog_read", "syslog_mod",
31 "syslog_console", "module_request", NULL } },
32 { "capability",
33 { "chown", "dac_override", "dac_read_search",
34 "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap",
35 "linux_immutable", "net_bind_service", "net_broadcast",
36 "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module",
37 "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin",
38 "sys_boot", "sys_nice", "sys_resource", "sys_time",
39 "sys_tty_config", "mknod", "lease", "audit_write",
40 "audit_control", "setfcap", NULL } },
41 { "filesystem",
42 { "mount", "remount", "unmount", "getattr",
43 "relabelfrom", "relabelto", "transition", "associate", "quotamod",
44 "quotaget", NULL } },
45 { "file",
46 { COMMON_FILE_PERMS,
Eric Paris49b7b8d2010-07-23 11:44:09 -040047 "execute_no_trans", "entrypoint", "execmod", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040048 { "dir",
49 { COMMON_FILE_PERMS, "add_name", "remove_name",
Eric Paris49b7b8d2010-07-23 11:44:09 -040050 "reparent", "search", "rmdir", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040051 { "fd", { "use", NULL } },
52 { "lnk_file",
53 { COMMON_FILE_PERMS, NULL } },
54 { "chr_file",
55 { COMMON_FILE_PERMS,
Eric Paris49b7b8d2010-07-23 11:44:09 -040056 "execute_no_trans", "entrypoint", "execmod", NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040057 { "blk_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040058 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040059 { "sock_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040060 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040061 { "fifo_file",
Eric Paris49b7b8d2010-07-23 11:44:09 -040062 { COMMON_FILE_PERMS, NULL } },
Stephen Smalleyc6d3aaa2009-09-30 13:37:50 -040063 { "socket",
64 { COMMON_SOCK_PERMS, NULL } },
65 { "tcp_socket",
66 { COMMON_SOCK_PERMS,
67 "connectto", "newconn", "acceptfrom", "node_bind", "name_connect",
68 NULL } },
69 { "udp_socket",
70 { COMMON_SOCK_PERMS,
71 "node_bind", NULL } },
72 { "rawip_socket",
73 { COMMON_SOCK_PERMS,
74 "node_bind", NULL } },
75 { "node",
76 { "tcp_recv", "tcp_send", "udp_recv", "udp_send",
77 "rawip_recv", "rawip_send", "enforce_dest",
78 "dccp_recv", "dccp_send", "recvfrom", "sendto", NULL } },
79 { "netif",
80 { "tcp_recv", "tcp_send", "udp_recv", "udp_send",
81 "rawip_recv", "rawip_send", "dccp_recv", "dccp_send",
82 "ingress", "egress", NULL } },
83 { "netlink_socket",
84 { COMMON_SOCK_PERMS, NULL } },
85 { "packet_socket",
86 { COMMON_SOCK_PERMS, NULL } },
87 { "key_socket",
88 { COMMON_SOCK_PERMS, NULL } },
89 { "unix_stream_socket",
90 { COMMON_SOCK_PERMS, "connectto", "newconn", "acceptfrom", NULL
91 } },
92 { "unix_dgram_socket",
93 { COMMON_SOCK_PERMS, NULL
94 } },
95 { "sem",
96 { COMMON_IPC_PERMS, NULL } },
97 { "msg", { "send", "receive", NULL } },
98 { "msgq",
99 { COMMON_IPC_PERMS, "enqueue", NULL } },
100 { "shm",
101 { COMMON_IPC_PERMS, "lock", NULL } },
102 { "ipc",
103 { COMMON_IPC_PERMS, NULL } },
104 { "netlink_route_socket",
105 { COMMON_SOCK_PERMS,
106 "nlmsg_read", "nlmsg_write", NULL } },
107 { "netlink_firewall_socket",
108 { COMMON_SOCK_PERMS,
109 "nlmsg_read", "nlmsg_write", NULL } },
110 { "netlink_tcpdiag_socket",
111 { COMMON_SOCK_PERMS,
112 "nlmsg_read", "nlmsg_write", NULL } },
113 { "netlink_nflog_socket",
114 { COMMON_SOCK_PERMS, NULL } },
115 { "netlink_xfrm_socket",
116 { COMMON_SOCK_PERMS,
117 "nlmsg_read", "nlmsg_write", NULL } },
118 { "netlink_selinux_socket",
119 { COMMON_SOCK_PERMS, NULL } },
120 { "netlink_audit_socket",
121 { COMMON_SOCK_PERMS,
122 "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
123 "nlmsg_tty_audit", NULL } },
124 { "netlink_ip6fw_socket",
125 { COMMON_SOCK_PERMS,
126 "nlmsg_read", "nlmsg_write", NULL } },
127 { "netlink_dnrt_socket",
128 { COMMON_SOCK_PERMS, NULL } },
129 { "association",
130 { "sendto", "recvfrom", "setcontext", "polmatch", NULL } },
131 { "netlink_kobject_uevent_socket",
132 { COMMON_SOCK_PERMS, NULL } },
133 { "appletalk_socket",
134 { COMMON_SOCK_PERMS, NULL } },
135 { "packet",
136 { "send", "recv", "relabelto", "flow_in", "flow_out",
137 "forward_in", "forward_out", NULL } },
138 { "key",
139 { "view", "read", "write", "search", "link", "setattr", "create",
140 NULL } },
141 { "dccp_socket",
142 { COMMON_SOCK_PERMS,
143 "node_bind", "name_connect", NULL } },
144 { "memprotect", { "mmap_zero", NULL } },
145 { "peer", { "recv", NULL } },
146 { "capability2", { "mac_override", "mac_admin", NULL } },
147 { "kernel_service", { "use_as_override", "create_files_as", NULL } },
148 { "tun_socket",
149 { COMMON_SOCK_PERMS, NULL } },
150 { NULL }
151 };