Skip to content
Open
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
6 changes: 3 additions & 3 deletions cis_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand All @@ -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])
Expand Down