classmap.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #define COMMON_FILE_SOCK_PERMS "ioctl", "read", "write", "create", \
  2. "getattr", "setattr", "lock", "relabelfrom", "relabelto", "append"
  3. #define COMMON_FILE_PERMS COMMON_FILE_SOCK_PERMS, "unlink", "link", \
  4. "rename", "execute", "quotaon", "mounton", "audit_access", \
  5. "open", "execmod"
  6. #define COMMON_SOCK_PERMS COMMON_FILE_SOCK_PERMS, "bind", "connect", \
  7. "listen", "accept", "getopt", "setopt", "shutdown", "recvfrom", \
  8. "sendto", "name_bind"
  9. #define COMMON_IPC_PERMS "create", "destroy", "getattr", "setattr", "read", \
  10. "write", "associate", "unix_read", "unix_write"
  11. #define COMMON_CAP_PERMS "chown", "dac_override", "dac_read_search", \
  12. "fowner", "fsetid", "kill", "setgid", "setuid", "setpcap", \
  13. "linux_immutable", "net_bind_service", "net_broadcast", \
  14. "net_admin", "net_raw", "ipc_lock", "ipc_owner", "sys_module", \
  15. "sys_rawio", "sys_chroot", "sys_ptrace", "sys_pacct", "sys_admin", \
  16. "sys_boot", "sys_nice", "sys_resource", "sys_time", \
  17. "sys_tty_config", "mknod", "lease", "audit_write", \
  18. "audit_control", "setfcap"
  19. #define COMMON_CAP2_PERMS "mac_override", "mac_admin", "syslog", \
  20. "wake_alarm", "block_suspend", "audit_read"
  21. /*
  22. * Note: The name for any socket class should be suffixed by "socket",
  23. * and doesn't contain more than one substr of "socket".
  24. */
  25. struct security_class_mapping secclass_map[] = {
  26. { "security",
  27. { "compute_av", "compute_create", "compute_member",
  28. "check_context", "load_policy", "compute_relabel",
  29. "compute_user", "setenforce", "setbool", "setsecparam",
  30. "setcheckreqprot", "read_policy", "validate_trans", NULL } },
  31. { "process",
  32. { "fork", "transition", "sigchld", "sigkill",
  33. "sigstop", "signull", "signal", "ptrace", "getsched", "setsched",
  34. "getsession", "getpgid", "setpgid", "getcap", "setcap", "share",
  35. "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
  36. "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
  37. "execmem", "execstack", "execheap", "setkeycreate",
  38. "setsockcreate", NULL } },
  39. { "system",
  40. { "ipc_info", "syslog_read", "syslog_mod",
  41. "syslog_console", "module_request", "module_load", NULL } },
  42. { "capability",
  43. { COMMON_CAP_PERMS, NULL } },
  44. { "filesystem",
  45. { "mount", "remount", "unmount", "getattr",
  46. "relabelfrom", "relabelto", "associate", "quotamod",
  47. "quotaget", NULL } },
  48. { "file",
  49. { COMMON_FILE_PERMS,
  50. "execute_no_trans", "entrypoint", NULL } },
  51. { "dir",
  52. { COMMON_FILE_PERMS, "add_name", "remove_name",
  53. "reparent", "search", "rmdir", NULL } },
  54. { "fd", { "use", NULL } },
  55. { "lnk_file",
  56. { COMMON_FILE_PERMS, NULL } },
  57. { "chr_file",
  58. { COMMON_FILE_PERMS, NULL } },
  59. { "blk_file",
  60. { COMMON_FILE_PERMS, NULL } },
  61. { "sock_file",
  62. { COMMON_FILE_PERMS, NULL } },
  63. { "fifo_file",
  64. { COMMON_FILE_PERMS, NULL } },
  65. { "socket",
  66. { COMMON_SOCK_PERMS, NULL } },
  67. { "tcp_socket",
  68. { COMMON_SOCK_PERMS,
  69. "node_bind", "name_connect",
  70. NULL } },
  71. { "udp_socket",
  72. { COMMON_SOCK_PERMS,
  73. "node_bind", NULL } },
  74. { "rawip_socket",
  75. { COMMON_SOCK_PERMS,
  76. "node_bind", NULL } },
  77. { "node",
  78. { "recvfrom", "sendto", NULL } },
  79. { "netif",
  80. { "ingress", "egress", NULL } },
  81. { "netlink_socket",
  82. { COMMON_SOCK_PERMS, NULL } },
  83. { "packet_socket",
  84. { COMMON_SOCK_PERMS, NULL } },
  85. { "key_socket",
  86. { COMMON_SOCK_PERMS, NULL } },
  87. { "unix_stream_socket",
  88. { COMMON_SOCK_PERMS, "connectto", NULL } },
  89. { "unix_dgram_socket",
  90. { COMMON_SOCK_PERMS, NULL } },
  91. { "sem",
  92. { COMMON_IPC_PERMS, NULL } },
  93. { "msg", { "send", "receive", NULL } },
  94. { "msgq",
  95. { COMMON_IPC_PERMS, "enqueue", NULL } },
  96. { "shm",
  97. { COMMON_IPC_PERMS, "lock", NULL } },
  98. { "ipc",
  99. { COMMON_IPC_PERMS, NULL } },
  100. { "netlink_route_socket",
  101. { COMMON_SOCK_PERMS,
  102. "nlmsg_read", "nlmsg_write", NULL } },
  103. { "netlink_tcpdiag_socket",
  104. { COMMON_SOCK_PERMS,
  105. "nlmsg_read", "nlmsg_write", NULL } },
  106. { "netlink_nflog_socket",
  107. { COMMON_SOCK_PERMS, NULL } },
  108. { "netlink_xfrm_socket",
  109. { COMMON_SOCK_PERMS,
  110. "nlmsg_read", "nlmsg_write", NULL } },
  111. { "netlink_selinux_socket",
  112. { COMMON_SOCK_PERMS, NULL } },
  113. { "netlink_iscsi_socket",
  114. { COMMON_SOCK_PERMS, NULL } },
  115. { "netlink_audit_socket",
  116. { COMMON_SOCK_PERMS,
  117. "nlmsg_read", "nlmsg_write", "nlmsg_relay", "nlmsg_readpriv",
  118. "nlmsg_tty_audit", NULL } },
  119. { "netlink_fib_lookup_socket",
  120. { COMMON_SOCK_PERMS, NULL } },
  121. { "netlink_connector_socket",
  122. { COMMON_SOCK_PERMS, NULL } },
  123. { "netlink_netfilter_socket",
  124. { COMMON_SOCK_PERMS, NULL } },
  125. { "netlink_dnrt_socket",
  126. { COMMON_SOCK_PERMS, NULL } },
  127. { "association",
  128. { "sendto", "recvfrom", "setcontext", "polmatch", NULL } },
  129. { "netlink_kobject_uevent_socket",
  130. { COMMON_SOCK_PERMS, NULL } },
  131. { "netlink_generic_socket",
  132. { COMMON_SOCK_PERMS, NULL } },
  133. { "netlink_scsitransport_socket",
  134. { COMMON_SOCK_PERMS, NULL } },
  135. { "netlink_rdma_socket",
  136. { COMMON_SOCK_PERMS, NULL } },
  137. { "netlink_crypto_socket",
  138. { COMMON_SOCK_PERMS, NULL } },
  139. { "appletalk_socket",
  140. { COMMON_SOCK_PERMS, NULL } },
  141. { "packet",
  142. { "send", "recv", "relabelto", "forward_in", "forward_out", NULL } },
  143. { "key",
  144. { "view", "read", "write", "search", "link", "setattr", "create",
  145. NULL } },
  146. { "dccp_socket",
  147. { COMMON_SOCK_PERMS,
  148. "node_bind", "name_connect", NULL } },
  149. { "memprotect", { "mmap_zero", NULL } },
  150. { "peer", { "recv", NULL } },
  151. { "capability2",
  152. { COMMON_CAP2_PERMS, NULL } },
  153. { "kernel_service", { "use_as_override", "create_files_as", NULL } },
  154. { "tun_socket",
  155. { COMMON_SOCK_PERMS, "attach_queue", NULL } },
  156. { "binder", { "impersonate", "call", "set_context_mgr", "transfer",
  157. NULL } },
  158. { "cap_userns",
  159. { COMMON_CAP_PERMS, NULL } },
  160. { "cap2_userns",
  161. { COMMON_CAP2_PERMS, NULL } },
  162. { NULL }
  163. };