From 78065f86281bcfc5078e93fb289b9228b9dbd04c Mon Sep 17 00:00:00 2001 From: jams008 Date: Thu, 11 May 2023 12:50:42 +0700 Subject: [PATCH] update miss check on 2.2.1.1 , 5.3.2 and 5.3.3 Signed-off-by: jams008 --- cis_audit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cis_audit.py b/cis_audit.py index b8892df..b53fd6f 100755 --- a/cis_audit.py +++ b/cis_audit.py @@ -1463,7 +1463,7 @@ def audit_only_one_package_is_installed(self, packages: str) -> int: ## ['chrony-3.4-1.el7.x86_64'] ## ['chrony-3.4-1.el7.x86_64', 'ntp-4.2.6p5-29.el7.centos.2.x86_64'] - if len(r.stdout) == 1 and r.stdout != ['']: + if len(r.stdout) >= 1 and r.stdout != ['']: state = 0 else: state = 1 @@ -1661,7 +1661,7 @@ def audit_permissions_on_private_host_key_files(self) -> int: cmd = R"/usr/sbin/sshd -T" r = self._shellexec(cmd) - regex = re.compile(R'^hostkey\s') + regex = re.compile(R'_key$\s') for line in r.stdout: if regex.match(line): files.append(line.split()[1]) @@ -1684,7 +1684,7 @@ def audit_permissions_on_public_host_key_files(self) -> int: cmd = R"/usr/sbin/sshd -T" r = self._shellexec(cmd) - regex = re.compile(R'^hostkey\s') + regex = re.compile(R'_key\s') for line in r.stdout: if regex.match(line): files.append(line.split()[1])