Install
openclaw skills install @thcjp/data-flow-monitor-manageropenclaw skills install @thcjp/data-flow-monitor-manager跨租户数据流监控管理器。基于v8.0多租户任务编排方案§五SEC-2,实现跨租户数据流监控、数据流图构建、异常流告警、三级阈值(频率/数据量/敏感度)、Prometheus 4项安全指标导出、每日数据泄露扫描。
初始化(健康检查)
mcp__data-flow-monitor-mcp__healthcheck数据流事件记录(生产链路)
mcp__data-flow-monitor-mcp__record_data_flow(source_tenant, target_tenant, data_type, volume, flow_type, metadata)数据流图查询
mcp__data-flow-monitor-mcp__get_data_flow_graph(tenant_id, hours, min_severity)异常数据流检测
mcp__data-flow-monitor-mcp__detect_anomaly_flow(hours, tenant_id)Prometheus安全指标获取
mcp__data-flow-monitor-mcp__get_security_metrics(hours)每日泄露扫描(Cron触发)
mcp__data-flow-monitor-mcp__run_leakage_scan(days, tenant_id)泄露告警历史查询
mcp__data-flow-monitor-mcp__get_leakage_alerts(tenant_id, alert_type, severity, status, limit)三级阈值动态调整
mcp__data-flow-monitor-mcp__set_flow_threshold(threshold_type, level, value, data_types)| 工具 | 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| record_data_flow | source_tenant | str | 是 | 源租户ID |
| record_data_flow | target_tenant | str | 是 | 目标租户ID |
| record_data_flow | data_type | str | 否 | 数据类型(默认normal) |
| record_data_flow | volume | int | 否 | 数据量字节(默认0) |
| record_data_flow | flow_type | str | 否 | 流类型query/export/api_call/db_query |
| record_data_flow | metadata | str | 否 | JSON字符串元数据 |
| get_data_flow_graph | tenant_id | str | 否 | 过滤特定租户 |
| get_data_flow_graph | hours | int | 否 | 时间窗口,默认24 |
| get_data_flow_graph | min_severity | str | 否 | 最低severity,默认L1 |
| detect_anomaly_flow | hours | int | 否 | 检测窗口,默认1 |
| detect_anomaly_flow | tenant_id | str | 否 | 过滤特定租户 |
| get_security_metrics | hours | int | 否 | 时间窗口,默认24 |
| run_leakage_scan | days | int | 否 | 扫描天数,默认1 |
| run_leakage_scan | tenant_id | str | 否 | 过滤特定租户 |
| get_leakage_alerts | tenant_id | str | 否 | 按租户过滤 |
| get_leakage_alerts | alert_type | str | 否 | 按类型过滤 |
| get_leakage_alerts | severity | str | 否 | L1/L2/L3 |
| get_leakage_alerts | status | str | 否 | open/resolved/false_positive |
| get_leakage_alerts | limit | int | 否 | 默认100,最大1000 |
| set_flow_threshold | threshold_type | str | 是 | frequency/volume/sensitivity |
| set_flow_threshold | level | str | 是 | L1/L2/L3 |
| set_flow_threshold | value | int | 是 | 阈值(frequency=次/小时,volume=字节) |
| set_flow_threshold | data_types | str | 否 | sensitivity时逗号分隔类型 |
所有工具统一返回:
{
"success": true,
"data": { ... },
"error": null,
"code": "FLOW_RECORDED"
}
错误时:
{
"success": false,
"data": {},
"error": "错误描述",
"code": "ERROR_CODE"
}
mcp__data-flow-monitor-mcp__record_data_flow(
source_tenant="tenant_001",
target_tenant="tenant_002",
data_type="pii",
volume=5242880,
flow_type="api_call",
metadata='{"endpoint":"/api/export"}'
)
输出:
{
"success": true,
"data": {
"event_id": 101,
"source_tenant": "tenant_001",
"target_tenant": "tenant_002",
"data_type": "pii",
"volume": 5242880,
"flow_type": "api_call",
"severity": "L2",
"blocked": false,
"cross_tenant": true,
"alert_id": 55,
"timestamp": "2026-07-07 10:30:00+08:00"
},
"error": null,
"code": "FLOW_RECORDED"
}
mcp__data-flow-monitor-mcp__get_data_flow_graph(tenant_id="", hours=24, min_severity="L2")
输出:
{
"success": true,
"data": {
"nodes": [{"id": "tenant_001", "label": "tenant_001"}, {"id": "tenant_002", "label": "tenant_002"}],
"edges": [{"source": "tenant_001", "target": "tenant_002", "data_type": "pii", "severity": "L2", "event_count": 5, "total_volume": 26214400, "blocked": false}],
"node_count": 2,
"edge_count": 1,
"hours": 24,
"min_severity": "L2"
},
"error": null,
"code": "GRAPH_OK"
}
mcp__data-flow-monitor-mcp__get_security_metrics(hours=24)
输出:
{
"success": true,
"data": {
"metrics": [
{"name": "cross_tenant_access_total", "type": "counter", "value": 42, "description": "跨租户数据访问总次数"},
{"name": "data_export_bytes", "type": "counter", "value": 5368709120, "description": "数据导出字节数"},
{"name": "anomaly_flow_alerts", "type": "counter", "value": 8, "description": "异常数据流告警数"},
{"name": "leakage_events", "type": "gauge", "value": 2, "description": "数据泄露事件数(severity=L3)"}
],
"hours": 24
},
"error": null,
"code": "METRICS_OK"
}
| 版本 | 日期 | 变更 |
|---|---|---|
| v1.0 | 2026-07-07 | 初始版本,实现8个MCP工具+SEC-2 跨租户数据流监控+泄露每日扫描 |