|
| 1 | + |
| 2 | +## <summary>policy for google_guest_agent</summary> |
| 3 | + |
| 4 | +######################################## |
| 5 | +## <summary> |
| 6 | +## Execute google_guest_agent_exec_t in the google_guest_agent domain. |
| 7 | +## </summary> |
| 8 | +## <param name="domain"> |
| 9 | +## <summary> |
| 10 | +## Domain allowed to transition. |
| 11 | +## </summary> |
| 12 | +## </param> |
| 13 | +# |
| 14 | +interface(`google_guest_agent_domtrans',` |
| 15 | + gen_require(` |
| 16 | + type google_guest_agent_t, google_guest_agent_exec_t; |
| 17 | + ') |
| 18 | + |
| 19 | + corecmd_search_bin($1) |
| 20 | + domtrans_pattern($1, google_guest_agent_exec_t, google_guest_agent_t) |
| 21 | +') |
| 22 | + |
| 23 | +###################################### |
| 24 | +## <summary> |
| 25 | +## Execute google_guest_agent in the caller domain. |
| 26 | +## </summary> |
| 27 | +## <param name="domain"> |
| 28 | +## <summary> |
| 29 | +## Domain allowed access. |
| 30 | +## </summary> |
| 31 | +## </param> |
| 32 | +# |
| 33 | +interface(`google_guest_agent_exec',` |
| 34 | + gen_require(` |
| 35 | + type google_guest_agent_exec_t; |
| 36 | + ') |
| 37 | + |
| 38 | + corecmd_search_bin($1) |
| 39 | + can_exec($1, google_guest_agent_exec_t) |
| 40 | +') |
| 41 | +######################################## |
| 42 | +## <summary> |
| 43 | +## Execute google_guest_agent server in the google_guest_agent domain. |
| 44 | +## </summary> |
| 45 | +## <param name="domain"> |
| 46 | +## <summary> |
| 47 | +## Domain allowed to transition. |
| 48 | +## </summary> |
| 49 | +## </param> |
| 50 | +# |
| 51 | +interface(`google_guest_agent_systemctl',` |
| 52 | + gen_require(` |
| 53 | + type google_guest_agent_t; |
| 54 | + type google_guest_agent_unit_file_t; |
| 55 | + ') |
| 56 | + |
| 57 | + systemd_exec_systemctl($1) |
| 58 | + systemd_read_fifo_file_passwd_run($1) |
| 59 | + allow $1 google_guest_agent_unit_file_t:file read_file_perms; |
| 60 | + allow $1 google_guest_agent_unit_file_t:service manage_service_perms; |
| 61 | + |
| 62 | + ps_process_pattern($1, google_guest_agent_t) |
| 63 | +') |
| 64 | + |
| 65 | + |
| 66 | +######################################## |
| 67 | +## <summary> |
| 68 | +## All of the rules required to administrate |
| 69 | +## an google_guest_agent environment |
| 70 | +## </summary> |
| 71 | +## <param name="domain"> |
| 72 | +## <summary> |
| 73 | +## Domain allowed access. |
| 74 | +## </summary> |
| 75 | +## </param> |
| 76 | +## <param name="role"> |
| 77 | +## <summary> |
| 78 | +## Role allowed access. |
| 79 | +## </summary> |
| 80 | +## </param> |
| 81 | +## <rolecap/> |
| 82 | +# |
| 83 | +interface(`google_guest_agent_admin',` |
| 84 | + gen_require(` |
| 85 | + type google_guest_agent_t; |
| 86 | + type google_guest_agent_unit_file_t; |
| 87 | + ') |
| 88 | + |
| 89 | + allow $1 google_guest_agent_t:process { signal_perms }; |
| 90 | + ps_process_pattern($1, google_guest_agent_t) |
| 91 | + |
| 92 | + tunable_policy(`deny_ptrace',`',` |
| 93 | + allow $1 google_guest_agent_t:process ptrace; |
| 94 | + ') |
| 95 | + |
| 96 | + google_guest_agent_systemctl($1) |
| 97 | + admin_pattern($1, google_guest_agent_unit_file_t) |
| 98 | + allow $1 google_guest_agent_unit_file_t:service all_service_perms; |
| 99 | + optional_policy(` |
| 100 | + systemd_passwd_agent_exec($1) |
| 101 | + systemd_read_fifo_file_passwd_run($1) |
| 102 | + ') |
| 103 | +') |
0 commit comments