-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
SELinux volume permission issues when playing kube file (rootless) #9371
Comments
This the YAML file include the :Z? |
Yes, I created a pod, then a container in the pod with :Z :
Then I generated the YAML from this pod. |
Sorry I just saw the yaml file. If you add :Z to the image path, does it work?
|
No, it doesn't.
|
Ok looks like two bugs in one... I will take a look, unless you want to take a stab? |
@rhatdan , Thank you for asking but I'm not a programmer :( I am only a Podman user. |
No problem, thanks for contributing the issue. |
A friendly reminder that this issue had no activity for 30 days. |
I'm having the same issue described above. When I add the 'z' to the mountPath on the yaml, it just treats it as a part of the path. |
A friendly reminder that this issue had no activity for 30 days. |
Allow users to specify options on the volume mount path. This will trigger relabels of user specifies :z,:Z Also will handle User Relabels if the user specifies :U Fixes: containers#9371 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
On 3.2.2 I'm still seeing this problem, volumeMounts:
- mountPath: /var/www/html/storage:z
name: my-data
If I run this up and look in the container it's created a dir > podman exec -it NAME ls /var/www/html/
...
drwxrwxr-x. 5 www-data www-data 98 Jul 6 13:23 storage
drwxr-xr-x. 1 root root 0 Jul 3 12:10 storage:z
... |
Can you open a fresh issue? The original issue was not supporting the |
Please @Ian2020 , could you do it ? Got no time to test this part for now, but will soon need this to be fixed too ! :) |
Before I create a new bug after some investigation I have found that the PR which closed this issue: #10339 never made it to the 3.2 branch, which is why the bug still persists for those of us not running from source. The PR went into the master branch which no longer exists. Another commit was made the day before to main 4cc19f9 which looks like the same fix. So the fix is available, just not in the 3.2 branch. Rather than being a totally new bug I think this one was just closed too early due to some confusion during the migration from master to main? If commit 4cc19f9 could now be released please I think we'll be able to see if the bug was really fixed. If you think this warrants a new issue though I am happy to create it. |
/kind bug
Description
As mentioned in #8710 I have been having issues playing a kube file that I generated with podman. The problem seems to persist (I'm not 100% sure it's still the same issue).
Now on v3.0.0 I have permission issues with the volumes.
Steps to reproduce the issue:
SELinux is set to "enforcing".
Scenario A: running everything manually:
podman pod create pod -n testpod
podman run -d --rm --name testcontainer --pod testpod -v $(pwd)/testdir:/testdir:Z testimage
So far so good.
rm -f $(pwd)/testdir/testfile
Scenario B: using podman generate:
podman pod create pod -n testpod
podman run -d --rm --name testcontainer --pod testpod -v $(pwd)/testdir:/testdir:Z testimage
podman generate kube <pod id> > kube.yaml
podman play kube kube.yaml
Scenario B works when SELinux is set to pemissive mode.
Describe the results you received:
I would expect the container to write into the testfile in both Scenario A and B also with SELinux set to enforcing mode.
Describe the results you expected:
I get "permission denied" error message.
Additional information you deem important (e.g. issue happens only occasionally):
This issue happens since updating from 2.1.1 to 3.0.0. I had to skip 2.2.1 due to the issue mentioned above.
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?
Yes
The text was updated successfully, but these errors were encountered: