[attacks] Improve attack interceptor lifecycle management
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 11
- Fork
- 11
- Merge medio
- 1g 16h
- PR unite (30g)
- 12
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CAVISE/OpenCDA
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 47/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di CAVISE/OpenCDA
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
-
frontend testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
vendrabuck/HERD#1588 ·
I maintainer di solito rispondono entro 1 giorno
-
Lessons: record the second case of L14 (security updates cover only pip)Forse già presa @vishwanathj l’ha presa oggi. Apertaarea/docs no-test-needed type/docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vishwanathj/ocp_lab.ai#39 · 1 commento ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
laaielichter/Gulliver#228 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
nyjc-computing/campus#1338 ·
I maintainer di solito rispondono entro 1 giorno