cjdns.te 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. policy_module(cjdns,1.0.0)
  2. require {
  3. type urandom_device_t;
  4. type tun_tap_device_t;
  5. type node_t;
  6. type port_t;
  7. type unreserved_port_t;
  8. type tmp_t;
  9. type kernel_t;
  10. type passwd_file_t;
  11. }
  12. type cjdns_t;
  13. type cjdns_exec_t;
  14. init_daemon_domain(cjdns_t,cjdns_exec_t);
  15. #============= cjdns_t ==============
  16. # Let master process run further restricted subprocess
  17. allow cjdns_t cjdns_exec_t:file { execute_no_trans execmod };
  18. allow cjdns_t self:capability { net_admin net_raw setuid setgid sys_chroot sys_module };
  19. allow cjdns_t self:process { signal getcap setrlimit setcap };
  20. allow cjdns_t kernel_t:system module_request;
  21. # translate username to uid
  22. allow cjdns_t passwd_file_t:file { read getattr open };
  23. # allow network access
  24. allow cjdns_t node_t:udp_socket node_bind;
  25. allow cjdns_t port_t:udp_socket name_bind;
  26. allow cjdns_t unreserved_port_t:udp_socket name_bind;
  27. allow cjdns_t self:netlink_route_socket { bind create getattr nlmsg_read read write };
  28. allow cjdns_t self:packet_socket { bind create ioctl read write };
  29. allow cjdns_t self:tun_socket create;
  30. allow cjdns_t self:udp_socket { create setopt bind ioctl getattr read write };
  31. allow cjdns_t tun_tap_device_t:chr_file { read write open ioctl };
  32. # management API
  33. allow cjdns_t self:unix_stream_socket connectto;
  34. allow cjdns_t tmp_t:sock_file { write create unlink };
  35. allow cjdns_t tmp_t:dir { write remove_name add_name };
  36. allow cjdns_t urandom_device_t:chr_file { read open };
  37. #!!!! The source type 'cjdns_t' can write to a 'dir' of the following types:
  38. # cluster_var_lib_t, cluster_var_run_t, root_t, cluster_conf_t
  39. #!!!! The source type 'cjdns_t' can write to a 'chr_file' of the following types:
  40. # initrc_devpts_t, null_device_t, zero_device_t, devtty_t, ptynode, ttynode, tty_device_t, devpts_t