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

security: call /usr/libexec/fips-setup-helper #5928

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anaconda.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Requires: python3-pid

# Required by the systemd service anaconda-fips.
Requires: crypto-policies
Requires: /usr/bin/update-crypto-policies
Requires: crypto-policies-scripts

# required because of the rescue mode and VNC question
Requires: anaconda-tui = %{version}-%{release}
Expand Down
9 changes: 3 additions & 6 deletions pyanaconda/modules/security/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,10 @@ def run(self):
log.debug("Don't set up FIPS on %s.", conf.target.type.value)
return

# We use the --no-bootcfg option as we don't want fips-mode-setup
# to modify the bootloader configuration. Anaconda already does
# everything needed & it would require grubby to be available on
# the system.
# Bootloader is not modified. Anaconda already does everything needed.
util.execWithRedirect(
"fips-mode-setup",
["--enable", "--no-bootcfg"],
"/usr/libexec/fips-setup-helper",
["anaconda"],
root=self._sysroot
)

Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/security/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def collect_requirements(self):
# Add FIPS requirements.
if self.fips_enabled:
requirements.append(Requirement.for_package(
"/usr/bin/fips-mode-setup",
"crypto-policies-scripts",
reason="Required for FIPS compliance."
))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def test_fips_requirements(self, kernel_arguments_mock):
assert self.security_interface.CollectRequirements() == [
{
"type": get_variant(Str, "package"),
"name": get_variant(Str, "/usr/bin/fips-mode-setup"),
"name": get_variant(Str, "crypto-policies-scripts"),
"reason": get_variant(Str, "Required for FIPS compliance.")
}
]
Expand Down Expand Up @@ -1038,7 +1038,7 @@ def test_configure_fips_task(self, mock_util):
task.run()

mock_util.execWithRedirect.assert_called_once_with(
"fips-mode-setup",
["--enable", "--no-bootcfg"],
"/usr/libexec/fips-setup-helper",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please cherry-pick the original commit and you will not need this fixup.

["anaconda"],
root="/mnt/sysroot"
)
Loading