Maximuz23 commited on
Commit
5dbd595
·
verified ·
1 Parent(s): 1c93903
Files changed (1) hide show
  1. app.py +11 -26
app.py CHANGED
@@ -348,33 +348,18 @@ def enrich_ioc(ioc, ioc_type):
348
  if not bits:
349
  bits.append("No current threat-intelligence records for this indicator across ThreatFox, OTX, or VirusTotal.")
350
  label = {"ip": "IP Addresses", "domain": "Domains", "url": "URLs", "file": "File Hashes"}.get(ioc_type, "Indicators")
351
- # grounded remediation derived from the ThreatFox threat type (avoids the model improvising one)
352
- ttypes = " ".join((tf or {}).get("threat_types", [])).lower()
353
- if not (tf or (vt and vt.get("malicious"))):
354
- action = ""
355
- elif any(k in ttypes for k in ("c&c", "command", "botnet")):
356
- action = "Block and sinkhole this command-and-control indicator at the perimeter; hunt logs for hosts beaconing to it."
357
- elif any(k in ttypes for k in ("payload", "distribution", "download")):
358
- action = "Block this distribution host and scan endpoints for payloads retrieved from it."
359
- else:
360
- action = "Block the indicator at the perimeter and hunt for related connections across DNS, proxy, and firewall logs."
361
- lines = [
362
- "[Threat Report]",
363
- f"Title: Live IOC enrichment — {ioc}",
364
- "",
365
- " ".join(bits),
366
- "",
367
- f"Reported indicators:\n {label}: {ioc}",
368
- f"Analyst-tagged ATT&CK: {', '.join(otx.get('attack', [])) or 'none tagged'}",
369
- f"Malware families: {', '.join(families) or 'none named'}",
370
- f"Attributed actor: {otx.get('adversary') or 'none specified'}",
371
- f"Targeted industries: {', '.join(otx.get('industries', [])) or 'not specified'}",
372
- f"Targeted countries: {', '.join(otx.get('countries', [])) or 'not specified'}",
373
- ]
374
- if action:
375
- lines.append(f"Recommended action: {action}")
376
  return ("Analyze this threat intelligence report. Produce a structured red-team summary using only "
377
- "what the report states. Do not invent actors, malware, or indicators.\n\n" + "\n".join(lines))
 
 
 
 
 
 
 
 
 
378
 
379
 
380
  def recent_threatfox_ioc():
 
348
  if not bits:
349
  bits.append("No current threat-intelligence records for this indicator across ThreatFox, OTX, or VirusTotal.")
350
  label = {"ip": "IP Addresses", "domain": "Domains", "url": "URLs", "file": "File Hashes"}.get(ioc_type, "Indicators")
351
+ # Only live feed data goes in the report no canned recommendation (the model writes the analysis).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  return ("Analyze this threat intelligence report. Produce a structured red-team summary using only "
353
+ "what the report states. Do not invent actors, malware, or indicators.\n\n"
354
+ "[Threat Report]\n"
355
+ f"Title: Live IOC enrichment — {ioc}\n\n"
356
+ f"{' '.join(bits)}\n\n"
357
+ f"Reported indicators:\n {label}: {ioc}\n"
358
+ f"Analyst-tagged ATT&CK: {', '.join(otx.get('attack', [])) or 'none tagged'}\n"
359
+ f"Malware families: {', '.join(families) or 'none named'}\n"
360
+ f"Attributed actor: {otx.get('adversary') or 'none specified'}\n"
361
+ f"Targeted industries: {', '.join(otx.get('industries', [])) or 'not specified'}\n"
362
+ f"Targeted countries: {', '.join(otx.get('countries', [])) or 'not specified'}")
363
 
364
 
365
  def recent_threatfox_ioc():