From ce319c2feaaef8a8ccf949060f788c4bc2ff809d Mon Sep 17 00:00:00 2001 From: Guillaume BOURGEOIS Date: Sun, 12 Jul 2026 15:49:17 +0200 Subject: [PATCH] feat(intel471): new Intel 471 threat-intel integration Intel 471 Titan API v1, 5 commands: search reports/indicators, get report, list CVE reports. HTTP Basic auth, stdlib-only. Co-Authored-By: Claude Opus 4.8 (1M context) --- integrations/intel471/manifest.yaml | 70 +++++++++++++++++++ integrations/intel471/scripts/get_report.py | 52 ++++++++++++++ .../intel471/scripts/list_cve_reports.py | 48 +++++++++++++ .../intel471/scripts/search_indicators.py | 48 +++++++++++++ .../intel471/scripts/search_reports.py | 48 +++++++++++++ .../intel471/scripts/test_connection.py | 47 +++++++++++++ 6 files changed, 313 insertions(+) create mode 100644 integrations/intel471/manifest.yaml create mode 100644 integrations/intel471/scripts/get_report.py create mode 100644 integrations/intel471/scripts/list_cve_reports.py create mode 100644 integrations/intel471/scripts/search_indicators.py create mode 100644 integrations/intel471/scripts/search_reports.py create mode 100644 integrations/intel471/scripts/test_connection.py diff --git a/integrations/intel471/manifest.yaml b/integrations/intel471/manifest.yaml new file mode 100644 index 0000000..2bdefb9 --- /dev/null +++ b/integrations/intel471/manifest.yaml @@ -0,0 +1,70 @@ +id: intel471 +name: Intel 471 +version: 1.0.0 +description: "Intel 471 (Titan API v1) — cyber threat intelligence: search reports and indicators, read a report, and list CVE reports. HTTP Basic authentication; stdlib-only, no extra Python dependencies." +changelog: "1.0.0 — Initial release: search reports/indicators, get report, list CVE reports." +category: threat_intel + +# Per-instance configuration. HTTP Basic auth with the account email + API key. +config_schema: + properties: + email: + type: string + description: "Account email" + api_key: + type: string + description: "API key" + x-soar-sensitive: true + required: + - email + - api_key + +commands: + - id: search_reports + name: intel471-search-reports + description: "Search intelligence reports." + risk: read + inputs_schema: + properties: + text: { type: string, description: "Full-text search" } + count: { type: number, description: "Max reports (default 25)" } + required: [] + outputs_schema: { properties: {} } + - id: get_report + name: intel471-get-report + description: "Get a single report by UID." + risk: read + inputs_schema: + properties: + report_uid: { type: string, description: "Report UID" } + required: [report_uid] + outputs_schema: { properties: {} } + - id: search_indicators + name: intel471-search-indicators + description: "Search indicators." + risk: read + inputs_schema: + properties: + indicator: { type: string, description: "Indicator value or search term" } + count: { type: number, description: "Max indicators (default 25)" } + required: [] + outputs_schema: { properties: {} } + - id: list_cve_reports + name: intel471-list-cve-reports + description: "List CVE reports." + risk: read + inputs_schema: + properties: + cve: { type: string, description: "Optional CVE ID filter (e.g. CVE-2024-1234)" } + count: { type: number, description: "Max reports (default 25)" } + required: [] + outputs_schema: { properties: {} } + + - id: test_connection + name: intel471-test-connection + description: "Verify the credentials (used by the Test button)." + risk: read + inputs_schema: + properties: {} + required: [] + outputs_schema: { properties: {} } diff --git a/integrations/intel471/scripts/get_report.py b/integrations/intel471/scripts/get_report.py new file mode 100644 index 0000000..01ba4f0 --- /dev/null +++ b/integrations/intel471/scripts/get_report.py @@ -0,0 +1,52 @@ +import json, os, sys, base64, urllib.parse, urllib.request, urllib.error + +BASE = "https://api.intel471.com/v1" + + +def _cfg(): + return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}")) + + +def _inputs(): + return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}")) + + +def _auth(cfg): + raw = str(cfg.get("email", "")) + ":" + str(cfg.get("api_key", "")) + return "Basic " + base64.b64encode(raw.encode("utf-8")).decode("utf-8") + + +def request(path, cfg, params=None): + url = BASE + path + if params: + clean = {k: v for k, v in params.items() if v not in (None, "")} + if clean: + url += "?" + urllib.parse.urlencode(clean) + req = urllib.request.Request(url, headers={"Authorization": _auth(cfg), "Accept": "application/json"}, method="GET") + with urllib.request.urlopen(req, timeout=60) as r: + raw = r.read() + return json.loads(raw) if raw else {} + + +def _run(fn): + try: + print(json.dumps(fn(_cfg(), _inputs()))) + except urllib.error.HTTPError as e: + print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")})) + sys.exit(1) + except Exception as e: + print(json.dumps({"error": str(e)})) + sys.exit(1) + + +q = lambda v: urllib.parse.quote(str(v), safe="") + + +def main(cfg, inputs): + report_uid = inputs.get("report_uid") + if not report_uid: + raise Exception("report_uid is required") + return request("/reports/" + q(report_uid), cfg) + + +_run(main) diff --git a/integrations/intel471/scripts/list_cve_reports.py b/integrations/intel471/scripts/list_cve_reports.py new file mode 100644 index 0000000..e3ea7b0 --- /dev/null +++ b/integrations/intel471/scripts/list_cve_reports.py @@ -0,0 +1,48 @@ +import json, os, sys, base64, urllib.parse, urllib.request, urllib.error + +BASE = "https://api.intel471.com/v1" + + +def _cfg(): + return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}")) + + +def _inputs(): + return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}")) + + +def _auth(cfg): + raw = str(cfg.get("email", "")) + ":" + str(cfg.get("api_key", "")) + return "Basic " + base64.b64encode(raw.encode("utf-8")).decode("utf-8") + + +def request(path, cfg, params=None): + url = BASE + path + if params: + clean = {k: v for k, v in params.items() if v not in (None, "")} + if clean: + url += "?" + urllib.parse.urlencode(clean) + req = urllib.request.Request(url, headers={"Authorization": _auth(cfg), "Accept": "application/json"}, method="GET") + with urllib.request.urlopen(req, timeout=60) as r: + raw = r.read() + return json.loads(raw) if raw else {} + + +def _run(fn): + try: + print(json.dumps(fn(_cfg(), _inputs()))) + except urllib.error.HTTPError as e: + print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")})) + sys.exit(1) + except Exception as e: + print(json.dumps({"error": str(e)})) + sys.exit(1) + + +def main(cfg, inputs): + cve = inputs.get("cve") + count = inputs.get("count") + return request("/cve/reports", cfg, params={"cve": cve, "count": int(count or 25)}) + + +_run(main) diff --git a/integrations/intel471/scripts/search_indicators.py b/integrations/intel471/scripts/search_indicators.py new file mode 100644 index 0000000..d01a84f --- /dev/null +++ b/integrations/intel471/scripts/search_indicators.py @@ -0,0 +1,48 @@ +import json, os, sys, base64, urllib.parse, urllib.request, urllib.error + +BASE = "https://api.intel471.com/v1" + + +def _cfg(): + return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}")) + + +def _inputs(): + return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}")) + + +def _auth(cfg): + raw = str(cfg.get("email", "")) + ":" + str(cfg.get("api_key", "")) + return "Basic " + base64.b64encode(raw.encode("utf-8")).decode("utf-8") + + +def request(path, cfg, params=None): + url = BASE + path + if params: + clean = {k: v for k, v in params.items() if v not in (None, "")} + if clean: + url += "?" + urllib.parse.urlencode(clean) + req = urllib.request.Request(url, headers={"Authorization": _auth(cfg), "Accept": "application/json"}, method="GET") + with urllib.request.urlopen(req, timeout=60) as r: + raw = r.read() + return json.loads(raw) if raw else {} + + +def _run(fn): + try: + print(json.dumps(fn(_cfg(), _inputs()))) + except urllib.error.HTTPError as e: + print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")})) + sys.exit(1) + except Exception as e: + print(json.dumps({"error": str(e)})) + sys.exit(1) + + +def main(cfg, inputs): + indicator = inputs.get("indicator") + count = inputs.get("count") + return request("/indicators", cfg, params={"indicator": indicator, "count": int(count or 25)}) + + +_run(main) diff --git a/integrations/intel471/scripts/search_reports.py b/integrations/intel471/scripts/search_reports.py new file mode 100644 index 0000000..f1092da --- /dev/null +++ b/integrations/intel471/scripts/search_reports.py @@ -0,0 +1,48 @@ +import json, os, sys, base64, urllib.parse, urllib.request, urllib.error + +BASE = "https://api.intel471.com/v1" + + +def _cfg(): + return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}")) + + +def _inputs(): + return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}")) + + +def _auth(cfg): + raw = str(cfg.get("email", "")) + ":" + str(cfg.get("api_key", "")) + return "Basic " + base64.b64encode(raw.encode("utf-8")).decode("utf-8") + + +def request(path, cfg, params=None): + url = BASE + path + if params: + clean = {k: v for k, v in params.items() if v not in (None, "")} + if clean: + url += "?" + urllib.parse.urlencode(clean) + req = urllib.request.Request(url, headers={"Authorization": _auth(cfg), "Accept": "application/json"}, method="GET") + with urllib.request.urlopen(req, timeout=60) as r: + raw = r.read() + return json.loads(raw) if raw else {} + + +def _run(fn): + try: + print(json.dumps(fn(_cfg(), _inputs()))) + except urllib.error.HTTPError as e: + print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")})) + sys.exit(1) + except Exception as e: + print(json.dumps({"error": str(e)})) + sys.exit(1) + + +def main(cfg, inputs): + text = inputs.get("text") + count = inputs.get("count") + return request("/reports", cfg, params={"text": text, "count": int(count or 25)}) + + +_run(main) diff --git a/integrations/intel471/scripts/test_connection.py b/integrations/intel471/scripts/test_connection.py new file mode 100644 index 0000000..f9b1ff6 --- /dev/null +++ b/integrations/intel471/scripts/test_connection.py @@ -0,0 +1,47 @@ +import json, os, sys, base64, urllib.parse, urllib.request, urllib.error + +BASE = "https://api.intel471.com/v1" + + +def _cfg(): + return json.loads(os.environ.get("INTEGRATION_SECRETS", "{}")) + + +def _inputs(): + return json.loads(os.environ.get("INTEGRATION_INPUTS", "{}")) + + +def _auth(cfg): + raw = str(cfg.get("email", "")) + ":" + str(cfg.get("api_key", "")) + return "Basic " + base64.b64encode(raw.encode("utf-8")).decode("utf-8") + + +def request(path, cfg, params=None): + url = BASE + path + if params: + clean = {k: v for k, v in params.items() if v not in (None, "")} + if clean: + url += "?" + urllib.parse.urlencode(clean) + req = urllib.request.Request(url, headers={"Authorization": _auth(cfg), "Accept": "application/json"}, method="GET") + with urllib.request.urlopen(req, timeout=60) as r: + raw = r.read() + return json.loads(raw) if raw else {} + + +def _run(fn): + try: + print(json.dumps(fn(_cfg(), _inputs()))) + except urllib.error.HTTPError as e: + print(json.dumps({"error": "HTTP " + str(e.code), "detail": e.read().decode("utf-8", "replace")})) + sys.exit(1) + except Exception as e: + print(json.dumps({"error": str(e)})) + sys.exit(1) + + +def main(cfg, inputs): + request("/reports", cfg, params={"count": 1}) + return {"ok": True} + + +_run(main)