[attacks] Improve attack interceptor lifecycle management

オープン
#212 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Dorguy がすでに取り組んでいます。

2026年11月11日 から。

  • #227 @Dorguy による — オープン

評価

この issue はまだ評価されていません。

説明

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

主要言語
Python
スター
11
フォーク
11
平均マージ
1日 16時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CAVISE/OpenCDA のほかの issue

CAVISE/OpenCDA の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。