Does capabilities.drop: ALL make sense with privileged: true? #3427
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
|
Good question! In Kubernetes, setting privileged: true in the securityContext gives the container almost all the capabilities of the host, effectively bypassing most security restrictions. On the other hand, capabilities.drop: ALL attempts to drop all Linux capabilities from the container. However, when privileged: true is set, the container runs with elevated privileges, and dropping capabilities generally has no effect because privileged mode overrides capability restrictions. So, using capabilities.drop: ALL together with privileged: true does not make much sense, as the privileged flag grants all capabilities regardless of what you try to drop. If your goal is to restrict capabilities, you should avoid using privileged: true and instead selectively add or drop capabilities. |
Beta Was this translation helpful? Give feedback.
-
|
@andyzhangx Is it true that we have no choice but to enable I'm confused by the use of such a wildcard instead of specific capabilities. Maybe some kind of enhancement is being developed in Kubernetes? Do you know anything about it? |
Beta Was this translation helpful? Give feedback.
-
|
@jsafrane @msau42 @saad-ali @xing-yang Hello, I need your help as sig-storage leads. As far as I understand, any CSI driver should work with What if |
Beta Was this translation helpful? Give feedback.
-
|
By the way, I noticed that CSI drivers usually mount |
Beta Was this translation helpful? Give feedback.
Good question! In Kubernetes, setting privileged: true in the securityContext gives the container almost all the capabilities of the host, effectively bypassing most security restrictions.
On the other hand, capabilities.drop: ALL attempts to drop all Linux capabilities from the container.
However, when privileged: true is set, the container runs with elevated privileges, and dropping capabilities generally has no effect because privileged mode overrides capability restrictions.
So, using capabilities.drop: ALL together with privileged: true does not make much sense, as the privileged flag grants all capabilities regardless of what you try to drop.
If your goal is to restrict capabilities…