[attacks] Improve attack interceptor lifecycle management

Abierto
#212 1 comentario 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.

  • #227 de @Dorguy — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement
Problem or motivation

Attack stages currently wrap service methods and store callbacks that restore the previous implementation. This works for individual interceptors, but overlapping attacks on the same handler depend on their removal order. Stopping one attack before another can leave its interceptor active or restore it later.

Attack failure and success transitions also do not automatically remove installed interceptors. Introduce centralized interceptor management with independent removal and consistent cleanup on completion, failure, cancellation, and simulation shutdown. Define explicit lifecycle rules for stages whose effects continue after interceptor installation.

Proposed solution

I suggest moving interceptor installation and removal into a shared manager. It would keep the original handler and a list of active interceptors, so each attack can be stopped independently, regardless of the order in which attacks start or stop. Once the last interceptor is removed, the manager would restore the original handler.

We also need to distinguish between installing an interceptor and completing a stage. For spoofing, dropping, replay, and sniffing, installation starts the effect, which continues until the stage’s stop condition is met or the attack ends. If a stage has no stop condition of its own, I suggest allowing the next stage to start after installation while keeping the previous stage’s effect active.

All interceptors belonging to an attack should be removed when it completes, fails, or is cancelled, and when the simulation shuts down. Cleanup should also handle cases where some interceptors have already been removed before an error occurs. Repeating cleanup should be safe, and a failure in one stage should not prevent the remaining stages from being cleaned up.

I’ll add tests for overlapping attacks stopped in different orders, restoration of the original handler, installation failures, attack restarts, and cleanup during simulation shutdown.

Area

Automotive cybersecurity

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.