abhinav-mittal33/bling-blue-team
GitHub: abhinav-mittal33/bling-blue-team
一个用于银行交易后取证欺诈检测的混合流水线系统,结合规则、图谱和机器学习来识别可疑资金流向并生成证据。
Stars: 0 | Forks: 0
# 🔵 BLING 蓝队
### 取证欺诈检测引擎 — 印度联合银行
[](https://python.org)
[](https://fastapi.tiangolo.com)
[](https://xgboost.readthedocs.io)
[](https://postgresql.org)
[](https://redis.io)
[](tests/)
## 这是什么
交易后取证欺诈检测引擎。资金已经转移。此系统对每一笔已结算的交易进行评分,在发现可疑情况时重建资金流向,并将带有 SHAP 解释的证据包连同 STR 报告草稿提交给人类调查人员。
## 架构
### 三级检测流水线
```
flowchart TD
A[Graph Engine\nPOST /api/v1/score] --> B{Tier 1\nFast Rules\n5ms}
B -->|78pct FAST_CLEAN| C[PASS\nscore=0.05]
B -->|22pct UNCERTAIN\nor SUSPICIOUS| D{Tier 2\nHard Graph Gates\n15ms}
D -->|Gate fires| E[REVIEW\nscore=1.0]
D -->|UNCERTAIN clear| F[LOG\nscore=0.10]
D -->|SUSPICIOUS clear| G{Tier 3\nXGBoost\n30ms}
G --> H[Indian Context\nAdjustment]
H --> I{Threshold}
I -->|lt 0.30| J[PASS]
I -->|0.30-0.49| K[LOG]
I -->|0.50-0.74| L[REVIEW]
I -->|ge 0.75| M[HIGH_RISK]
L --> N[Alert Created\nCelery: Fund Trail]
M --> N
E --> N
N --> O[GET /alerts/id\nEvidence Package]
O --> P[Investigator\nPOST /feedback]
P -->|Confirmed fraud| Q[Blockchain + Red Team]
P -->|False positive| R[River FTRL\nOnline Update]
style A fill:#1a73e8,color:#fff
style M fill:#d93025,color:#fff
style N fill:#e8710a,color:#fff
style C fill:#1e8e3e,color:#fff
```
### 静态新颖性传感器(隔离森林)
```
flowchart LR
A[Every transaction\nafter scoring] --> B{Isolation Forest\n17 structural features}
B -->|score ge -0.20\nnormal| C[No action]
B -->|score lt -0.20\nanomalous| D[novelty_queue\nDev review]
D --> E{Fingerprint\n10+ times\nin 7 days?}
E -->|Yes| F[Red Team\nEscalation]
E -->|No| G[Batch triage]
style D fill:#e8710a,color:#fff
style F fill:#d93025,color:#fff
```
## 5 个硬性图谱门控(第二级)
门控触发时 `score=1.0` 或直接放行。没有部分分数。基于印度储备银行 FATF 层叠检测指南。
| 门控 | 检测目标 | 关键信号 |
|------|---------|-----------|
| **循环** | 循环资金流向 A→B→C→A(2-8 跳) | `cycle_membership` — 每晚批处理 |
| **汇集** | 资金积累无合法流出 | `sink_score = retention × inflow_concentration` |
| **二分图** | 7+ 发送方 → 1 收集方(密度 >0.7) | `bipartite_score` |
| **现金骤子汇集** | 收款 → ATM 提现 → 数字静默 | 仅 PostgreSQL — 无需设备 ID |
| **商户终端** | 通过 POS 终端进行的往返交易 | `merchant_terminal_id` 关联 |
门控触发后,**会按顺序运行 5 个合法性过滤器** — 内部/资金部 → KYC 关系 → 薪资预付 → 所有商户 → 金额 <70%。如果都无法解释:复审,记录门控名称。绝不静默处理。
## XGBoost 集成模型(第三级)
**310,000 个训练样本** — 100K 合成印度原型 + 200K BAF NeurIPS 2022 + 10K 银行风险数据集
| 指标 | 值 |
|--------|-------|
| AUCPR | 0.69 |
| 欺诈平均分 | 0.787 |
| 正常平均分 | 0.160 |
| `scale_pos_weight` | ~49× (类别比) |
共 59 个特征:35 个图特征(每晚预计算并存入 Redis) + 24 个实时表格特征。
完整 59 特征列表
**图结构 — Redis,每晚更新(35 个特征)** | 特征 | 测量内容 | |---------|---------| | `pagerank_fraud_seeded` | 与已确认欺诈节点的接近度 | | `betweenness_centrality` | 社区间的桥梁? | | `clustering_coefficient` | 邻域连通性 | | `degree_centrality` | 相对于图规模的连接数 | | `community_id` | Louvain 社区 | | `community_fraud_ratio` | 社区中标记为欺诈的百分比 | | `shortest_path_to_fraud` | 到欺诈节点的最小跳数 | | `cycle_membership` | 属于检测到的循环的一部分? | | `sink_score` | 资金流入 vs 流出 | | `bipartite_score` | 多对一扇入密度 | | `fan_out_ratio` | 出度 / 入度 | | `temporal_acceleration` | 交易频率趋势 | | `cash_mule_sink_score` | 收款 + 提现 + 休眠复合得分 | | `bridge_node_probability` | 桥接干净和脏钱? | | `dormancy_reactivation_flag` | 休眠后突然活跃 | | `account_age_days` | 开户天数 | | `kyc_completeness_score` | KYC 文件完整度 0-1 | | `txn_count_30d / 90d / all` | 按窗口计数 | | `avg_txn_amount_30d` | 最近 30 天平均金额 | | `distinct_counterparties_30d` | 最近 30 天唯一收款方 | | `channel_entropy` | 支付渠道多样性 | | `night_txn_ratio` | 晚 10 点至早 5 点的交易比例 | | `weekend_txn_ratio` | 周末交易比例 | | `return_ratio` | 收到后立即转出的比例 | | `amount_zscore` | 与历史记录的偏差 | | `counterparty_novelty` | 新收款方比例 | | `hour_deviation` | 与典型交易小时的偏差 | | `channel_switch` | 该账户的不寻常渠道 | | `amount_series_score` | 低于阈值的结构化信号 | | `burst_score` | 相对于基线的速度峰值 | | `velocity_ratio` | 当前速率 / 历史平均 | | `dormancy_break` | 距上次活动的天数 | | `geography_switch` | 新位置 vs 历史 | **实时表格 — 在评分时计算(24 个特征)** `txn_amount` · `txn_amount_log` · `txn_amount_rounded` · `channel_upi/imps/rtgs/neft` · `hour_of_day` · `day_of_week` · `is_weekend` · `is_night` · `is_festival_period` · `amount_vs_threshold_50000/100000/1000000` · `payee_vpa_age_days` · `txn_count_last_1h/24h/7d` · `txn_volume_last_1h/24h` · `distinct_payees_24h` · `payee_in_alert_log` · `payee_shared_alert_count`
BLING 黑客松 · 蓝队 · 印度联合银行
结合图谱智能的交易后取证欺诈检测
结合图谱智能的交易后取证欺诈检测
标签:Apex, AV绕过, Celery任务队列, FastAPI, Isolation Forest, PostgreSQL, Python, Redis, River FTRL, SHAP可解释性, STR报告, XGBoost, 三层管道, 交易后分析, 人工智能, 区块链, 图门控, 在线学习, 异常检测, 快速规则, 搜索引擎查询, 无后门, 机器学习, 欺诈检测, 法证分析, 测试用例, 用户模式Hook绕过, 证据管理, 请求拦截, 资金追踪, 逆向工具, 金融安全, 金融犯罪, 银行业务, 风险评分