Skip to content

Commit 27826c3

Browse files
committed
workaround for theforeman#969
1 parent 5d61261 commit 27826c3

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

spec/classes/puppet_server_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@
524524
it 'should not sync the crl' do
525525
should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem')
526526
end
527+
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path":\s*"/puppet-ca/v1/certificate_renewal"}) }
528+
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path":\s*"/puppet-ca/v1/certificate_status"}) }
529+
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path":\s*"/puppet-ca/v1/certificate_statuses"}) }
530+
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path":\s*"/puppet-ca/v1/sign"}) }
531+
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path":\s*"/puppet-ca/v1/sign/all"}) }
527532
end
528533
end
529534

templates/server/puppetserver/conf.d/auth.conf.erb

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,46 @@ authorization: {
202202
sort-order: 500
203203
name: "puppetlabs cert clean"
204204
},
205+
{
206+
# Allow the CA CLI to access the certificate sign endpoint
207+
match-request: {
208+
path: "/puppet-ca/v1/sign"
209+
type: path
210+
method: post
211+
}
212+
allow: [
213+
<%- @server_ca_client_allowlist.each do |client| -%>
214+
"<%= client %>",
215+
<%- end -%>
216+
{
217+
extensions: {
218+
pp_cli_auth: "true"
219+
}
220+
}
221+
]
222+
sort-order: 500
223+
name: "puppetlabs cert sign"
224+
},
225+
{
226+
# Allow the CA CLI to access the certificate sign all endpoint
227+
match-request: {
228+
path: "/puppet-ca/v1/sign/all"
229+
type: path
230+
method: post
231+
}
232+
allow: [
233+
<%- @server_ca_client_allowlist.each do |client| -%>
234+
"<%= client %>",
235+
<%- end -%>
236+
{
237+
extensions: {
238+
pp_cli_auth: "true"
239+
}
240+
}
241+
]
242+
sort-order: 500
243+
name: "puppetlabs cert sign all"
244+
},
205245
{
206246
# Allow unauthenticated access to the status service endpoint
207247
match-request: {

0 commit comments

Comments
 (0)