[attacks] Add message filtering to attack stages

Abierto
#216 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Dorguy ya está trabajando en esto.

Desde el 11/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

Lenguaje dominante
Python
Estrellas
11
Forks
11
Merge medio
1 d 16 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CAVISE/OpenCDA

Todos los issues de CAVISE/OpenCDA

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.