Skip to content
Closed
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
32 changes: 32 additions & 0 deletions hpctestlib/system/ssh/ssh_audit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2016-2023 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause

import reframe as rfm
import reframe.utility.sanity as sn


@rfm.simple_test
class ssh_audit_check(rfm.RunOnlyRegressionTest):
'''ssh audit config test.

ssh-audit is a tool for ssh server & client configuration auditing.

The check consist on performing the basic ssh server config auditing
using the master version of https://github.com/jtesta/ssh-audit.
'''

executable = './ssh-audit.py'
executable_opts = ['-n', '-l', 'fail', 'localhost']
sourcesdir = 'https://github.com/jtesta/ssh-audit'
tags = {'system', 'ssh'}

@sanity_function
def assert_no_fails_are_found(self):
'''Assert that no fails are reported by the tool.'''

return sn.assert_not_found(
r'\S+\s+--\s+\[fail\]', self.stdout,
msg=(f"found ssh config failures")
)