atop.te 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. policy_module(atop, 0.1.13)
  2. ########################################
  3. #
  4. # Declarations
  5. #
  6. attribute_role atop_roles;
  7. type atop_t;
  8. type atop_exec_t;
  9. init_daemon_domain(atop_t, atop_exec_t)
  10. role atop_roles types atop_t;
  11. type atop_initrc_exec_t;
  12. init_script_file(atop_initrc_exec_t)
  13. type atop_var_log_t;
  14. logging_log_file(atop_var_log_t)
  15. type atop_var_run_t;
  16. files_pid_file(atop_var_run_t)
  17. type atop_var_cache_t;
  18. files_type(atop_var_cache_t)
  19. ########################################
  20. #
  21. # Local policy
  22. #
  23. allow atop_t atop_exec_t:file execute_no_trans;
  24. allow atop_t self:capability { setuid sys_nice sys_resource ipc_lock sys_pacct dac_override net_raw sys_ptrace };
  25. allow atop_t self:process { setsched sigkill setrlimit setpgid signal };
  26. allow atop_t self:sem { write read create unix_write unix_read };
  27. allow atop_t self:udp_socket { create ioctl };
  28. allow atop_t self:sem associate;
  29. allow atop_t self:rawip_socket { create getopt };
  30. allow atop_t self:fifo_file { getattr ioctl read write };
  31. manage_dirs_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  32. append_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  33. create_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  34. setattr_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  35. rw_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  36. logging_log_filetrans(atop_t, atop_var_log_t, file)
  37. manage_dirs_pattern(atop_t, atop_var_cache_t, atop_var_cache_t)
  38. manage_files_pattern(atop_t, atop_var_cache_t, atop_var_cache_t)
  39. manage_dirs_pattern(atop_t, atop_var_run_t, atop_var_run_t)
  40. manage_files_pattern(atop_t, atop_var_run_t, atop_var_run_t)
  41. files_pid_filetrans(atop_t, atop_var_run_t, { file dir })
  42. corecmd_exec_bin(atop_t)
  43. optional_policy(`
  44. gen_require(`
  45. type initrc_t;
  46. ')
  47. allow atop_t initrc_t:sem { read unix_write write associate };
  48. ')
  49. userdom_getattr_user_home_dirs(atop_t)
  50. kernel_getattr_proc(atop_t)
  51. kernel_search_proc(atop_t)
  52. kernel_list_proc(atop_t)
  53. kernel_getattr_proc_files(atop_t)
  54. kernel_read_proc_symlinks(atop_t)
  55. kernel_read_system_state(atop_t)
  56. kernel_get_sysvipc_info(atop_t)
  57. kernel_read_kernel_sysctls(atop_t)
  58. domain_read_all_domains_state(atop_t)
  59. corecmd_shell_entry_type(atop_t)
  60. kernel_read_network_state(atop_t)
  61. fs_getattr_tmpfs(atop_t)
  62. auth_use_nsswitch(atop_t)
  63. storage_getattr_fixed_disk_dev(atop_t)
  64. miscfiles_read_localization(atop_t)
  65. dev_getattr_lvm_control(atop_t)
  66. cron_system_entry(atop_t, atop_exec_t)
  67. init_read_utmp(atop_t)