Gentoo Archives: gentoo-commits

From: Sven Vermeulen <sven.vermeulen@××××××.be>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/, policy/modules/roles/
Date: Tue, 28 Aug 2012 17:29:57
Message-Id: 1346174827.413bec7b8ff8b290c817a4422e4d4a4bac834b63.SwifT@gentoo
1 commit: 413bec7b8ff8b290c817a4422e4d4a4bac834b63
2 Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
3 AuthorDate: Tue Aug 28 17:27:07 2012 +0000
4 Commit: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
5 CommitDate: Tue Aug 28 17:27:07 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=413bec7b
7
8 Add in administrative interface(s) for puppet
9
10 As the puppet domain has an named init script (puppet_initrc_exec_t and
11 puppetmaster_initrc_exec_t) we provide administrative interfaces to be used by
12 the users that need to admin the puppet domains.
13
14 Also assign this to the sysadm_t/sysadm_r user for general system administration
15 support.
16
17 ---
18 policy/modules/contrib/puppet.if | 78 ++++++++++++++++++++++++++++++++++++++
19 policy/modules/roles/sysadm.te | 4 ++
20 2 files changed, 82 insertions(+), 0 deletions(-)
21
22 diff --git a/policy/modules/contrib/puppet.if b/policy/modules/contrib/puppet.if
23 index 2855a44..d2e5a12 100644
24 --- a/policy/modules/contrib/puppet.if
25 +++ b/policy/modules/contrib/puppet.if
26 @@ -10,6 +10,84 @@
27
28 ################################################
29 ## <summary>
30 +## All of the rules required to manage a puppet (client) domain
31 +## </summary>
32 +## <param name="domain">
33 +## <summary>
34 +## Domain allowed access
35 +## </summary>
36 +## </param>
37 +## <param name="role">
38 +## <summary>
39 +## Role allowed access
40 +## </summary>
41 +## </param>
42 +#
43 +interface(`puppet_admin',`
44 + gen_require(`
45 + type puppet_t;
46 + type puppet_initrc_exec_t;
47 + type puppet_etc_t;
48 + type puppet_log_t;
49 + type puppet_var_run_t;
50 + ')
51 +
52 + allow $1 puppet_t:process { getattr signal_perms };
53 + ps_process_pattern($1, puppet_t)
54 +
55 + init_labeled_script_domtrans($1, puppet_initrc_exec_t)
56 + domain_system_change_exemption($1)
57 + role_transition $2 puppet_initrc_exec_t system_r;
58 + allow $2 system_r;
59 +
60 + files_search_etc($1)
61 + admin_pattern($1, puppet_etc_t)
62 +
63 + logging_search_logs($1)
64 + admin_pattern($1, puppet_log_t)
65 +
66 + admin_pattern($1, puppet_var_run_t)
67 +
68 + kernel_search_proc($1)
69 + allow $1 puppet_t:dir list_dir_perms;
70 +
71 + read_lnk_files_pattern($1, puppet_t, puppet_t)
72 +')
73 +
74 +################################################
75 +## <summary>
76 +## All of the rules required to manage a puppetmaster domain
77 +## </summary>
78 +## <param name="domain">
79 +## <summary>
80 +## Domain allowed access
81 +## </summary>
82 +## </param>
83 +## <param name="role">
84 +## <summary>
85 +## Role allowed access
86 +## </summary>
87 +## </param>
88 +#
89 +interface(`puppet_admin_puppetmaster',`
90 + gen_require(`
91 + type puppetmaster_t;
92 + type puppetmaster_initrc_exec_t;
93 + ')
94 +
95 + allow $1 puppetmaster_t:process { getattr signal_perms };
96 + ps_process_pattern($1, puppetmaster_t)
97 +
98 + init_labeled_script_domtrans($1, puppetmaster_initrc_exec_t)
99 + domain_system_change_exemption($1)
100 + role_transition $2 puppetmaster_initrc_exec_t system_r;
101 + allow $2 system_r;
102 +
103 + puppet_admin($1, $2)
104 +')
105 +
106 +################################################
107 +## <summary>
108 ## Read / Write to Puppet temp files. Puppet uses
109 ## some system binaries (groupadd, etc) that run in
110 ## a non-puppet domain and redirects output into temp
111
112 diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te
113 index efba839..0a2714b 100644
114 --- a/policy/modules/roles/sysadm.te
115 +++ b/policy/modules/roles/sysadm.te
116 @@ -307,6 +307,10 @@ optional_policy(`
117 ')
118
119 optional_policy(`
120 + puppet_admin_puppetmaster(sysadm_t, sysadm_r)
121 +')
122 +
123 +optional_policy(`
124 pyzor_role(sysadm_r, sysadm_t)
125 ')