[attacks] Improve attack interceptor lifecycle management
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 11
- Fork
- 11
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CAVISE/OpenCDA
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 47/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CAVISE/OpenCDA
Issue tương tự
-
documentation good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
documentation good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
documentation good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
[Suggestion]: AgentermĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
collabnix/awesome-mcp-lists#490 ·
Maintainer thường phản hồi trong vòng 2 ngày