Skip to content

Commit 05443f3

Browse files
committed
Update the KEP with clarity around localhost probes
Signed-off-by: Surya Seetharaman <[email protected]>
1 parent 63d4f6f commit 05443f3

File tree

1 file changed

+27
-11
lines changed
  • keps/sig-auth/4940-psa-block-host-field-in-probes

1 file changed

+27
-11
lines changed

keps/sig-auth/4940-psa-block-host-field-in-probes/README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ lead to blind SSRF attacks.
8888
### Goals
8989

9090
* 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`.
9293
* The Baseline Pod Security Standard (PSS) will be updated to enforce
9394
blocking this field so that it helps with easier adoption for
9495
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.
108109

109110
Meanwhile, the older API is never going to go away. So we also want to
110111
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)
113115
that does exactly that.
114116

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+
115125
### Risks and Mitigations
116126

117127
There might be users who depend on the `Host` field in
@@ -123,7 +133,9 @@ the PSA to block it.
123133
## Design Details
124134

125135
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.
127139

128140
* spec.containers[*].LivenessProbe.ProbeHandler.HTTPGet.Host
129141
* spec.containers[*].ReadinessProbe.ProbeHandler.HTTPGet.Host
@@ -168,10 +180,11 @@ Current test coverage status for the package is:
168180

169181
The following integration tests will be added to verify the PSA validation logic:
170182

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
175188

176189
These tests will be added to:
177190
- `test/integration/auth/podsecurity_test.go`
@@ -198,9 +211,12 @@ All related code will land within the same single release
198211

199212
### Upgrade / Downgrade Strategy
200213

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.
204220

205221
Users who are using this field can switch to using exec
206222
probes moving forward which should unblock them given exec

0 commit comments

Comments
 (0)