def test_analyse_sshd_config(self): """Tests the analyze_sshd_config method.""" config.LoadConfig() task = sshd.SSHDAnalysisTask() report = task.analyse_sshd_config(self.SSH_INSECURE_EVERYTHING) self.assertEqual(report, self.SSH_INSECURE_EVERYTHING_REPORT) report = task.analyse_sshd_config(self.SSH_SECURE_EVERYTHING) self.assertEqual(report, self.SSH_SECURE_EVERYTHING_REPORT)
def test_analyse_sshd_config(self): """Tests the analyze_sshd_config method.""" config.LoadConfig() task = sshd.SSHDAnalysisTask() (report, priority, summary) = task.analyse_sshd_config( self.SSH_INSECURE_EVERYTHING) self.assertEqual(report, self.SSH_INSECURE_EVERYTHING_REPORT) self.assertEqual(priority, 20) self.assertEqual(summary, self.SSH_INSECURE_EVERYTHING_SUMMARY) report = task.analyse_sshd_config(self.SSH_SECURE_EVERYTHING)[0] self.assertEqual(report, self.SSH_SECURE_EVERYTHING_REPORT)
def create_tasks(self, evidence): """Create task. Args: evidence: List of evidence object to process Returns: A list of tasks to schedule. """ tasks = [] for evidence_item in evidence: if evidence_item.artifact_name == 'SshdConfigFile': tasks.append(sshd.SSHDAnalysisTask()) return tasks