Skip to content
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

executor: Share selinux (process and mount) label of first stage with other stages in same build #3693

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Jan 9, 2022

Why do we need this ?

Buildah builds are composed of various stages. That is each stage in a build is a container.

As of now buildah does not provides any processLabel and mountLabel to the stage container which
results in c/storage assigning random generated selinux labels to each stage.

As a result this PR also enables following feature on systems with selinux enabled: #3590

Problem

If each stage has its own unqiue processLabel and mountLabel stages cannot be mounted across each other
in the same build. selinux prevents that.

Solution

We get the processLabel and mountLabel of the first stage created by the container i.e assigned by c/stoage
and share it with all the other subsequent stages of the same build.

@openshift-ci openshift-ci bot added the approved label Jan 9, 2022
@flouthoc
Copy link
Collaborator Author

flouthoc commented Jan 9, 2022

@flouthoc flouthoc changed the title executor: Share selinux (process and mount) label of first stage with other stages in same build executor: Share selinux (process and mount) label of first stage with other stages in same build Jan 9, 2022
@flouthoc flouthoc force-pushed the share-selinux-label-across-stage branch from 5325a1d to 204e2d2 Compare January 9, 2022 13:22
@rhatdan
Copy link
Member

rhatdan commented Jan 9, 2022

LGTM

@flouthoc flouthoc force-pushed the share-selinux-label-across-stage branch from 204e2d2 to d5dea4c Compare January 9, 2022 14:53
…uild

Buildah `builds` are composed of various `stages`. That is each `stage` in a build is a `container`.

As of now buildah does not provides any `processLabel` and `mountLabel` to the stage containers which
results in `c/storage` assigning random generated `selinux` labels to each stage.

If each stage has its own unqiue `processLabel` and `mountLabel` stages cannot be mounted across each other
in the same build as `selinux` prevents that.

We get the `processLabel` and `mountLabel` of the first stage created by the executor ( label assigned by `c/stoage` )
and share it with all the other subsequent stages of the same build.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
…abled

Stage mounting was not functionl for systems with `selinux` enabled
following commit makes sure we enable it and removes temporary
workaround/hack which was preventing to do it.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
@flouthoc flouthoc force-pushed the share-selinux-label-across-stage branch from d5dea4c to 5c26f71 Compare January 9, 2022 15:20
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 58a7d42 into containers:main Jan 10, 2022
@flouthoc
Copy link
Collaborator Author

This should also close: #3501 completely

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants