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.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. gen_require(`
  21. attribute userdomain;
  22. type xdm_home_t;
  23. ')
  24. type vnc_session_t;
  25. type vnc_session_exec_t;
  26. init_daemon_domain(vnc_session_t, vnc_session_exec_t)
  27. can_exec(vnc_session_t, vnc_session_exec_t)
  28. type vnc_session_var_run_t;
  29. files_pid_file(vnc_session_var_run_t)
  30. allow vnc_session_t self:capability { chown dac_override dac_read_search fowner kill setgid setuid sys_resource };
  31. allow vnc_session_t self:process { getcap setexec setrlimit setsched };
  32. allow vnc_session_t self:fifo_file rw_fifo_file_perms;
  33. allow vnc_session_t vnc_session_var_run_t:file manage_file_perms;
  34. files_pid_filetrans(vnc_session_t, vnc_session_var_run_t, file)
  35. manage_files_pattern(vnc_session_t, xdm_home_t, xdm_home_t)
  36. manage_fifo_files_pattern(vnc_session_t, xdm_home_t, xdm_home_t)
  37. manage_sock_files_pattern(vnc_session_t, xdm_home_t, xdm_home_t)
  38. manage_lnk_files_pattern(vnc_session_t, xdm_home_t, xdm_home_t)
  39. kernel_read_kernel_sysctls(vnc_session_t)
  40. corecmd_executable_file(vnc_session_exec_t)
  41. mcs_process_set_categories(vnc_session_t)
  42. mcs_killall(vnc_session_t)
  43. optional_policy(`
  44. auth_login_pgm_domain(vnc_session_t)
  45. auth_write_login_records(vnc_session_t)
  46. ')
  47. optional_policy(`
  48. logging_append_all_logs(vnc_session_t)
  49. ')
  50. optional_policy(`
  51. miscfiles_read_localization(vnc_session_t)
  52. ')
  53. optional_policy(`
  54. userdom_spec_domtrans_all_users(vnc_session_t)
  55. userdom_signal_all_users(vnc_session_t)
  56. userdom_user_home_dir_filetrans(vnc_session_t, xdm_home_t, dir, ".vnc")
  57. userdom_admin_home_dir_filetrans(vnc_session_t, xdm_home_t, dir, ".vnc")
  58. # This also affects other tools, e.g. vncpasswd
  59. gen_require(`
  60. attribute userdomain;
  61. ')
  62. userdom_admin_home_dir_filetrans(userdomain, xdm_home_t, dir, ".vnc")
  63. userdom_user_home_dir_filetrans(userdomain, xdm_home_t, dir, ".vnc")
  64. ')