[attacks] Add message filtering to attack stages

未关闭
#216 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@Dorguy 已经在做这个了。

开始于 2026年11月11日。

评估

这个 Issue 还没有评估数据。

描述

enhancement
Problem or motivation

Attack targets currently select service instances using simulation state. Once an interceptor is installed, spoofing rules apply to matching message structures, while dropping affects the entire output or randomly selected batch elements.

There is no shared mechanism for selecting individual messages by sender, recipient, payload type, or payload field values. This limits experiments that should affect a specific vehicle or message category while preserving other traffic handled by the same service.

Introduce reusable message filters for spoofing, dropping, replay, and future stages. Messages that do not match a filter should pass through unchanged.

Proposed solution

Add an optional message_filter to the stage configuration. The existing target selector chooses service instances, and the filter determines which messages handled by those services the stage applies to.

Support matching by sender ID, recipient ID, payload type, and exact payload field values. A message matches only if all configured conditions are met. If a field referenced by a condition is missing, the message does not match. Validate the filter configuration when loading the scenario.

Evaluate the filter at the input to each stage for every message, including each element of a batch. Messages that do not match pass through unchanged and can still be processed by subsequent stages. Preserve the relative order of messages that remain in the batch.

Use the same filtering logic for spoofing, dropping, replay, and future stages. When message_filter is omitted, the stage retains its current behavior.

Add tests for batches containing both matching and non-matching messages, missing fields, multiple conditions, and scenarios without a filter. Document an example that selects messages of a given type from one simulated vehicle.

Area

Simulation

Alternatives considered

No response

Additional context

No response

主要语言
Python
星标
11
派生
11
平均合并
1 天 16 小时
30 天内合并 PR
12

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CAVISE/OpenCDA 的其他 Issue

查看 CAVISE/OpenCDA 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。