@@ -88,7 +88,8 @@ lead to blind SSRF attacks.
88
88
### Goals
89
89
90
90
* Add Pod Security Admission (PSA) to enable admins to restrict
91
- users from creating probes with the ` Host ` field set.
91
+ users from creating probes with the ` Host ` field set to disallowed
92
+ values. The only allowed values will be ` 127.0.0.1 ` and ` ::1 ` .
92
93
* The Baseline Pod Security Standard (PSS) will be updated to enforce
93
94
blocking this field so that it helps with easier adoption for
94
95
workload operators given this is a known issue we want to prevent.
@@ -108,10 +109,19 @@ we do not plan to offer it in the new types.
108
109
109
110
Meanwhile, the older API is never going to go away. So we also want to
110
111
add PSA to allow admins to be able to restrict users from creating
111
- probes with the Host field set when using the (about to be deprecated) API.
112
- This is implemented by [ kubernetes PR 125271] ( https://github.com/kubernetes/kubernetes/pull/125271 )
112
+ probes with the Host field set with disallowed values when using the
113
+ (about to be deprecated) API. This is implemented by
114
+ [ kubernetes PR 125271] ( https://github.com/kubernetes/kubernetes/pull/125271 )
113
115
that does exactly that.
114
116
117
+ Given there is still a use case where admins might be deploying the apiserver
118
+ or any controlplane host-networked pod service to have probes with ` .Host ` field set to
119
+ localhost (127.0.0.1). This is because there could be firewall rules blocking access to public nodeIP
120
+ for good reasons. Hence we would continue to allow for this use case meaning the only values
121
+ allowed on the ` .Host ` field would be ` 127.0.0.1 ` and ` ::1 ` . See [ this snippet] for example.
122
+
123
+ [ this snippet ] : https://github.com/kubernetes/kops/blob/5dd2f468b46fda43f3a63ba1e6dc7c55c21919eb/nodeup/pkg/model/kube_apiserver.go#L603
124
+
115
125
### Risks and Mitigations
116
126
117
127
There might be users who depend on the ` Host ` field in
@@ -123,7 +133,9 @@ the PSA to block it.
123
133
## Design Details
124
134
125
135
Add a Baseline APILevel Pod Security Admission policy to allow admins of the
126
- cluster to block users from setting ` .host ` field in:
136
+ cluster to block users from setting ` .host ` field to disallowed values in the
137
+ following fields. The only allowed values will be ` 127.0.0.1 ` and ` ::1 ` and everything
138
+ else will be blocked.
127
139
128
140
* spec.containers[ * ] .LivenessProbe.ProbeHandler.HTTPGet.Host
129
141
* spec.containers[ * ] .ReadinessProbe.ProbeHandler.HTTPGet.Host
@@ -168,10 +180,11 @@ Current test coverage status for the package is:
168
180
169
181
The following integration tests will be added to verify the PSA validation logic:
170
182
171
- 1 . Test that pods with ` .host ` field set in probes are rejected when PSA is enabled with baseline level
172
- 2 . Test that pods without ` .host ` field set in probes are allowed when PSA is enabled with baseline level
173
- 3 . Test that existing pods with ` .host ` field set continue to work when PSA is enabled
174
- 4 . Test that pods with ` .host ` field set are allowed when PSA is disabled or using an older version
183
+ 1 . Test that pods with ` .host ` field set to disallowed values in probes are rejected when PSA is enabled with baseline level
184
+ 2 . Test that pods with ` .host ` field set to allowed values in probes are accepted when PSA is enabled with baseline level
185
+ 3 . Test that pods without ` .host ` field set in probes are allowed when PSA is enabled with baseline level
186
+ 4 . Test that existing pods with ` .host ` field set continue to work when PSA is enabled
187
+ 5 . Test that pods with ` .host ` field set are allowed when PSA is disabled or using an older version
175
188
176
189
These tests will be added to:
177
190
- ` test/integration/auth/podsecurity_test.go `
@@ -198,9 +211,12 @@ All related code will land within the same single release
198
211
199
212
### Upgrade / Downgrade Strategy
200
213
201
- Any older pods with this field set should not be affected
202
- with the above solution. Only newer pods getting created
203
- with the field will be alerted.
214
+ Any older pods with this field set to allowed values should
215
+ not be affected with the above solution.
216
+
217
+ Any older pods with this field set to disallowed values should
218
+ not be affected with the above solution. Only newer pods getting
219
+ created with the field will be alerted.
204
220
205
221
Users who are using this field can switch to using exec
206
222
probes moving forward which should unblock them given exec
0 commit comments