|
1 | 1 | from leapp import reporting |
2 | 2 | from leapp.actors import Actor |
3 | 3 | from leapp.exceptions import StopActorExecutionError |
4 | | -from leapp.libraries.actor.opensshpermitrootlogincheck import global_value, semantics_changes |
| 4 | +from leapp.libraries.actor.opensshpermitrootlogincheck import global_value, semantics_changes, add_permitrootlogin_conf |
5 | 5 | from leapp.libraries.common.config.version import get_source_major_version |
6 | 6 | from leapp.libraries.stdlib import api |
7 | 7 | from leapp.models import OpenSshConfig, Report |
@@ -64,25 +64,29 @@ def process7to8(self, config): |
64 | 64 | # the configuration file was locally modified, it will not get updated by |
65 | 65 | # RPM and the user might be locked away from the server with new default |
66 | 66 | if not config.permit_root_login: |
| 67 | + add_permitrootlogin_conf() |
67 | 68 | create_report([ |
68 | | - reporting.Title('Possible problems with remote login using root account'), |
69 | | - reporting.Summary( |
70 | | - 'OpenSSH configuration file does not explicitly state ' |
71 | | - 'the option PermitRootLogin in sshd_config file, ' |
72 | | - 'which will default in RHEL8 to "prohibit-password".' |
73 | | - ), |
74 | | - reporting.Severity(reporting.Severity.HIGH), |
75 | | - reporting.Groups(COMMON_REPORT_TAGS), |
76 | | - reporting.Remediation( |
77 | | - hint='If you depend on remote root logins using passwords, consider ' |
78 | | - 'setting up a different user for remote administration or adding ' |
79 | | - '"PermitRootLogin yes" to sshd_config. ' |
80 | | - 'If this change is ok for you, add explicit ' |
81 | | - '"PermitRootLogin prohibit-password" to your sshd_config ' |
82 | | - 'to ignore this inhibitor' |
83 | | - ), |
84 | | - reporting.Groups([reporting.Groups.INHIBITOR]) |
85 | | - ] + COMMON_RESOURCES) |
| 69 | + reporting.Title('SSH configuration automatically modified to permit root login'), |
| 70 | + reporting.Summary( |
| 71 | + 'Your OpenSSH configuration file does not explicitly state ' |
| 72 | + 'the option PermitRootLogin in sshd_config file. ' |
| 73 | + 'Its default is "yes" in RHEL7, but will change in ' |
| 74 | + 'RHEL8 to "prohibit-password", which may affect your ability ' |
| 75 | + 'to log onto this machine after the upgrade. ' |
| 76 | + 'To prevent this from occuring, the PermitRootLogin option ' |
| 77 | + 'has been explicity set to "yes" to preserve the default behaivour ' |
| 78 | + 'after migration. ' |
| 79 | + 'The original configuration file has been backed up to ' |
| 80 | + '/etc/ssh/sshd_config.leapp_backup' |
| 81 | + ), |
| 82 | + reporting.Severity(reporting.Severity.MEDIUM), |
| 83 | + reporting.Groups(COMMON_REPORT_TAGS), |
| 84 | + reporting.Remediation( |
| 85 | + hint='If you would prefer to configure the root login policy yourself, ' |
| 86 | + 'consider setting the PermitRootLogin option ' |
| 87 | + 'in sshd_config explicitly.' |
| 88 | + ) |
| 89 | + ] + resources) |
86 | 90 | return |
87 | 91 |
|
88 | 92 | # Check if there is at least one PermitRootLogin other than "no" |
|
0 commit comments