mirror of
https://github.com/reconurge/flowsint.git
synced 2026-06-10 00:30:17 -05:00
[PR #154] feat(enrichers): add ip_to_security_risk — Shodan-backed weighted risk scoring for IP nodes #2624
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/reconurge/flowsint/pull/154
Author: @adityaa206
Created: 6/2/2026
Status: 🔄 Open
Base:
main← Head:feat/ip-security-risk-enricher📝 Commits (3)
21e7c31feat(enrichers): add ip_to_security_risk enricher via Shodan4712bactest(enrichers): add comprehensive test suite for ip_to_security_risk5e28915fix(enrichers): replace CVSS floor hack with real NVD API v2 lookup📊 Changes
3 files changed (+1702 additions, -0 deletions)
View changed files
📝
flowsint-enrichers/pyproject.toml(+1 -0)➕
flowsint-enrichers/src/flowsint_enrichers/ip/to_security_risk.py(+627 -0)➕
flowsint-enrichers/tests/enrichers/test_ip_to_security_risk.py(+1074 -0)📄 Description
Summary
ip_to_security_riskenricher underflowsint-enrichers/src/flowsint_enrichers/ip/to_security_risk.pyIpnode → queries Shodan → emits aRiskProfilenode +Portnodes, all linked in the graphshodan>=1.31,<2.0toflowsint-enrichersdependenciesWhat problem does this solve?
Flowsint already excels at mapping entity relationships (domains, IPs, social accounts, etc.), but it has no native way to score the security danger of an IP node. An investigator looking at an IP in the graph has no immediate signal of how risky it is.
This enricher fills that gap: it enriches an IP with a 0–100 risk score, a critical / high / medium / low classification, CVE IDs, exposure-surface summary, compliance risk flags, and mitigation recommendations — all surfaced as a
RiskProfilenode linked directly to the IP.Scoring model
Adapted from RedFlag, an open-source M&A cybersecurity due-diligence tool, the formula combines four weighted factors:
Risk level bands: critical ≥ 75 · high ≥ 50 · medium ≥ 25 · low < 25
Graph output
The
RiskProfilenode carries:overall_risk_score(0–100),risk_level,assessment_datevulnerabilities(CVE IDs),risk_factors,attack_vectorsexposure_surface(org, ASN, hostnames, open ports)compliance_risks(PCI-DSS / GDPR / ISO 27001 flags)mitigation_strategies,confidence,source = "Shodan"Required vault secret
SHODAN_API_KEYapi.host()callTest plan
SHODAN_API_KEYto Flowsint vaultIpnode in the investigation graphip_to_security_riskon itRiskProfilenode appears linked viaHAS_RISK_PROFILEPortnodes appear linked viaHAS_PORTFiles changed
flowsint-enrichers/src/flowsint_enrichers/ip/to_security_risk.pyflowsint-enrichers/pyproject.tomlshodan>=1.31,<2.0dependency🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.