Skip to content

Conversation

@craigcomstock
Copy link
Contributor

@craigcomstock craigcomstock commented Nov 3, 2025

We have found that this requirement cannot be met in the field so we are investigating other ways to ensure the latest SELinux policy can be put in place during install.

Ticket: ENT-12980
Changelog: title

together
#2019
cfengine/core#5934

@craigcomstock
Copy link
Contributor Author

craigcomstock commented Nov 3, 2025

community redhat packages for testing: Build Status

@craigcomstock craigcomstock changed the title \ Fixed how rpm packages install selinux policy Nov 3, 2025
@craigcomstock
Copy link
Contributor Author

proper filter !HUB, to get rhel 7,8,9,10 packages Build Status

@craigcomstock
Copy link
Contributor Author

need ent packages for testing: Build Status

@craigcomstock craigcomstock force-pushed the ent-12980/master branch 3 times, most recently from 57f6113 to bf0846e Compare November 10, 2025 17:04
@craigcomstock
Copy link
Contributor Author

next try after polishing these prs up a bit Build Status

@craigcomstock
Copy link
Contributor Author

core Makefile.am was broken. fixed now: Build Status

@craigcomstock
Copy link
Contributor Author

fixed path to label script: Build Status

@craigcomstock
Copy link
Contributor Author

rebuild after fixing up label script Build Status

@craigcomstock
Copy link
Contributor Author

needed more fixing Build Status

@craigcomstock craigcomstock requested review from larsewi, nickanderson and vpodzime and removed request for nickanderson November 13, 2025 02:26
@craigcomstock craigcomstock marked this pull request as ready for review November 13, 2025 03:08
@craigcomstock
Copy link
Contributor Author

I will do testing of these packages tomorrow. I suspect they will work as-designed.

@craigcomstock craigcomstock force-pushed the ent-12980/master branch 3 times, most recently from 4dc0c12 to 6c520f7 Compare November 13, 2025 04:06
…y version is not sufficient

As a workaround, if the cfengine-enterprise selinux module fails to install we set binaries to unconfined domain with bin_t type.

Ticket: ENT-12980
Changelog: title
@craigcomstock
Copy link
Contributor Author

Testing looks good. Let's give it a go: @cf-bottom jenkins with exotics please. Thanks.

@cf-bottom
Copy link

@craigcomstock
Copy link
Contributor Author

more failures with time_based_vars as in cfengine/masterfiles#3074. Maybe that failing is a flake of running at a particular time of day? Let's retry without deployment tests: Build Status

@vpodzime vpodzime changed the title Fixed how rpm packages install selinux policy Adjusted RPM packaging to be avoid failed installs when selinux-policy version is not sufficient Nov 14, 2025
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Looks good to me otherwise.

Requires: selinux-policy >= @@SELINUX_POLICY_VERSION@@
Recommends: selinux-policy >= @@SELINUX_POLICY_VERSION@@
# Also we Recommend policycoreutils-python-utils as it contains semanage which is used by the fallback labeling script.
Recommends: policycoreutils-python-utils
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this will try to install policycoreutils-python-utils even to systems that have the desired version of selinux-policy. I'm not sure we can do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right! I was hopimg there was an alt way to set fcontext. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not aware of any. We would probably have to write something ourselves (based on libselinux) and make it part of our packages.

and then restarting services with \
\
systemctl restart cfengine3"
cf_console echo "warning! semodule import failed, as a fallback all binaries in $PREFIX will be labeled bin_t aka unconfined. \
Copy link
Contributor

Choose a reason for hiding this comment

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

Preexisting, but I think warning: is more common than warning!, esp. now that we also have notice:. And maybe we should also add some info: messages telling the users what's happening?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants