feat: 二阶段

This commit is contained in:
2026-07-15 17:38:02 +08:00
parent d884aa36ff
commit bb406cd354
28 changed files with 1076 additions and 79 deletions

View File

@@ -43,9 +43,9 @@ include_modules:
`redisCheck` 仓库维护,随 jar 发布,默认包含:
- `detection.patterns`**W01~W05**JSON 字符串写入 + Template 直写 + Hash
- `detection.mq_patterns`**MQ01/MQ02、MQ-K01/MQ-K02**RocketMQ / Kafka 生产侧)
- `detection.mq_patterns`**MQ01~MQ05、MQ-K01~MQ-K04**RocketMQ / Kafka 生产侧)
- `detection.read_hints_enabled`W06 读侧反序列化类型辅助(默认 true
- `detection.mq_read_hints_enabled`MQ 读侧补强Phase M2默认 false
- `detection.mq_read_hints_enabled`MQ-R 读侧 Listener / parse 补强(默认 true
- `ignore.key_patterns`(锁 / 计数器 / token
- `ignore.mq_destinations`MQ destination 忽略,默认真空)
- `detection.min_confidence``max_field_depth`
@@ -113,18 +113,23 @@ detection:
- W04 # redisTemplate 直写对象
- W05 # opsForHash().put
# MQ 生产侧投递Phase M1
# MQ 生产侧投递Phase M1 + M2
mq_patterns:
- MQ01 # rocketMQTemplate.syncSend
- MQ02 # asyncSend / syncSendOrderly / sendOneWay
- MQ03 # convertAndSend
- MQ04 # MessageBuilder.withPayload / Message<T>
- MQ05 # 先 toJSONString 再 send String
- MQ-K01 # kafkaTemplate.send(topic, payload)
- MQ-K02 # kafkaTemplate.send(topic, key, payload)
- MQ-K03 # kafkaTemplate.send(ProducerRecord)
- MQ-K04 # 先 JSON 序列化为 String 再 send
# W06读侧反序列化类型辅助不产生独立告警
read_hints_enabled: true
# MQ-R 读侧补强(Phase M2默认关闭
mq_read_hints_enabled: false
# MQ-R 读侧补强(Listener / parseObject
mq_read_hints_enabled: true
# 类型推断最低置信度,低于此值标记为低置信度提示
min_confidence: 0.6
@@ -240,7 +245,7 @@ detection:
- **不是写入模式**:不会单独因为「多了一处 parse」而告警
- 能关联到 `redis get(key)` 时,还可补强 unresolved key
- 覆盖优先级:`manual_mappings` > W06 > 写侧 AST
- **仅补强 Redis 写入点**MQ 投递点W06MQ-R 为 Phase M2
- **仅补强 Redis 写入点**MQ 投递点走 `mq_read_hints_enabled`MQ-R
关闭示例:
@@ -249,12 +254,12 @@ detection:
read_hints_enabled: false
```
### 3.5.2 detection.mq_patterns / ignore.mq_destinationsMQ Phase M1
### 3.5.2 detection.mq_patterns / ignore.mq_destinationsMQ
| 配置项 | 说明 |
|--------|------|
| `mq_patterns` | `MQ01`/`MQ02`RocketMQ`MQ-K01`/`MQ-K02`Kafka;默认已开启 |
| `mq_read_hints_enabled` | MQ-R 读侧补强,**默认 false** |
| `mq_patterns` | RocketMQ`MQ01`~`MQ05`Kafka`MQ-K01`~`MQ-K04`;默认已全部开启 |
| `mq_read_hints_enabled` | MQ-R 读侧补强Listener / parse**默认 true** |
| `ignore.mq_destinations` | 忽略 destinationglob`benchmark:*` |
企微 MQ 块:`- Topic --> ...`,并带 `> **通道**: RocketMQ|Kafka`
@@ -375,10 +380,10 @@ include_modules: [] # 全仓
---
## 7. MQ 消息体检测Phase M1 已落地)
## 7. MQ 消息体检测Phase M1 + M2 已落地)
同一 jar 默认启用 RocketMQ / Kafka **生产侧**投递检测(`detection.mq_patterns`),与 Redis 共用 Diff、骨架与企微模板。
同一 jar 默认启用 RocketMQ / Kafka **生产侧**投递检测(`detection.mq_patterns`与 **MQ-R** 读侧补强,与 Redis 共用 Diff、骨架与企微模板。
- 配置说明见 §3.5.2
- 读侧 MQ-R、`MessageBuilder` / `ProducerRecord` 等见方案 Phase M2
- `MessageBuilder` / `convertAndSend` / `ProducerRecord` / JSON 字符串发送、Listener/`parseObject` 补强
- 完整设计:[MQ序列化结构检测方案.md](./MQ序列化结构检测方案.md)