apticron.te 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. policy_module(apticron, 0.1.8)
  2. #################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role apticron_roles;
  7. type apticron_t;
  8. type apticron_exec_t;
  9. init_system_domain(apticron_t, apticron_exec_t)
  10. role apticron_roles types apticron_t;
  11. type apticron_var_lib_t;
  12. files_type(apticron_var_lib_t)
  13. type apticron_tmp_t;
  14. files_tmp_file(apticron_tmp_t)
  15. type apticron_etc_t;
  16. files_config_file(apticron_etc_t)
  17. ########################################
  18. #
  19. # Local policy
  20. #
  21. allow apticron_t self:fifo_file { read write ioctl getattr };
  22. allow apticron_t self:capability setgid;
  23. allow apticron_t self:netlink_route_socket { write getattr read bind create nlmsg_read };
  24. allow apticron_t self:process getsched;
  25. allow apticron_t self:tcp_socket { read write create connect };
  26. allow apticron_t self:udp_socket { create connect getattr };
  27. manage_files_pattern(apticron_t, apticron_tmp_t, apticron_tmp_t)
  28. manage_dirs_pattern(apticron_t, apticron_tmp_t, apticron_tmp_t)
  29. files_tmp_filetrans(apticron_t, apticron_tmp_t, { file dir })
  30. manage_files_pattern(apticron_t, apticron_var_lib_t, apticron_var_lib_t)
  31. files_var_lib_filetrans(apticron_t, apticron_var_lib_t, file)
  32. read_files_pattern(apticron_t, apticron_etc_t, apticron_etc_t)
  33. apt_domtrans(apticron_t)
  34. dpkg_run(apticron_t, apticron_roles)
  35. hostname_domtrans(apticron_t)
  36. sysnet_domtrans_ifconfig(apticron_t)
  37. corecmd_exec_shell(apticron_t)
  38. corecmd_exec_bin(apticron_t)
  39. miscfiles_read_localization(apticron_t)
  40. kernel_read_system_state(apticron_t)
  41. fs_getattr_xattr_fs(apticron_t)
  42. dev_read_urand(apticron_t)
  43. sysnet_read_config(apticron_t)
  44. corenet_tcp_connect_smtp_port(apticron_t)
  45. gen_require(`
  46. type apt_var_cache_t;
  47. ')
  48. allow apticron_t apt_var_cache_t:dir { write read getattr open search };
  49. allow apticron_t apt_var_cache_t:file { read getattr open };
  50. gen_require(`
  51. type apt_var_lib_t;
  52. ')
  53. allow apticron_t apt_var_lib_t:dir { read open search };
  54. allow apticron_t apt_var_lib_t:file { read ioctl open getattr };
  55. gen_require(`
  56. type crond_tmp_t;
  57. ')
  58. allow apticron_t crond_tmp_t:file { read write getattr ioctl };
  59. gen_require(`
  60. type etc_t;
  61. ')
  62. allow apticron_t etc_t:file { read getattr open };
  63. gen_require(`
  64. type usr_t;
  65. ')
  66. allow apticron_t usr_t:file { read getattr open };
  67. optional_policy(`
  68. cron_system_entry(apticron_t, apticron_exec_t)
  69. ')
  70. gen_require(`
  71. type dpkg_var_lib_t;
  72. ')
  73. allow apticron_t dpkg_var_lib_t:file { read getattr open };
  74. allow apticron_t dpkg_var_lib_t:dir { read search open };