def analyze(conf, input): checkConfigRequirements(conf) meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) response = sendReq(conf, meta, data["value"]) return prepareResults(response)
def analyze(input): meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) payload = buildReq(data["value"]) response = sendReq(meta, payload) return prepareResults(response)
def analyze(conf, input): checkConfigRequirements(conf) meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) search = searchFile(data["value"], conf['file_path']) results = prepareResults(search) return results
def test_checkSupportedType(self): with patch('sys.exit', new=MagicMock()) as mock: meta = {"supportedTypes": ["ip", "foo"]} result = helpers.checkSupportedType(meta, "ip") self.assertTrue(result) mock.assert_not_called() result = helpers.checkSupportedType(meta, "bar") self.assertFalse(result) mock.assert_called_once_with(126)
def analyze(conf, input): checkConfigRequirements(conf) meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) request = buildReq(conf, data["artifactType"], data["value"]) report_url = sendReq(request[0], request[1], request[2]) time.sleep(10) report = getReport(conf, report_url) return prepareResults(report.json())
def analyze(config, input): meta = helpers.loadMetadata(__file__) data = helpers.parseArtifact(input) helpers.checkSupportedType(meta, data["artifactType"]) response = resolve(config, meta, data["value"]) return prepareResults(response)