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
16 KiB
Go
289 lines
16 KiB
Go
package iace
|
|
|
|
import "time"
|
|
|
|
// builtinHazardsSafetyFunctions returns hazard library entries for
|
|
// safety function failures, environmental hazards, and maintenance hazards.
|
|
func builtinHazardsSafetyFunctions() []HazardLibraryEntry {
|
|
now := time.Now()
|
|
return []HazardLibraryEntry{
|
|
// ====================================================================
|
|
// Category: safety_function_failure (8 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 1),
|
|
Category: "safety_function_failure",
|
|
Name: "Not-Halt trennt Energieversorgung nicht",
|
|
Description: "Der Not-Halt-Taster betaetigt die Sicherheitsschalter, die Energiezufuhr wird jedoch nicht vollstaendig unterbrochen, weil das Sicherheitsrelais versagt.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"controller", "actuator"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230 Anhang I §1.2.4", "IEC 60947-5-5", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Regelmaessiger Not-Halt-Test", "Redundantes Sicherheitsrelais", "Selbstueberwachender Sicherheitskreis"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 2),
|
|
Category: "safety_function_failure",
|
|
Name: "Schutztuer-Monitoring umgangen",
|
|
Description: "Das Schutztuer-Positionssignal wird durch einen Fehler oder Manipulation als 'geschlossen' gemeldet, obwohl die Tuer offen ist.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"sensor", "controller"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "ISO 14119", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Zwangsöffnender Positionsschalter", "Codierter Sicherheitssensor", "Anti-Tamper-Masssnahmen"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 3),
|
|
Category: "safety_function_failure",
|
|
Name: "Safe Speed Monitoring fehlt",
|
|
Description: "Beim Einrichten im reduzierten Betrieb fehlt eine unabhaengige Geschwindigkeitsueberwachung, so dass der Bediener nicht ausreichend geschuetzt ist.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"controller", "software"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 62061", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Sicherheitsumrichter mit SLS", "Unabhaengige Drehzahlmessung", "SIL-2-Geschwindigkeitsueberwachung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 4),
|
|
Category: "safety_function_failure",
|
|
Name: "STO-Funktion (Safe Torque Off) Fehler",
|
|
Description: "Die STO-Sicherheitsfunktion schaltet den Antriebsmoment nicht ab, obwohl die Funktion aktiviert wurde, z.B. durch Fehler im Sicherheits-SPS-Ausgang.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"actuator", "controller"},
|
|
RegulationReferences: []string{"IEC 61800-5-2", "Maschinenverordnung 2023/1230", "IEC 62061"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"STO-Pruefung bei Inbetriebnahme", "Pruefzyklus im Betrieb", "Zertifizierter Sicherheitsumrichter"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 5),
|
|
Category: "safety_function_failure",
|
|
Name: "Muting-Missbrauch bei Lichtvorhang",
|
|
Description: "Die Muting-Funktion des Lichtvorhangs wird durch Fehler oder Manipulation zu lange oder unkontrolliert aktiviert, was den Schutz aufhebt.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"sensor", "controller"},
|
|
RegulationReferences: []string{"IEC 61496-3", "Maschinenverordnung 2023/1230"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Zeitbegrenztes Muting", "Muting-Lampe und Alarm", "Protokollierung der Muting-Ereignisse"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 6),
|
|
Category: "safety_function_failure",
|
|
Name: "Zweihand-Taster durch Gegenstand ueberbrueckt",
|
|
Description: "Die Zweihand-Betaetigungseinrichtung wird durch ein eingeklemmtes Objekt permanent aktiviert, was den Bediener aus dem Schutzkonzept loest.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"hmi", "controller"},
|
|
RegulationReferences: []string{"ISO 13851", "Maschinenverordnung 2023/1230", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Anti-Tie-Down-Pruefung", "Typ-III-Zweihand-Taster", "Regelmaessige Funktionskontrolle"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 7),
|
|
Category: "safety_function_failure",
|
|
Name: "Sicherheitsrelais-Ausfall ohne Erkennung",
|
|
Description: "Ein Sicherheitsrelais versagt unentdeckt (z.B. verklebte Kontakte), sodass der Sicherheitskreis nicht mehr auftrennt.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"controller"},
|
|
RegulationReferences: []string{"ISO 13849", "IEC 62061"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Selbstueberwachung (zwangsgefuehrt)", "Regelmaessiger Testlauf", "Redundantes Relais"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("safety_function_failure", 8),
|
|
Category: "safety_function_failure",
|
|
Name: "Logic-Solver-Fehler in Sicherheits-SPS",
|
|
Description: "Die Sicherheitssteuerung (Safety-SPS) fuehrt sicherheitsrelevante Logik fehlerhaft aus, z.B. durch Speicherfehler oder Prozessorfehler.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 1,
|
|
ApplicableComponentTypes: []string{"controller", "software"},
|
|
RegulationReferences: []string{"IEC 61511", "IEC 61508", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"SIL-zertifizierte SPS", "Watchdog", "Selbsttest-Routinen (BIST)"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: environmental_hazard (5 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("environmental_hazard", 1),
|
|
Category: "environmental_hazard",
|
|
Name: "Ausfall durch hohe Umgebungstemperatur",
|
|
Description: "Hohe Umgebungstemperaturen ueberschreiten die spezifizierten Grenzwerte der Elektronik oder Aktorik und fuehren zu Fehlfunktionen.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"controller", "sensor"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 60068-2"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Betriebstemperatur-Spezifikation einhalten", "Klimaanlagensystem", "Temperatursensor + Abschaltung"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("environmental_hazard", 2),
|
|
Category: "environmental_hazard",
|
|
Name: "Ausfall bei Tieftemperatur",
|
|
Description: "Sehr tiefe Temperaturen reduzieren die Viskositaet von Hydraulikfluessigkeiten, beeinflussen Elektronik und fuehren zu mechanischen Ausfaellen.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"actuator", "controller"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 60068-2"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Tieftemperatur-spezifizierte Komponenten", "Heizung im Schaltschrank", "Anlaeufroutine bei Kaeltestart"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("environmental_hazard", 3),
|
|
Category: "environmental_hazard",
|
|
Name: "Korrosion durch Feuchtigkeit",
|
|
Description: "Hohe Luftfeuchtigkeit oder Kondenswasser fuehrt zur Korrosion von Kontakten und Leiterbahnen, was zu Ausfaellen und Isolationsfehlern fuehrt.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"controller", "sensor"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 60529"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"IP-Schutz entsprechend der Umgebung", "Belueftung mit Filter", "Regelmaessige Inspektion"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("environmental_hazard", 4),
|
|
Category: "environmental_hazard",
|
|
Name: "Fehlfunktion durch Vibrationen",
|
|
Description: "Mechanische Vibrationen lockern Verbindungen, schuetteln Kontakte auf oder beschaedigen Loetpunkte in Elektronikbaugruppen.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"controller", "sensor"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 60068-2-6"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Vibrationsdaempfung", "Vergossene Elektronik", "Regelmaessige Verbindungskontrolle"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("environmental_hazard", 5),
|
|
Category: "environmental_hazard",
|
|
Name: "Kontamination durch Staub oder Fluessigkeiten",
|
|
Description: "Staub, Metallspaeene oder Kuehlmittel gelangen in das Gehaeuseinnere und fuehren zu Kurzschluessen, Isolationsfehlern oder Kuehlproblemen.",
|
|
DefaultSeverity: 3,
|
|
DefaultProbability: 4,
|
|
ApplicableComponentTypes: []string{"controller", "hmi"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "IEC 60529"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Hohe IP-Schutzklasse", "Dichtungen regelmaessig pruefen", "Ueberdruck im Schaltschrank"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
|
|
// ====================================================================
|
|
// Category: maintenance_hazard (6 entries)
|
|
// ====================================================================
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 1),
|
|
Category: "maintenance_hazard",
|
|
Name: "Wartung ohne LOTO-Prozedur",
|
|
Description: "Wartungsarbeiten werden ohne korrekte Lockout/Tagout-Prozedur durchgefuehrt, sodass die Maschine waehrend der Arbeit anlaufen kann.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 3,
|
|
ApplicableComponentTypes: []string{"controller", "software"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230 Anhang I §1.6.3"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"LOTO-Funktion in Software", "Schulung", "Prozedur im Betriebshandbuch"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 2),
|
|
Category: "maintenance_hazard",
|
|
Name: "Fehlende LOTO-Funktion in Software",
|
|
Description: "Die Steuerungssoftware bietet keine Moeglichkeit, die Maschine fuer Wartungsarbeiten sicher zu sperren und zu verriegeln.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "hmi"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230 Anhang I §1.6.3"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Software-LOTO implementieren", "Wartungsmodus mit Schluessel", "Energiesperrfunktion"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 3),
|
|
Category: "maintenance_hazard",
|
|
Name: "Wartung bei laufender Maschine",
|
|
Description: "Wartungsarbeiten werden an betriebener Maschine durchgefuehrt, weil kein erzwungener Wartungsmodus vorhanden ist.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "controller"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Erzwungenes Abschalten fuer Wartungsmodus", "Schluesselschalter", "Schutzmassnahmen im Wartungsmodus"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 4),
|
|
Category: "maintenance_hazard",
|
|
Name: "Wartungs-Tool ohne Zugangskontrolle",
|
|
Description: "Ein Diagnose- oder Wartungswerkzeug ist ohne Authentifizierung zugaenglich und ermoeglicht die unbeaufsichtigte Aenderung von Sicherheitsparametern.",
|
|
DefaultSeverity: 4,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "hmi"},
|
|
RegulationReferences: []string{"IEC 62443", "CRA"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Authentifizierung fuer Wartungs-Tools", "Rollenkonzept", "Audit-Log fuer Wartungszugriffe"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 5),
|
|
Category: "maintenance_hazard",
|
|
Name: "Unsichere Demontage gefaehrlicher Baugruppen",
|
|
Description: "Die Betriebsanleitung beschreibt nicht, wie gefaehrliche Baugruppen (z.B. Hochvolt, gespeicherte Energie) sicher demontiert werden.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"other"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230 Anhang I §1.7.4"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Detaillierte Demontageanleitung", "Warnhinweise an Geraet", "Schulung des Wartungspersonals"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
{
|
|
ID: hazardUUID("maintenance_hazard", 6),
|
|
Category: "maintenance_hazard",
|
|
Name: "Wiederanlauf nach Wartung ohne Freigabeprozedur",
|
|
Description: "Nach Wartungsarbeiten wird die Maschine ohne formelle Freigabeprozedur wieder in Betrieb genommen, was zu Verletzungen bei noch anwesendem Personal fuehren kann.",
|
|
DefaultSeverity: 5,
|
|
DefaultProbability: 2,
|
|
ApplicableComponentTypes: []string{"software", "hmi"},
|
|
RegulationReferences: []string{"Maschinenverordnung 2023/1230 Anhang I §1.6.3", "ISO 13849"},
|
|
SuggestedMitigations: mustMarshalJSON([]string{"Software-Wiederanlauf-Freigabe", "Gefahrenbereich-Pruefung vor Anlauf", "Akustisches Warnsignal vor Anlauf"}),
|
|
IsBuiltin: true,
|
|
TenantID: nil,
|
|
CreatedAt: now,
|
|
},
|
|
}
|
|
}
|