-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility with PSPs using read-only allowed host paths #7755
Comments
@louisblin you use |
Thanks for the hint @sarabala1979! It does work, but the patch is particularly unreadable and I can't expect my users to understand this. Problems are:
Here's what it looks like: podSpecPatch: |
{"containers":[{"name":"wait","volumeMounts":[{"mountPath":"/mainctrfs/etc/ssl/certs","name":"ssl-certs","readOnly":true}]}],"initContainers":[{"name":"init","volumeMounts":[{"mountPath":"/mainctrfs/etc/ssl/certs","name":"ssl-certs","readOnly":true}]}]} I would very much like to avoid doing this. Is there any reason why the |
This comment was marked as resolved.
This comment was marked as resolved.
Any thoughts on removing the line I mentioned, @sarabala1979 or @alexec? |
Would you be interested in investigating and submitting a PR to see if the change works? |
Absolutely, I'll give that a try! |
* Implements PNS (Process Namespace Sharing) executor * Adds limited support for Kubelet/K8s API artifact collection by mirroring volume mounts to wait sidecar * Adds validation to detect when output artifacts are not supported by the executor * Adds ability to customize executor from workflow-controller-configmap (e.g. add environment variables, append command line args such as loglevel) * Fixes an issue where daemon steps were not getting terminated properly
As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this.
As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this.
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this.
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: louisblin <louisblin@users.noreply.github.com>
…#7755 As discussed in argoproj#7755, the `init` / `wait` containers surrounding a workflow container mount the same volumes as the `main` container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP). The original code author (@jessesuen) claims that mounts need to be read/write to allow overlapping mount paths. However, the `main` container will already need to mount paths in read/write mode if they overlap, so there does not seem to be a good reason for keeping this. Fixes argoproj#7755 Signed-off-by: Louis Blin <louis-blin@hotmail.fr>
All tests are passing in #8128. Do you feel this needs more validation? |
Summary
Argo Workflows seems to be incompatible with Pod Security Policies (PSPs) specifying read-only allowed host paths. As mentioned in this thread, the
init
/wait
containers surrounding a workflow container mount the same volumes as the main container, but without respecting their read/write mode. For environments using PSPs with read-only allowed host paths, it becomes impossible to run workflows that use volume mounts (as sidecar containers will violate the PSP).Looking at the code mentioned above, the author claims that mounts need to be read/write to allow overlapping mount paths. However, the
main
container will already need to mount paths in read/write mode if they overlap, so I don't see why the sidecar containers needs to modify this setting. Am I missing something or could we simply remove this override?Argo Workflows install: version v3.2.6, on a vanilla k8s cluster with the K8SAPI executor.
Diagnostics
To replicate the issue, here's a sample PSP with a read-only allowed host path:
And a workflow that will violate it:
After inspecting the workflow in the UI, you get the following message, which indicates that the sidecar container is trying to mount the
ssl-certs
volume in write mode.This can be confirmed by disabling the PSP and inspecting the pod spec that is created.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: