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

RHEL 8.2 tries to remove linux-firmware, when 2.2.2 does a yum remove xorg-x11* #4

Open
ahamilto156 opened this issue May 26, 2020 · 10 comments

Comments

@ahamilto156
Copy link

G'day Harry,

Again thx for writing this role. There is an issue with RHEL8.2: I have a work-around in my Ansible playbook, but thought you should know...

TASK [Ansible-RHEL8-CIS-Benchmarks : 2.2.2 - Ensure X Window System is absent, exception 123] => yum remove xorg-x11* => erroring on trying to remove linux-firmware. Q: why is it trying to remove it? A: Unknown ATM

The CIS play tries to remove xorg-x11* but fails if it is already absent. Workaround is to exclude test 2.2.2 on systems that have this issue. Also had other issues with this where the removal of xorg-x11* was successful but removes dependant packages installed by other processes - example being grafana, which installs an X11 font package - the hardening goes ahead and REMOVES xorg-x11* including the required font package. Bottom line, there are legitimate reasons to exclude a hardening task from a host - provided other mitigations are in place there shouldn't be any problems.

@HarryHarcourt
Copy link
Owner

Hi
In relation to this, it is a valid, I think, I did in the defaults/main.yml put a section in there:

# 2.2.2
# Installation of X-Windows
cis_xwindows_install: { package: "xorg-x11*", state: absent, exception: 123 }

You state whether you want the package present or absent, if you want it present, the "security exception" number or text should be added (in quotes).
I guess we need a "conditional" to check it's presence before trying to remove it.

@ahamilto156
Copy link
Author

ahamilto156 commented Jun 4, 2020 via email

@HarryHarcourt
Copy link
Owner

Hi Andrew
Would you like to share your condition?
Best
Ben

@ahamilto156
Copy link
Author

ahamilto156 commented Jun 10, 2020 via email

@HarryHarcourt
Copy link
Owner

Have you tried blocks before, this may prove and easier path.
https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html

@ahamilto156
Copy link
Author

ahamilto156 commented Jun 18, 2020 via email

@HarryHarcourt
Copy link
Owner

Do you think you could commit back into this effort?
Best
Ben

@ahamilto156
Copy link
Author

ahamilto156 commented Jun 18, 2020 via email

@ahamilto156
Copy link
Author

ahamilto156 commented Jun 22, 2020 via email

@brantleyp1
Copy link

I fumbled my way through it and found of the list of xorg-x11* packages, it was unhappy if I ran yum remove xorg-x11-drv*, but all the other packages were ok. So I edited my defaults/main.yaml to cis_xwindows_install: { package: "xorg-x11-docs*,xorg-x11-drivers*,xorg-x11-proto*,xorg-x11-server*,xorg-x11-utils*,xorg-x11-x*", state: absent, exception: 123 } and it was happy. Not sure if that's the best way to go about it, but it allows for keeping the x11 fonts but removing out all the other parts.

Oddly though, when I broke out the list of xorg-x11-drv* and ran each package of that individually, it never tried to remove linux-firmware.

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

No branches or pull requests

3 participants