atop.te 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. policy_module(atop, 0.1.12)
  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 };
  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. manage_dirs_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  31. append_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  32. create_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  33. setattr_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  34. rw_files_pattern(atop_t, atop_var_log_t, atop_var_log_t)
  35. logging_log_filetrans(atop_t, atop_var_log_t, file)
  36. manage_dirs_pattern(atop_t, atop_var_cache_t, atop_var_cache_t)
  37. manage_files_pattern(atop_t, atop_var_cache_t, atop_var_cache_t)
  38. manage_dirs_pattern(atop_t, atop_var_run_t, atop_var_run_t)
  39. manage_files_pattern(atop_t, atop_var_run_t, atop_var_run_t)
  40. files_pid_filetrans(atop_t, atop_var_run_t, { file dir })
  41. gen_require(`
  42. type bin_t;
  43. ')
  44. allow atop_t bin_t:dir search;
  45. optional_policy(`
  46. gen_require(`
  47. type initrc_t;
  48. ')
  49. allow atop_t initrc_t:sem { read unix_write write associate };
  50. ')
  51. userdom_getattr_user_home_dirs(atop_t)
  52. kernel_getattr_proc(atop_t)
  53. kernel_search_proc(atop_t)
  54. kernel_list_proc(atop_t)
  55. kernel_getattr_proc_files(atop_t)
  56. kernel_read_proc_symlinks(atop_t)
  57. kernel_read_system_state(atop_t)
  58. kernel_get_sysvipc_info(atop_t)
  59. domain_read_all_domains_state(atop_t)
  60. corecmd_shell_entry_type(atop_t)
  61. kernel_read_network_state(atop_t)
  62. fs_getattr_tmpfs(atop_t)
  63. auth_use_nsswitch(atop_t)
  64. storage_getattr_fixed_disk_dev(atop_t)
  65. miscfiles_read_localization(atop_t)
  66. dev_getattr_lvm_control(atop_t)
  67. cron_system_entry(atop_t, atop_exec_t)
  68. init_read_utmp(atop_t)