-
Notifications
You must be signed in to change notification settings - Fork 182
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
Reliably mount input files #335
Comments
I don't like it, but I have to live with the idea that this feature will not have CI tests, at least for now. There are two reasons for that:
|
Take SELinux labels into account when mounting a file to the Dangerzone container. Use the `:Z` flag (which is a no-op in non-SELinux systems) to clear the existing SELinux label for a file, and apply one that matches the container's. Refs #335
Copy input files in a temporary dir before mounting them, thereby changing their permissions, without affecting the original files. This way, we can avoid cases where a file is accessible to the user only due to a supplemental user group, which does not work for containers. Fixes #157 Fixes #260 Fixes #335
Take SELinux labels into account when mounting a file to the Dangerzone container. Use the `:Z` flag (which is a no-op in non-SELinux systems) to clear the existing SELinux label for a file, and apply one that matches the container's. Refs #335
Copy input files in a temporary dir before mounting them, thereby changing their permissions, without affecting the original files. This way, we can avoid cases where a file is accessible to the user only due to a supplemental user group, which does not work for containers. Fixes #157 Fixes #260 Fixes #335
Take SELinux labels into account when mounting a file to the Dangerzone container. Use the `:Z` flag (which is a no-op in non-SELinux systems) to clear the existing SELinux label for a file, and apply one that matches the container's. Refs #335
Copy input files in a temporary dir before mounting them, thereby changing their permissions, without affecting the original files. This way, we can avoid cases where a file is accessible to the user only due to a supplemental user group, which does not work for containers. Fixes #157 Fixes #260 Fixes #335
Take SELinux labels into account when mounting a file to the Dangerzone container. Use the `:Z` flag (which is a no-op in non-SELinux systems) to clear the existing SELinux label for a file, and apply one that matches the container's. Refs #335
Copy input files in a temporary dir before mounting them, thereby changing their permissions, without affecting the original files. This way, we can avoid cases where a file is accessible to the user only due to a supplemental user group, which does not work for containers. Fixes #157 Fixes #260 Fixes #335
Take SELinux labels into account when mounting a file to the Dangerzone container. Use the `:Z` flag (which is a no-op in non-SELinux systems) to clear the existing SELinux label for a file, and apply one that matches the container's. Refs #335
The Dangerzone container runs with the same UID/GID (
--userns=keep-id
) as the user that runs the Dangerzone application in the host. However, this does not mean that the container can always read the files that the user can, mainly for two reasons:A file may belong to a different group:
The file may be accessible to the user outside the container solely because the user belongs to the same Unix group as the file. We already have error reports for that (Permission denied: container can't write to /dangerzone #157). The underlying cause for this error is that Podman does not pass supplemental group information to the container by default. For more info, read this Red Had article.
An SELinux policy may block access:
The file may have an SELinux label that does not match the container's. See this Red Hat article for more details. This issue has also been reported by our users (Permission denied: container can't write to /dangerzone #157 (comment)).
A solution to the above can be the following:
:Z
). It's important that we change the SELinux label in the copied file, else the original file would become inaccessible even from the host.The text was updated successfully, but these errors were encountered: