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: handle exception on early anaconda certificate import #6114

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
12 changes: 11 additions & 1 deletion pyanaconda/startup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
STORAGE,
TIMEZONE,
)
from pyanaconda.modules.common.errors.installation import SecurityInstallationError
from pyanaconda.modules.common.structures.logging import LoggingData
from pyanaconda.modules.common.structures.timezone import (
GeolocationData,
Expand Down Expand Up @@ -656,7 +657,16 @@ def initialize_security():
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
import_task_path = certificates_proxy.ImportWithTask()
task_proxy = SECURITY.get_proxy(import_task_path)
sync_run_task(task_proxy)
try:
sync_run_task(task_proxy)
except SecurityInstallationError as e:
log.error(e)
print(_("\nAn error occurred during certificate import:"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is so far ever going only via kickstart, right ? Then I would suggest adding that to the error message, something like:

An error occurred during certificate import from kickstart:

That should make it easier to track down & fix the issue, especially if its a third party seeing the error message and reporting it back (eq. an automated kickstart based deployment going wrong somewhere).

"\n%s\n") % str(e).strip())

print(_("The installation cannot continue"))
ipmi_report(IPMI_ABORTED)
sys.exit(1)


def print_dracut_errors(stdout_logger):
Expand Down