Skip to content

Add relabel option to secrets #1210

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add relabel option to secrets #1210

wants to merge 1 commit into from

Conversation

jarovo
Copy link

@jarovo jarovo commented May 18, 2025

On selinux enabled system, the secrets cannot be read without proper relabeling or correct policy being set.

This patch enables user to instruc podman-copose to use :z or :Z mount options to make podman relabel the file under bind-mount.

More info here:
https://unix.stackexchange.com/questions/728801/host-wide-consequences-of-setting-selinux-z-z-option-on-container-bind-mounts?rq=1

Contributor Checklist:

If this PR adds a new feature that improves compatibility with docker-compose, please add a link
to the exact part of compose spec that the PR touches.

For any user-visible change please add a release note to newsfragments directory, e.g.
newsfragments/my_feature.feature. See newsfragments/README.md for more details.

All changes require additional unit tests.

On selinux enabled system, the secrets cannot be read without proper
relabeling or correct policy being set.

This patch enables user to instruc podman-copose to use :z or :Z mount
options to make podman relabel the file under bind-mount.

More info here:
https://unix.stackexchange.com/questions/728801/host-wide-consequences-of-setting-selinux-z-z-option-on-container-bind-mounts?rq=1

Signed-off-by: Jaroslav Henner <1187265+jarovo@users.noreply.github.com>
@p12tic
Copy link
Collaborator

p12tic commented May 19, 2025

Is this part of compose spec? Seems that no. In such case it should be named with x-podman. prefix and documentation added to docs/Extensions.md. I also don't think that relabel is clear name, though I don't have better suggestions at this time.

@jarovo
Copy link
Author

jarovo commented May 19, 2025

Is this part of compose spec? Seems that no. In such case it should be named with x-podman. prefix and documentation added to docs/Extensions.md. I also don't think that relabel is clear name, though I don't have better suggestions at this time.

Thanks for the suggestion. It is not a part of the docker-compose spec and i don't know about any equivalent option there.

What about changig this to zzmount?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants