Skip to content

Introduce SELinux policy module for kiwi#2756

Draft
Conan-Kudo wants to merge 1 commit into
mainfrom
kiwi-selinux
Draft

Introduce SELinux policy module for kiwi#2756
Conan-Kudo wants to merge 1 commit into
mainfrom
kiwi-selinux

Conversation

@Conan-Kudo

Copy link
Copy Markdown
Member

This simple policy module ensures that the kiwi executable is labeled such that it works properly in SELinux enforcing mode.

This simple policy module ensures that the kiwi executable is
labeled such that it works properly in SELinux enforcing mode.
@Conan-Kudo

Copy link
Copy Markdown
Member Author

This is a fuller alternative to #2757 that lets us easily add more things in the future.

@Conan-Kudo Conan-Kudo closed this Mar 28, 2025
@Conan-Kudo Conan-Kudo deleted the kiwi-selinux branch March 28, 2025 14:30
@Conan-Kudo Conan-Kudo restored the kiwi-selinux branch March 31, 2025 15:13
@Conan-Kudo Conan-Kudo reopened this Mar 31, 2025
@schaefi

schaefi commented Apr 1, 2025

Copy link
Copy Markdown
Collaborator

Really nice, thanks for this work 👍 I'm pretty dumb regarding selinux policies. Would be great if we get some reviewer with knowledge in that area. Otherwise I'm perfectly fine adding it the way you did it because I believe you tested it to work :)

@ca-hu

ca-hu commented Apr 4, 2025

Copy link
Copy Markdown

question: why add this as separate module here instead of in the fedora policy that is used by almost everyone? usually this only makes sense when the maintainers of the project are well-versed in selinux and can maintain this module long-term, otherwise you will run into more issues

also it is a bit odd that the module is reusing an existing type, usually modules define their own types and rules around their type

also: what exactly is breaking?

@Conan-Kudo

Copy link
Copy Markdown
Member Author

question: why add this as separate module here instead of in the fedora policy that is used by basically everyone? usually this only makes sense when the maintainers of the project are well-versed in selinux and can maintain this module long-term, otherwise you will run into more issues

Well, I am well-versed in SELinux. I've done a fair bit of SELinux policy work over the years in both Fedora and openSUSE. And as a team, we do need to develop more skill with SELinux anyway, since not knowing how to deal with it is bad for us as an image build tool.

But there are two big reasons:

  • We need this to work across all distributions and releases using SELinux. And some of those would not get a policy update with this for a long time (if ever).
  • We need a "fast path" since kiwi releases much more frequently than the policy package.

This does not preclude contributing it into fedora-selinux, and that will probably happen down the road as this is firmed up.

also it is a bit odd that the module is reusing an existing type, usually modules define their own types and rules around their type

Yes, I will probably change to this approach, but I need to spend more time to write it.

@Conan-Kudo

Copy link
Copy Markdown
Member Author

also: what exactly is breaking?

There have been requests from Fedora and CentOS to make kiwi work properly in SELinux enforcing mode as all the legacy image build tools in Fedora already do. After soliciting some advice from the OSBuild folks, I had identified an approach to resolve that problem. It also neatly resolves a problem nobody has yet noticed in openSUSE, in which you cannot build an image in SELinux enforcing mode.

@github-actions

github-actions Bot commented Oct 3, 2025

Copy link
Copy Markdown

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed as part of the community meeting.

@github-actions github-actions Bot added the stale label Oct 3, 2025
@schaefi

schaefi commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

@Conan-Kudo it would be so great to see this merged, it feels we are so close

@Conan-Kudo

Copy link
Copy Markdown
Member Author

Yeah, I want to resume this work asap.

@schaefi schaefi removed the stale label Nov 17, 2025
@schaefi

schaefi commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

Yeah, I want to resume this work asap.

I think we are desperately waiting for this to come true ;)

@Conan-Kudo

Copy link
Copy Markdown
Member Author

Coming back to it now, don't worry. 👍🏾

@schaefi

schaefi commented Feb 22, 2026

Copy link
Copy Markdown
Collaborator

Coming back to it now, don't worry. 👍🏾

@Conan-Kudo Are you sure ;)

@Conan-Kudo

Copy link
Copy Markdown
Member Author

Yes, yes! :)

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed as part of the community meeting.

@github-actions github-actions Bot added the stale label Apr 24, 2026
@schaefi

schaefi commented May 4, 2026

Copy link
Copy Markdown
Collaborator

I guess we still want this, dropping stale label

@schaefi schaefi removed the stale label May 4, 2026
@Vogtinator

Copy link
Copy Markdown
Collaborator

I guess we still want this

IMO no, this really belongs in the main upstream policy.

@Conan-Kudo

Copy link
Copy Markdown
Member Author

I've already talked to the fedora-selinux people. We will need it here regardless because when we change things that require new knobs, we need a way to backport it.

@Conan-Kudo

Copy link
Copy Markdown
Member Author

I've been asked to rewrite this to use its own labels and policy tunables, which is why this is taking so long...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants