Skip to content

Commit

Permalink
WIP: Fixup certificate deletion authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjfisher committed Aug 5, 2020
1 parent 04554ef commit ddf415f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions templates/server/puppetserver/conf.d/auth.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ authorization: {
match-request: {
path: "/puppet-ca/v1/certificate_status"
type: path
method: [get, put, delete]
method: [get, put]
}
<%- if @server_ca_auth_required == false -%>
allow-unauthenticated: true
Expand Down Expand Up @@ -115,17 +115,21 @@ authorization: {
sort-order: 500
name: "puppetlabs cert statuses"
},
<%- if @server_ca_client_self_delete -%>
{
name: "Allow nodes to delete their own certificates",
name: "Allow deletion of certificates and requests",
match-request: {
path: "^/puppet-ca/v1/certificate(_status|_request)?/([^/]+)$"
type: regex
method: [delete]
},
<%- if @server_ca_auth_required == false -%>
allow-unauthenticated: true
<%- else -%>
allow: [
<%- if @server_ca_client_self_delete -%>
"$2",
<%- @server_admin_api_whitelist.each do |client| -%>
<%- end -%>
<%- @server_ca_client_whitelist.each do |client| -%>
"<%= client %>",
<%- end -%>
{
Expand All @@ -136,7 +140,6 @@ authorization: {
]
sort-order: 500
},
<%- end -%>
<%- end -%>
{
# Allow unauthenticated access to the status service endpoint
Expand Down

0 comments on commit ddf415f

Please sign in to comment.