[attack] Extend attack configuration validation before simulation startup

Aperta
#214 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@xxxdvt ci sta già lavorando.

Dal 11/11/2026.

  • #228 di @xxxdvt — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement
Problem or motivation

Attack configuration validation currently covers condition structure, duplicate stage IDs, registered stage types, supported capabilities, and selected stage parameters. Compatibility with actual target services is checked during execution, while missing message paths in spoofing rules are silently skipped.

Extend validation to check service compatibility, stage references, and known message fields before the simulation starts. Report configuration errors with their exact locations and warn about clearly inconsistent trigger conditions. Fields that depend on runtime data should have explicit runtime diagnostics instead of silently producing no effect.

Proposed solution
  • Add validation.py to validate attack definitions against the scenario’s merged participant configurations. Check that target services are configured and provide the required capabilities. Recursively walk attack and stage conditions to validate stage references and warn about simple trigger inconsistencies.
  • Add class-level message-type metadata alongside service capability definitions. Use existing message dataclasses to validate envelope and nested payload paths without creating service instances. Leave optional values and sequence lengths to runtime checks.
  • Refactor attack loading in scenario.py so configuration parsing and validation happen before participant creation and simulation ticks. Keep runtime target resolution and compatibility checks.
  • Pass the configuration filename and full field path through parsing and validation, including existing checks in attack_spec.py, stage_registry.py, and stage parameter parsing.
  • Update SpooferStage path resolution to distinguish missing attributes, unavailable optional values, and invalid indices. Report failures with attack, stage, rule, and path context instead of silently skipping them.
  • Add tests for early validation, precise error locations, trigger warnings, and runtime path diagnostics, while preserving existing valid configurations and interception behavior.
Area

Simulation

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CAVISE/OpenCDA

Tutte le issue di CAVISE/OpenCDA

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.