summaryrefslogtreecommitdiffstats
path: root/memcached.te
diff options
context:
space:
mode:
Diffstat (limited to 'memcached.te')
-rw-r--r--memcached.te61
1 files changed, 61 insertions, 0 deletions
diff --git a/memcached.te b/memcached.te
new file mode 100644
index 0000000..5748859
--- /dev/null
+++ b/memcached.te
@@ -0,0 +1,61 @@
+policy_module(memcached, 1.0.1)
+
+require {
+ attribute port_type;
+};
+
+#####################################
+#
+# Declarations
+#
+type memcached_t;
+type memcached_exec_t;
+
+type memcached_var_run_t;
+type memcached_port_t, port_type;
+
+
+########################################
+#
+# Local policy
+#
+init_daemon_domain(memcached_t, memcached_exec_t)
+domain_use_interactive_fds(memcached_t)
+init_use_fds(memcached_t)
+
+files_pid_file(memcached_var_run_t)
+
+allow memcached_t self:capability { setgid setuid };
+dontaudit memcached_t self:capability sys_tty_config;
+allow memcached_t self:process signal_perms;
+allow memcached_t self:fifo_file rw_file_perms;
+allow memcached_t self:unix_stream_socket create_stream_socket_perms;
+
+allow memcached_t memcached_port_t:tcp_socket name_bind;
+allow memcached_t memcached_port_t:udp_socket name_bind;
+allow memcached_t self:tcp_socket create_stream_socket_perms;
+allow memcached_t self:udp_socket create_stream_socket_perms;
+
+corenet_non_ipsec_sendrecv(memcached_t)
+corenet_tcp_sendrecv_all_if(memcached_t)
+corenet_udp_sendrecv_all_if(memcached_t)
+corenet_tcp_sendrecv_all_nodes(memcached_t)
+corenet_udp_sendrecv_all_nodes(memcached_t)
+corenet_tcp_bind_all_nodes(memcached_t)
+corenet_udp_bind_all_nodes(memcached_t)
+
+allow memcached_t memcached_var_run_t:file create_file_perms;
+allow memcached_t memcached_var_run_t:dir rw_dir_perms;
+files_pid_filetrans(memcached_t, memcached_var_run_t, file)
+
+kernel_read_kernel_sysctls(memcached_t)
+kernel_read_system_state(memcached_t)
+
+libs_use_ld_so(memcached_t)
+libs_use_shared_libs(memcached_t)
+
+files_read_etc_files(memcached_t)
+
+term_dontaudit_use_all_user_ptys(memcached_t)
+term_dontaudit_use_all_user_ttys(memcached_t)
+term_dontaudit_use_console(memcached_t)