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 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. # Allowed to create ~/.local
  34. optional_policy(`
  35. gnome_filetrans_home_content(vnc_session_t)
  36. ')
  37. optional_policy(`
  38. gen_require(`
  39. type gconf_home_t;
  40. ')
  41. create_dirs_pattern(vnc_session_t, gconf_home_t, gconf_home_t)
  42. ')
  43. # Manage TigerVNC files (mainly ~/.local/state/*.log)
  44. create_dirs_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  45. manage_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  46. manage_fifo_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  47. manage_sock_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  48. manage_lnk_files_pattern(vnc_session_t, vnc_home_t, vnc_home_t)
  49. kernel_read_kernel_sysctls(vnc_session_t)
  50. corecmd_executable_file(vnc_session_exec_t)
  51. mcs_process_set_categories(vnc_session_t)
  52. mcs_killall(vnc_session_t)
  53. tunable_policy(`use_nfs_home_dirs',`
  54. fs_manage_nfs_dirs(vnc_session_t)
  55. fs_manage_nfs_files(vnc_session_t)
  56. ')
  57. optional_policy(`
  58. auth_login_pgm_domain(vnc_session_t)
  59. auth_write_login_records(vnc_session_t)
  60. ')
  61. optional_policy(`
  62. logging_append_all_logs(vnc_session_t)
  63. ')
  64. optional_policy(`
  65. miscfiles_read_localization(vnc_session_t)
  66. ')
  67. optional_policy(`
  68. userdom_spec_domtrans_all_users(vnc_session_t)
  69. userdom_signal_all_users(vnc_session_t)
  70. # Make sure legacy path has correct type
  71. gen_require(`
  72. attribute userdomain;
  73. type gconf_home_t;
  74. ')
  75. userdom_admin_home_dir_filetrans(userdomain, vnc_home_t, dir, ".vnc")
  76. userdom_user_home_dir_filetrans(userdomain, vnc_home_t, dir, ".vnc")
  77. gnome_config_filetrans(userdomain, vnc_home_t, dir, "tigervnc")
  78. gnome_data_filetrans(userdomain, vnc_home_t, dir, "tigervnc")
  79. filetrans_pattern(userdomain, gconf_home_t, vnc_home_t, dir, "tigervnc")
  80. filetrans_pattern(vnc_session_t, gconf_home_t, vnc_home_t, dir, "tigervnc")
  81. ')