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

Fix grub2 enable fips mode rule #4986

Merged

Conversation

ggbecker
Copy link
Member

@ggbecker ggbecker commented Nov 6, 2019

Description:

The problem was that it may happen that bash remediation phase when doing a fresh installation, some functions may require installing package, but it can happen that the machine is not registered to any repository yet, so the package installation should happen during the package installation phase via anaconda.

  • Add dracut-fips-aesni to anaconda remediation for grub2_enable_fips_mode rule.
  • Fix log of disable_prelink to detect the presence of prelink package as we changed the bash code to be a macro and it is not a function anymore, so we cannot use neither return statement nor exit, now it skips correctly when the package is not installed.

Rationale:

@ggbecker ggbecker added the Bash Bash remediation update. label Nov 6, 2019
@ggbecker ggbecker added this to the 0.1.48 milestone Nov 6, 2019
@redhatrises
Copy link
Contributor

dracut-fips-aesni was purposefully not added to anaconda remediations. The reason is that you cannot guarantee that you are running or using aesni enabled processors. We would need to add some sort of code to OAA to handle if aesni processors are detected.

Since this piece of code is not a bash function anymore, it is not
possible to use the return statement, so inverting the logic of the test
did the trick.
@ggbecker ggbecker force-pushed the fix-grub2-enable-fips-mode-rule branch from bf1ea50 to 6c71820 Compare November 6, 2019 16:19
@ggbecker
Copy link
Member Author

ggbecker commented Nov 6, 2019

dracut-fips-aesni was purposefully not added to anaconda remediations. The reason is that you cannot guarantee that you are running or using aesni enabled processors. We would need to add some sort of code to OAA to handle if aesni processors are detected.

I understand. But is it harmful to install the package even if the processor doesn't support the hardware acceleration? Otherwise we won't have this rule green during installation on a machine which is not subscribed during installation phase.

@ggbecker
Copy link
Member Author

ggbecker commented Nov 6, 2019

* Fix log of disable_prelink to detect the presence of prelink package as we changed the bash code to be a macro and it is not a function anymore, so we cannot use neither `return` statement nor `exit`, now it skips correctly when the package is not installed.

Even if installing the package dracut-fips-aesni through anaconda without proper handling of processor capabilities is not desired, the above is still valid.

@jan-cerny
Copy link
Collaborator

Related to #4300 and #3221

@ggbecker We don't know if adding the dracut-fips-aesni package breaks the operating system installation on processors which don't have this technology.

@ggbecker
Copy link
Member Author

I've consulted dracut subject matter experts from: https://github.com/dracutdevs/dracut and they say it is not harmful to install dracut-fips-aesni as kernel will just ignore the modules:

quoting:

it only includes aesni-intel ghash_clmulni_intel kernel modules to the initrd if they are available on the system

I've tested on other architectures such as ppc64,s390x,etc and the package is present on those archs as well and can be installed without any problem.

rpm -qa dracut-fips-aesni
dracut-fips-aesni-033-568.el7.ppc64

@matejak
Copy link
Member

matejak commented Nov 11, 2019

I am merging this PR, as it makes the OSPP/STIG profile one rule greener.
As @redhatrises pointed out, the Anaconda remediation could be smarter, but thanks to the great job of @ggbecker with consulting SMEs and testing, we have confidence that the PR doesn't introduce any adverse effects to remediated systems.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bash Bash remediation update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants