yast / yast-installation

YaST module installation
http://en.opensuse.org/Portal:YaST
GNU General Public License v2.0
16 stars 44 forks source link

Don't always Enable SSHD and Open SSH Port [SLE-15-SP4] #1089

Closed shundhammer closed 1 year ago

shundhammer commented 1 year ago

This is superseded by a new PR.

New PR: #1090

teclator commented 1 year ago

Until now, the SecuritySettings instance was created at the proposal summary step or by AutoYaST when it was needed and after the users configuration was already done. But since we added security policies support (STIG) this is different and it is evaluated too early mainly because it also create and instance of SecuritySettings during the initialization instead of doing it using a lazy load init.

We already have a propose_lsm_config as part of the initialization, maybe we should move that proposal and the ssh config proposal to a propose method which will be called when it is really needed storing that the propose is already done just to avoid resetting it like:

def propose!
  return if @propose

  propose_lsm_config
  propose_ssh_config
  @propose = true
end
teclator commented 1 year ago

The other options is fix the initialization of the SecurityPolicies::TargetConfig moving the @security accessor to a method

https://github.com/yast/yast-security/pull/128/files#diff-b6b853b94bce3cd38105d93a59732aa0345ed6ad7e53df5afad8e337d13bdb7cR54