Skip to content

Commit

Permalink
fix(10-042): make changes in audit_ssh_authorizedkeys compatible with…
Browse files Browse the repository at this point in the history
… python2.7
  • Loading branch information
s3lph committed Jan 30, 2023
1 parent 5941bc8 commit 5202337
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugins/modules/audit_ssh_authorizedkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def run_module():
line = line.split('#', 1)[0].strip()
if not line:
continue
db, *backends = line.split()
tokens = line.split()
db, backends = tokens[0], tokens[1:]
if db != 'passwd:':
continue
for backend in backends:
Expand Down Expand Up @@ -197,7 +198,7 @@ def run_module():
module.fail_json(msg='SSHD configuration invalid (or insufficient privileges, try become_user=root become=yes)', **result)

for cline in sshd_stdout.decode().splitlines():
conf = cline.split(maxsplit=1)
conf = cline.split(None, 1)
if conf[0] == 'authorizedkeyscommand' and conf[1] != 'none':
msg = 'AuthorizedKeysCommand is configured: "{}". Keys returned by this command are not audited.'.format(conf[1])
warnings.append(msg)
Expand Down

0 comments on commit 5202337

Please sign in to comment.