Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 1 | #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 Paris | 49b7b8d | 2010-07-23 11:44:09 -0400 | [diff] [blame] | 5 | "rename", "execute", "swapon", "quotaon", "mounton", "audit_access", \ |
Eric Paris | b424485 | 2010-07-23 11:44:15 -0400 | [diff] [blame] | 6 | "open", "execmod" |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 7 | |
| 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 | |
| 15 | struct 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", |
Eric Paris | cee74f4 | 2010-10-13 17:50:25 -0400 | [diff] [blame] | 20 | "setcheckreqprot", "read_policy", NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 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 Paris | b424485 | 2010-07-23 11:44:15 -0400 | [diff] [blame] | 47 | "execute_no_trans", "entrypoint", NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 48 | { "dir", |
| 49 | { COMMON_FILE_PERMS, "add_name", "remove_name", |
Eric Paris | 49b7b8d | 2010-07-23 11:44:09 -0400 | [diff] [blame] | 50 | "reparent", "search", "rmdir", NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 51 | { "fd", { "use", NULL } }, |
| 52 | { "lnk_file", |
| 53 | { COMMON_FILE_PERMS, NULL } }, |
| 54 | { "chr_file", |
Eric Paris | b424485 | 2010-07-23 11:44:15 -0400 | [diff] [blame] | 55 | { COMMON_FILE_PERMS, NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 56 | { "blk_file", |
Eric Paris | 49b7b8d | 2010-07-23 11:44:09 -0400 | [diff] [blame] | 57 | { COMMON_FILE_PERMS, NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 58 | { "sock_file", |
Eric Paris | 49b7b8d | 2010-07-23 11:44:09 -0400 | [diff] [blame] | 59 | { COMMON_FILE_PERMS, NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 60 | { "fifo_file", |
Eric Paris | 49b7b8d | 2010-07-23 11:44:09 -0400 | [diff] [blame] | 61 | { COMMON_FILE_PERMS, NULL } }, |
Stephen Smalley | c6d3aaa | 2009-09-30 13:37:50 -0400 | [diff] [blame] | 62 | { "socket", |
| 63 | { COMMON_SOCK_PERMS, NULL } }, |
| 64 | { "tcp_socket", |
| 65 | { COMMON_SOCK_PERMS, |
| 66 | "connectto", "newconn", "acceptfrom", "node_bind", "name_connect", |
| 67 | NULL } }, |
| 68 | { "udp_socket", |
| 69 | { COMMON_SOCK_PERMS, |
| 70 | "node_bind", NULL } }, |
| 71 | { "rawip_socket", |
| 72 | { COMMON_SOCK_PERMS, |
| 73 | "node_bind", NULL } }, |
| 74 | { "node", |
| 75 | { "tcp_recv", "tcp_send", "udp_recv", "udp_send", |
| 76 | "rawip_recv", "rawip_send", "enforce_dest", |
| 77 | "dccp_recv", "dccp_send", "recvfrom", "sendto", NULL } }, |
| 78 | { "netif", |
| 79 | { "tcp_recv", "tcp_send", "udp_recv", "udp_send", |
| 80 | "rawip_recv", "rawip_send", "dccp_recv", "dccp_send", |
| 81 | "ingress", "egress", NULL } }, |
| 82 | { "netlink_socket", |
| 83 | { COMMON_SOCK_PERMS, NULL } }, |
| 84 | { "packet_socket", |
| 85 | { COMMON_SOCK_PERMS, NULL } }, |
| 86 | { "key_socket", |
| 87 | { COMMON_SOCK_PERMS, NULL } }, |
| 88 | { "unix_stream_socket", |
| 89 | { COMMON_SOCK_PERMS, "connectto", "newconn", "acceptfrom", NULL |
| 90 | } }, |
| 91 | { "unix_dgram_socket", |
| 92 | { COMMON_SOCK_PERMS, NULL |
| 93 | } }, |
| 94 | { "sem", |
| 95 | { COMMON_IPC_PERMS, NULL } }, |
| 96 | { "msg", { "send", "receive", NULL } }, |
| 97 | { "msgq", |
| 98 | { COMMON_IPC_PERMS, "enqueue", NULL } }, |
| 99 | { "shm", |
| 100 | { COMMON_IPC_PERMS, "lock", NULL } }, |
| 101 | { "ipc", |
| 102 | { COMMON_IPC_PERMS, NULL } }, |
| 103 | { "netlink_route_socket", |
| 104 | { COMMON_SOCK_PERMS, |
| 105 | "nlmsg_read", "nlmsg_write", NULL } }, |
| 106 | { "netlink_firewall_socket", |
| 107 | { COMMON_SOCK_PERMS, |
| 108 | "nlmsg_read", "nlmsg_write", NULL } }, |
| 109 | { "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 } }, |
| 119 | { "netlink_audit_socket", |
| 120 | { COMMON_SOCK_PERMS, |
| 121 | "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv", |
| 122 | "nlmsg_tty_audit", NULL } }, |
| 123 | { "netlink_ip6fw_socket", |
| 124 | { COMMON_SOCK_PERMS, |
| 125 | "nlmsg_read", "nlmsg_write", NULL } }, |
| 126 | { "netlink_dnrt_socket", |
| 127 | { COMMON_SOCK_PERMS, NULL } }, |
| 128 | { "association", |
| 129 | { "sendto", "recvfrom", "setcontext", "polmatch", NULL } }, |
| 130 | { "netlink_kobject_uevent_socket", |
| 131 | { COMMON_SOCK_PERMS, NULL } }, |
| 132 | { "appletalk_socket", |
| 133 | { COMMON_SOCK_PERMS, NULL } }, |
| 134 | { "packet", |
| 135 | { "send", "recv", "relabelto", "flow_in", "flow_out", |
| 136 | "forward_in", "forward_out", NULL } }, |
| 137 | { "key", |
| 138 | { "view", "read", "write", "search", "link", "setattr", "create", |
| 139 | NULL } }, |
| 140 | { "dccp_socket", |
| 141 | { COMMON_SOCK_PERMS, |
| 142 | "node_bind", "name_connect", NULL } }, |
| 143 | { "memprotect", { "mmap_zero", NULL } }, |
| 144 | { "peer", { "recv", NULL } }, |
| 145 | { "capability2", { "mac_override", "mac_admin", NULL } }, |
| 146 | { "kernel_service", { "use_as_override", "create_files_as", NULL } }, |
| 147 | { "tun_socket", |
| 148 | { COMMON_SOCK_PERMS, NULL } }, |
| 149 | { NULL } |
| 150 | }; |