You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vncsession.te 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # Copyright 2018-2020 Pierre Ossman for Cendio AB
  3. #
  4. # This is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This software is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this software; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  17. # USA.
  18. #
  19. policy_module(vncsession, 1.0.0)
  20. type vnc_session_t;
  21. type vnc_session_exec_t;
  22. init_daemon_domain(vnc_session_t, vnc_session_exec_t)
  23. can_exec(vnc_session_t, vnc_session_exec_t)
  24. type vnc_session_var_run_t;
  25. files_pid_file(vnc_session_var_run_t)
  26. type vnc_home_t;
  27. userdom_user_home_content(vnc_home_t)
  28. allow vnc_session_t self:capability { chown dac_override dac_read_search fowner kill setgid setuid sys_resource };
  29. allow vnc_session_t self:process { getcap setexec setrlimit setsched };
  30. allow vnc_session_t self:fifo_file rw_fifo_file_perms;
  31. allow vnc_session_t vnc_session_var_run_t:file manage_file_perms;
  32. files_pid_filetrans(vnc_session_t, vnc_session_var_run_t, file)
  33. create_dirs_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  34. manage_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  35. manage_fifo_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  36. manage_sock_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  37. manage_lnk_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  38. kernel_read_kernel_sysctls(vnc_session_t)
  39. corecmd_executable_file(vnc_session_exec_t)
  40. mcs_process_set_categories(vnc_session_t)
  41. mcs_killall(vnc_session_t)
  42. tunable_policy(`use_nfs_home_dirs',`
  43. fs_manage_nfs_dirs(vnc_session_t)
  44. fs_manage_nfs_files(vnc_session_t)
  45. ')
  46. optional_policy(`
  47. auth_login_pgm_domain(vnc_session_t)
  48. auth_write_login_records(vnc_session_t)
  49. ')
  50. optional_policy(`
  51. logging_append_all_logs(vnc_session_t)
  52. ')
  53. optional_policy(`
  54. miscfiles_read_localization(vnc_session_t)
  55. ')
  56. optional_policy(`
  57. userdom_spec_domtrans_all_users(vnc_session_t)
  58. userdom_signal_all_users(vnc_session_t)
  59. userdom_user_home_dir_filetrans(vnc_session_t, vnc_home_t, dir, ".vnc")
  60. userdom_admin_home_dir_filetrans(vnc_session_t, vnc_home_t, dir, ".vnc")
  61. # This also affects other tools, e.g. vncpasswd
  62. gen_require(`
  63. attribute userdomain;
  64. ')
  65. userdom_admin_home_dir_filetrans(userdomain, vnc_home_t, dir, ".vnc")
  66. userdom_user_home_dir_filetrans(userdomain, vnc_home_t, dir, ".vnc")
  67. ')