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

container-selinux install on non selinux-policy-targeted systems #332

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Sep 18, 2024

Helps fix: #331

@rhatdan
Copy link
Member Author

rhatdan commented Sep 18, 2024

@lsm5 PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Sep 18, 2024

@ewee33 PTAL

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@rhatdan rhatdan changed the title cintainer-selinux install on non selinux-policy-targeted systems container-selinux install on non selinux-policy-targeted systems Sep 18, 2024
@lsm5
Copy link
Member

lsm5 commented Sep 19, 2024

/packit build
/packit test

@@ -51,7 +50,8 @@ BuildRequires: selinux-policy-devel >= %_selinux_policy_version
# RE: rhbz#1195804 - ensure min NVR for selinux-policy
Requires: selinux-policy >= %_selinux_policy_version
Requires(post): selinux-policy-base >= %_selinux_policy_version
Requires(post): selinux-policy-targeted >= %_selinux_policy_version
Requires(post): selinux-policy-any >= %_selinux_policy_version
Recommends(post): selinux-policy-targeted >= %_selinux_policy_version
Copy link
Member

Choose a reason for hiding this comment

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

doesn't look like Recommends(post) is a thing. Also, should we even recommend install of -targeted on non-targeted systems? Maybe we can just delete this line?

Copy link
Member

Choose a reason for hiding this comment

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

rpm builds are failing on Unknown tag: Recommends(post): selinux-policy-targeted >= %_selinux_policy_version

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should remove the (post) then.

Copy link
Member

Choose a reason for hiding this comment

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

that would probably end up installing -targeted on MLS systems unless it's a fedora-server or another environment where weak dependencies are ignored. Is that acceptable?

Copy link
Member

Choose a reason for hiding this comment

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

Err, my bad. It won't install -targeted if something else is present. Anyway, it'd be good to have this verified on an MLS env before merge. @ewee33 could you try to install the test rpms? See https://dashboard.packit.dev/jobs/copr/1883709 for instructions

Copy link

Choose a reason for hiding this comment

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

Unfortunately my system is RHEL 8, and the build only has an epel-9 version. Are you able to make an epel-8 version? Or alternatively are you able to provide instructions on how I could build the RPM from source on my RHEL 8 system?

Copy link
Member

Choose a reason for hiding this comment

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

@ewee33 I'm afraid making it build on rhel8 envs could be quite a bit of trouble, especially with selinux-policy and other dependencies being a lot older. Any chance you could switch your machine to EL9 or fedora?

I can send out the build instructions to you in a bit, but if things break, you're probably on your own.

Copy link

Choose a reason for hiding this comment

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

@lsm5 unfortunately I don't think switching to EL9 or fedora is an option for me.

So does this package no longer support RHEL 8? Is that a recent development? I have been working with the container-selinux-2:2.229.0-2.module+el8.10.0+22202+761b9a65.noarch RPM, which seems to support RHEL 8 systems. If RHEL 8 is no longer supported, it seems like I won't be able to install this package directly from a dnf install.

I would still appreciate build instructions if it's not too much trouble. I can try to revert to v2.229.0 and make identical changes to the RPM spec as were made in this PR, then build from there. I think it's very likely that I will still run into problems when installing the module itself, as it will likely try to reference types/interfaces from selinux-policy-targeted that don't exist on my system. I can see if I'm able to work through those.

Copy link
Member

Choose a reason for hiding this comment

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

@lsm5 unfortunately I don't think switching to EL9 or fedora is an option for me.

So does this package no longer support RHEL 8? Is that a recent development? I have been working with the container-selinux-2:2.229.0-2.module+el8.10.0+22202+761b9a65.noarch RPM, which seems to support RHEL 8 systems. If RHEL 8 is no longer supported, it seems like I won't be able to install this package directly from a dnf install.

IIUC, there will be security updates / cve fixes to the versions that are already shipped on active releases of RHEL 8, but highly unlikely that rhel8 will get any new versions of packages. So, you'll probably not see any v2.230 of container-selinux on rhel8.

I would still appreciate build instructions if it's not too much trouble. I can try to revert to v2.229.0 and make identical changes to the RPM spec as were made in this PR, then build from there. I think it's very likely that I will still run into problems when installing the module itself, as it will likely try to reference types/interfaces from selinux-policy-targeted that don't exist on my system. I can see if I'm able to work through those.

RE: building yourself, maybe you can try this:

  1. Clone the rhel8.10 container-seilnux source
  2. Apply the changes from this PR to the cloned source. You'll probably need to do that manually as patching tools may not cleanly apply
  3. Fetch source tarball with: $ spectool -g container-selinux.spec
  4. Build rpm with: $ rpmbuild -ba container-selinux.spec

@lsm5
Copy link
Member

lsm5 commented Sep 19, 2024

I think it would be good to include a basic installation test for an MLS env. @rhatdan if you agree I can include a TMT test in a followup PR.

Helps fix: containers#331

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member Author

rhatdan commented Oct 6, 2024

Sure having an MLS test, would keep us honest.

@lsm5
Copy link
Member

lsm5 commented Oct 7, 2024

Filed #334 to add tests, but I think that need not block merge.

@lsm5 lsm5 merged commit 74ab259 into containers:main Oct 7, 2024
14 checks passed
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.

3 participants