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) <noreply@anthropic.com>
This commit is contained in:
@@ -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: {} }
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user