def scan_domain(self, domain: str): log.info(f"Scan domain {domain}") scanner = DNSSECScanner(domain) try: result = scanner.run_scan() except Exception as e: self.results["DNSSEC-Other-Error-Domains"].append({ "domain": domain, "error": str(e) }) return self.results["DNSSEC-Logs-Domains"].append({ "domain": domain, "logs": result.logs }) self.results["DNSSEC-Warnings-Domains"].append({ "domain": domain, "warnings": result.warnings }) self.results["DNSSEC-Errors-Domains"].append({ "domain": domain, "errors": result.errors }) self.results["DNSSEC-Summary-Domains"].append({ "domain": domain, "status": result.state.value, "note": result.note })
def test_dnssec(self): scanner = DNSSECScanner("yes.com") result = scanner.run() self.assert_list(self.LOGS, result.logs) self.assert_list(self.WARNIGNS, result.warnings) self.assert_list(self.ERRORS, result.errors) self.assertEqual(State.SECURE, result.state)
def test_domains(self): for name, state in self.DOMAINS: scanner = DNSSECScanner(name) result = scanner.run() self.assertEqual( result.state, state, f"Domain: {name}, State: {result.state}, Real state: {state}", )
def test_dnssec(self): scanner = DNSSECScanner("www.dnssec-failed.org") result = scanner.run() self.assert_list(self.LOGS, result.logs) self.assert_list(self.WARNIGNS, result.warnings) self.assert_list(self.ERRORS, result.errors) self.assertEqual(State.BOGUS, result.state)
def test_dnssec(self): scanner = DNSSECScanner("www.ietf.org") result = scanner.run() self.maxDiff = None self.assert_list(self.LOGS, result.logs) self.assert_list(self.WARNIGNS, result.warnings) self.assert_list(self.ERRORS, result.errors) self.assertEqual(State.SECURE, result.state)