Ejemplo n.º 1
0
    def translate_ssh(self):
        if self.__is_persisted("/etc/ssh/sshd_config"):
            pw_auth_enabled = ovirtfunctions.augtool_get(
                "/files/etc/ssh/sshd_config/PasswordAuthentication")
            rng_bytes, aes_disabled = ovirtfunctions.rng_status()

            rng_bytes = None if rng_bytes == 0 else rng_bytes
            aes_disabled = aes_disabled == 1
            ssh_is_enabled = parse_bool(pw_auth_enabled)

            if rng_bytes:
                self.aug.set("/files/etc/default/ovirt/OVIRT_USE_STRONG_RNG",
                             str(rng_bytes))
            if aes_disabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_DISABLE_AES_NI",
                             "true")
            if ssh_is_enabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_SSH_PWAUTH",
                             "yes")
Ejemplo n.º 2
0
    def translate_ssh(self):
        if self.__is_persisted("/etc/ssh/sshd_config"):
            pw_auth_enabled = ovirtfunctions.augtool_get(
                "/files/etc/ssh/sshd_config/PasswordAuthentication")
            rng_bytes, aes_enabled = ovirtfunctions.rng_status()

            rng_bytes = None if rng_bytes == 0 else rng_bytes
            aes_disabled = False if aes_enabled == "1" else True
            ssh_is_enabled = parse_bool(pw_auth_enabled)

            if rng_bytes:
                self.aug.set("/files/etc/default/ovirt/OVIRT_USE_STRONG_RNG",
                             str(rng_bytes))
            if aes_disabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_DISABLE_AES_NI",
                             "true")
            if ssh_is_enabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_SSH_PWAUTH",
                             "yes")
Ejemplo n.º 3
0
    def translate_ssh(self):
        from ovirt.node.utils import parse_bool
        from ovirt.node.utils.security import Ssh

        if self.__is_persisted("/etc/ssh/sshd_config"):
            pw_auth_enabled = aug_unwrapped.get(
                "/files/etc/ssh/sshd_config/PasswordAuthentication")
            rng_bytes, aes_disabled = Ssh().rng_status()

            rng_bytes = None if rng_bytes == 0 else rng_bytes
            aes_disabled = aes_disabled == 1
            ssh_is_enabled = parse_bool(pw_auth_enabled)

            if rng_bytes:
                self.aug.set("/files/etc/default/ovirt/OVIRT_USE_STRONG_RNG",
                             str(rng_bytes))
            if aes_disabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_DISABLE_AES_NI",
                             "true")
            if ssh_is_enabled:
                self.aug.set("/files/etc/default/ovirt/OVIRT_SSH_PWAUTH",
                             "yes")
Ejemplo n.º 4
0
 def update(self, enabled):
     return {"OVIRT_CIM_ENABLED":
             "1" if utils.parse_bool(enabled) else None}
Ejemplo n.º 5
0
 def update(self, enabled):
     return {
         "OVIRT_SNMP_ENABLED": "1" if utils.parse_bool(enabled) else None
     }