Skip to content

Commit 037b9e2

Browse files
committed
set the feature at the kubelet scope
Signed-off-by: Mike Brown <[email protected]>
1 parent 9f2555c commit 037b9e2

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

keps/sig-node/20200310-ensure-secret-pulled-images.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ approvers:
1212
- "@dchen1107"
1313
editor: N/A
1414
creation-date: 2020-03-10
15-
last-updated: 2020-03-10
15+
last-updated: 2020-08-25
1616
status: provisional|implementable|implemented|deferred|rejected|withdrawn|replaced
1717
see-also:
1818
- N/A
@@ -60,19 +60,23 @@ superseded-by:
6060

6161
## Summary
6262

63-
We will add support for ensuring images pulled with pod imagePullSecrets are
64-
always authenticated even if cached. We will add a new boolean field
65-
`ensureSecretPulledImages` to the pod spec. The default to false
66-
means that if a first pod results in an image pulled with imagePullSecrets a
67-
second pod would have to be using always pull to ensure rights to use the
68-
previously pulled image. When set to true always pull would not be required,
69-
instead kublet will check if the image was pulled with an image pull secret and
70-
if so would force a pull of the image to ensure the image pulled with the
71-
secret is not used by another pod unless that pod also has the proper auth.
63+
We will add support in kubelet for ensuring images pulled with pod
64+
imagePullSecrets are always authenticated even if cached. This new feature will
65+
be enabled via a new kublet flag `ensureSecretPulledImages.` The flag will
66+
improve the security posture for privacy/security of image contents by forcing
67+
images pulled with an imagePullSecret of a first pod to be re-authenticated for
68+
a second pod even if the image is already present on the node. The default
69+
(false) setting means that if a first pod results in an image pulled with
70+
imagePullSecrets a second pod would have to be using always pull to ensure
71+
rights to use the previously pulled image. When set to true always pull would
72+
not be required, instead kubelet will check if the image was pulled with an
73+
image pull secret and if so would force a pull of the image to ensure the image
74+
pulled with the secret is not used by another pod unless that pod also has the
75+
proper auth.
7276

7377
## Motivation
7478

75-
There have been customer requests for improving upon kubernetes ability to
79+
There have been customer requests for improving upon kubernetes' ability to
7680
secure images pulled with auth. on a node. Issue
7781
[#18787](https://github.com/kubernetes/kubernetes/issues/18787) has been around
7882
for a while.
@@ -91,25 +95,28 @@ authentication.)
9195

9296
### Goals
9397

94-
Add a flag processed by `kubelet` for `ensureSecretPulledImages` (or something
95-
similarly named) that, if true, would force `kubelet` to attempt to pull every
98+
Add a `kubelet` flag for `ensureSecretPulledImages` (or something
99+
similarly named) as a security posture enhancement of the kubelet configuration
100+
that, if true, would force `kubelet` to attempt to pull every
96101
image that was pulled with image pulled secret based authentication, regardless
97-
of the container image's pull policy.
102+
of the container image pull policy.
98103

99104
Optimize to only force re-authentication for a pod when the secret used to pull
100-
the container image is not present.
105+
the container image is not present. IOW if an image is pulled with
106+
authentication for a first pod subsequent pods that have the same authentication
107+
information should not need to re-authenticate.
101108

102109
### Non-Goals
103110

104111
Out of scope for this KEP is an image caching policy that would direct container
105112
runtimes through the CRI wrt. how they should treat the caching of images on a
106113
node. Such as store for public use but only if encrypted. Or Store for private
107-
use unencrypted...
114+
use un-encrypted...
108115

109116
## Proposal
110117

111-
When `ensureSecretPulledImages` is set, `kublet` will check keep a list of
112-
container images that required authentication. `kublet` will ensure any image
118+
When `ensureSecretPulledImages` is set, `kubelet` will keep a list of container
119+
images that required authentication. `kubelet` will ensure any image
113120
in the list is always pulled thus enforcing authentication / re-authentication
114121
with the exception of pods with secrets containing an auth that has been
115122
authenticated.
@@ -120,13 +127,14 @@ wip
120127
### Risks and Mitigations
121128

122129
With the default being false, devops engineers may not know to set the flag to
123-
true in new/old pod specs that are using secrets for pull authentication with
124-
registries.
130+
true.
125131

126-
A mitigation would be an admission plugin to inject `ensureSecretPulledImages.`
132+
A mitigation would be a warning message or we could choose to make the default
133+
true.
127134

128-
Images authentications with a registry may expire. To mitigate expirations a
129-
a timeout could be used to force re-authentication.
135+
Image authentications with a registry may expire. To mitigate expirations a
136+
a timeout could be used to force re-authentication. The timeout could be a
137+
container runtime feature or a `kubelet` feature.
130138

131139
## Design Details
132140

@@ -160,9 +168,8 @@ Why should this KEP _not_ be implemented. N/A
160168

161169
## Alternatives [optional]
162170

163-
Default the ensure secrets rule to true and don't introduce a new pod spec flag.
164-
Instead of a pod spec flag make the option a kublet configuration switch or
165-
set the flag at some other scope.
171+
- Make the option a `kubelet` configuration switch (This is the SIG-Node suggested option).
172+
- Set the flag at some other scope e.g. pod spec (doing it at the pod spec was rejected by SIG-Node).
166173

167174
## Infrastructure Needed [optional]
168175

0 commit comments

Comments
 (0)