All oversized iace files now comply with the 500-line hard cap: - hazard_library_ai_sw.go split into ai_sw (false_classification..communication) and ai_fw (unauthorized_access..update_failure) - hazard_library_software_hmi.go split into software_hmi (software_fault+hmi) and config_integration (configuration_error+logging+integration) - hazard_library_machine_safety.go split to keep mechanical/electrical/thermal/emc, safety_functions extracted into hazard_library_safety_functions.go - store_hazards.go split: hazard library queries moved to store_hazard_library.go - store_projects.go split: component and classification ops to store_components.go - store_mitigations.go split: evidence/verification/ref-data to store_evidence.go - hazard_library.go GetBuiltinHazardLibrary() updated to call all sub-functions - All iace tests pass (go test ./internal/iace/...) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
289 lines
15 KiB
Go
289 lines
15 KiB
Go
package iace
|
|
|
|
import "time"
|
|
|
|
// builtinHazardsAISW returns hazard library entries for AI/software categories:
|
|
// false_classification, timing_error, data_poisoning, model_drift,
|
|
// sensor_spoofing, communication_failure.
|
|
func builtinHazardsAISW() []HazardLibraryEntry {
|
|
now := time.Now()
|
|
|
|
return []HazardLibraryEntry{
|
|
// ====================================================================
|
|
// Category: false_classification (4 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("false_classification", 1),
|
|
Category: "false_classification",
|
|
Name: "Falsche Bauteil-Klassifikation durch KI",
|
|
Description: "Das KI-Modell klassifiziert ein Bauteil fehlerhaft, was zu falscher Weiterverarbeitung oder Montage fuehren kann.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"ai_model", "sensor"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Redundante Pruefung", "Konfidenz-Schwellwert"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("false_classification", 2),
|
|
Category: "false_classification",
|
|
Name: "Falsche Qualitaetsentscheidung (IO/NIO)",
|
|
Description: "Fehlerhafte IO/NIO-Entscheidung durch das KI-System fuehrt dazu, dass defekte Teile als gut bewertet oder gute Teile verworfen werden.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"ai_model", "software"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Human-in-the-Loop", "Stichproben-Gegenpruefung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("false_classification", 3),
|
|
Category: "false_classification",
|
|
Name: "Fehlklassifikation bei Grenzwertfaellen",
|
|
Description: "Bauteile nahe an Toleranzgrenzen werden systematisch falsch klassifiziert, da das Modell in Grenzwertbereichen unsicher agiert.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"ai_model"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Erweitertes Training", "Grauzone-Eskalation"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("false_classification", 4),
|
|
Category: "false_classification",
|
|
Name: "Verwechslung von Bauteiltypen",
|
|
Description: "Unterschiedliche Bauteiltypen werden vom KI-Modell verwechselt, was zu falscher Montage oder Verarbeitung fuehrt.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"ai_model", "sensor"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Barcode-Gegenpruefung", "Doppelte Sensorik"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: timing_error (3 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("timing_error", 1),
|
|
Category: "timing_error",
|
|
Name: "Verzoegerte KI-Reaktion in Echtzeitsystem",
|
|
Description: "Die KI-Inferenz dauert laenger als die zulaessige Echtzeitfrist, was zu verspaeteten Sicherheitsreaktionen fuehrt.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "ai_model"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "ISO 13849", "IEC 62443"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Watchdog-Timer", "Fallback-Steuerung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("timing_error", 2),
|
|
Category: "timing_error",
|
|
Name: "Echtzeit-Verletzung Safety-Loop",
|
|
Description: "Der sicherheitsgerichtete Regelkreis kann die geforderten Zykluszeiten nicht einhalten, wodurch Sicherheitsfunktionen versagen koennen.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "firmware"},
|
|
RegulationReferences: []string{"ISO 13849", "IEC 61508", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Deterministische Ausfuehrung", "WCET-Analyse"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("timing_error", 3),
|
|
Category: "timing_error",
|
|
Name: "Timing-Jitter bei Netzwerkkommunikation",
|
|
Description: "Schwankende Netzwerklatenzen fuehren zu unvorhersehbaren Verzoegerungen in der Datenuebertragung sicherheitsrelevanter Signale.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"network", "software"},
|
|
RegulationReferences: []string{"IEC 62443", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"TSN-Netzwerk", "Pufferung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: data_poisoning (2 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("data_poisoning", 1),
|
|
Category: "data_poisoning",
|
|
Name: "Manipulierte Trainingsdaten",
|
|
Description: "Trainingsdaten werden absichtlich oder unbeabsichtigt manipuliert, wodurch das Modell systematisch fehlerhafte Entscheidungen trifft.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"ai_model"},
|
|
RegulationReferences: []string{"EU AI Act Art. 10", "CRA"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Daten-Validierung", "Anomalie-Erkennung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("data_poisoning", 2),
|
|
Category: "data_poisoning",
|
|
Name: "Adversarial Input Angriff",
|
|
Description: "Gezielte Manipulation von Eingabedaten (z.B. Bilder, Sensorsignale), um das KI-Modell zu taeuschen und Fehlentscheidungen auszuloesen.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"ai_model", "sensor"},
|
|
RegulationReferences: []string{"EU AI Act Art. 15", "CRA", "IEC 62443"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Input-Validation", "Adversarial Training"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: model_drift (3 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("model_drift", 1),
|
|
Category: "model_drift",
|
|
Name: "Performance-Degradation durch Concept Drift",
|
|
Description: "Die statistische Verteilung der Eingabedaten aendert sich ueber die Zeit, wodurch die Modellgenauigkeit schleichend abnimmt.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"ai_model"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "EU AI Act Art. 72"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Monitoring-Dashboard", "Automatisches Retraining"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("model_drift", 2),
|
|
Category: "model_drift",
|
|
Name: "Data Drift durch veraenderte Umgebung",
|
|
Description: "Aenderungen in der physischen Umgebung (Beleuchtung, Temperatur, Material) fuehren zu veraenderten Sensordaten und Modellfehlern.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"ai_model", "sensor"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Statistische Ueberwachung", "Sensor-Kalibrierung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("model_drift", 3),
|
|
Category: "model_drift",
|
|
Name: "Schleichende Modell-Verschlechterung",
|
|
Description: "Ohne aktives Monitoring verschlechtert sich die Modellqualitaet ueber Wochen oder Monate unbemerkt.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"ai_model"},
|
|
RegulationReferences: []string{"EU AI Act Art. 9", "EU AI Act Art. 72"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Regelmaessige Evaluierung", "A/B-Testing"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: sensor_spoofing (3 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("sensor_spoofing", 1),
|
|
Category: "sensor_spoofing",
|
|
Name: "Kamera-Manipulation / Abdeckung",
|
|
Description: "Kamerasensoren werden absichtlich oder unbeabsichtigt abgedeckt oder manipuliert, sodass das System auf Basis falscher Bilddaten agiert.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"sensor"},
|
|
RegulationReferences: []string{"IEC 62443", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Plausibilitaetspruefung", "Mehrfach-Sensorik"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("sensor_spoofing", 2),
|
|
Category: "sensor_spoofing",
|
|
Name: "Sensor-Signal-Injection",
|
|
Description: "Einspeisung gefaelschter Signale in die Sensorleitungen oder Schnittstellen, um das System gezielt zu manipulieren.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 1,
|
|
ApplicableComponentTypes: []string{"sensor", "network"},
|
|
RegulationReferences: []string{"IEC 62443", "CRA"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Signalverschluesselung", "Anomalie-Erkennung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("sensor_spoofing", 3),
|
|
Category: "sensor_spoofing",
|
|
Name: "Umgebungsbasierte Sensor-Taeuschung",
|
|
Description: "Natuerliche oder kuenstliche Umgebungsveraenderungen (Licht, Staub, Vibration) fuehren zu fehlerhaften Sensorwerten.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"sensor"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Sensor-Fusion", "Redundanz"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: communication_failure (3 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("communication_failure", 1),
|
|
Category: "communication_failure",
|
|
Name: "Feldbus-Ausfall",
|
|
Description: "Ausfall des industriellen Feldbusses (z.B. PROFINET, EtherCAT) fuehrt zum Verlust der Kommunikation zwischen Steuerung und Aktorik.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"network", "controller"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "ISO 13849", "IEC 62443"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Redundanter Bus", "Safe-State-Transition"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("communication_failure", 2),
|
|
Category: "communication_failure",
|
|
Name: "Cloud-Verbindungsverlust",
|
|
Description: "Die Verbindung zur Cloud-Infrastruktur bricht ab, wodurch cloud-abhaengige Funktionen (z.B. Modell-Updates, Monitoring) nicht verfuegbar sind.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"network", "software"},
|
|
RegulationReferences: []string{"CRA", "EU AI Act Art. 15"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Offline-Faehigkeit", "Edge-Computing"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("communication_failure", 3),
|
|
Category: "communication_failure",
|
|
Name: "Netzwerk-Latenz-Spitzen",
|
|
Description: "Unkontrollierte Latenzspitzen im Netzwerk fuehren zu Timeouts und verspaeteter Datenlieferung an sicherheitsrelevante Systeme.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"network"},
|
|
RegulationReferences: []string{"IEC 62443", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"QoS-Konfiguration", "Timeout-Handling"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
}
|
|
}
|