Skip to content

Commit ddf415f

Browse files
committed
WIP: Fixup certificate deletion authorization
1 parent 04554ef commit ddf415f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ authorization: {
7272
match-request: {
7373
path: "/puppet-ca/v1/certificate_status"
7474
type: path
75-
method: [get, put, delete]
75+
method: [get, put]
7676
}
7777
<%- if @server_ca_auth_required == false -%>
7878
allow-unauthenticated: true
@@ -115,17 +115,21 @@ authorization: {
115115
sort-order: 500
116116
name: "puppetlabs cert statuses"
117117
},
118-
<%- if @server_ca_client_self_delete -%>
119118
{
120-
name: "Allow nodes to delete their own certificates",
119+
name: "Allow deletion of certificates and requests",
121120
match-request: {
122121
path: "^/puppet-ca/v1/certificate(_status|_request)?/([^/]+)$"
123122
type: regex
124123
method: [delete]
125124
},
125+
<%- if @server_ca_auth_required == false -%>
126+
allow-unauthenticated: true
127+
<%- else -%>
126128
allow: [
129+
<%- if @server_ca_client_self_delete -%>
127130
"$2",
128-
<%- @server_admin_api_whitelist.each do |client| -%>
131+
<%- end -%>
132+
<%- @server_ca_client_whitelist.each do |client| -%>
129133
"<%= client %>",
130134
<%- end -%>
131135
{
@@ -136,7 +140,6 @@ authorization: {
136140
]
137141
sort-order: 500
138142
},
139-
<%- end -%>
140143
<%- end -%>
141144
{
142145
# Allow unauthenticated access to the status service endpoint

0 commit comments

Comments
 (0)