apticron.te 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. policy_module(apticron, 0.1.12)
  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:tcp_socket { read write create connect setopt };
  25. allow apticron_t self:udp_socket { create connect getattr };
  26. allow apticron_t self:process { setfscreate setrlimit getsched };
  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. allow apticron_t apticron_tmp_t:file relabelto;
  30. files_tmp_filetrans(apticron_t, apticron_tmp_t, { file dir })
  31. manage_files_pattern(apticron_t, apticron_var_lib_t, apticron_var_lib_t)
  32. files_var_lib_filetrans(apticron_t, apticron_var_lib_t, file)
  33. allow apticron_t apticron_var_lib_t:file relabelfrom;
  34. read_files_pattern(apticron_t, apticron_etc_t, apticron_etc_t)
  35. apt_domtrans(apticron_t)
  36. dpkg_run(apticron_t, apticron_roles)
  37. hostname_domtrans(apticron_t)
  38. sysnet_domtrans_ifconfig(apticron_t)
  39. corecmd_exec_shell(apticron_t)
  40. corecmd_exec_bin(apticron_t)
  41. miscfiles_read_localization(apticron_t)
  42. kernel_read_system_state(apticron_t)
  43. fs_getattr_xattr_fs(apticron_t)
  44. dev_read_urand(apticron_t)
  45. sysnet_read_config(apticron_t)
  46. corenet_tcp_connect_smtp_port(apticron_t)
  47. mta_sendmail_exec(apticron_t)
  48. gen_require(`
  49. type apt_var_cache_t;
  50. ')
  51. allow apticron_t apt_var_cache_t:dir { write read getattr open search };
  52. allow apticron_t apt_var_cache_t:file { read getattr open };
  53. gen_require(`
  54. type apt_var_lib_t;
  55. ')
  56. allow apticron_t apt_var_lib_t:dir { read open search getattr };
  57. allow apticron_t apt_var_lib_t:file { read ioctl open getattr };
  58. gen_require(`
  59. type crond_tmp_t;
  60. ')
  61. allow apticron_t crond_tmp_t:file { read write getattr ioctl };
  62. gen_require(`
  63. type etc_t;
  64. ')
  65. allow apticron_t etc_t:file { read getattr open ioctl };
  66. gen_require(`
  67. type usr_t;
  68. ')
  69. allow apticron_t usr_t:file { read getattr open };
  70. allow apticron_t usr_t:dir { read getattr open };
  71. optional_policy(`
  72. cron_system_entry(apticron_t, apticron_exec_t)
  73. ')
  74. gen_require(`
  75. type dpkg_var_lib_t;
  76. ')
  77. allow apticron_t dpkg_var_lib_t:file { read getattr open ioctl };
  78. allow apticron_t dpkg_var_lib_t:dir { read search open getattr };