Skip to content

Commit e92873a

Browse files
committed
i18n
1 parent eb57673 commit e92873a

File tree

5 files changed

+275
-31
lines changed

5 files changed

+275
-31
lines changed

app/Http/Controllers/RiskScoringConfigController.php

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
*/
1616
class RiskScoringConfigController extends Controller
1717
{
18+
1819
public function __construct(private readonly RiskScoringService $scoringService)
1920
{
2021
}
2122

2223
private function checkAdmin(): void
2324
{
24-
if (Auth::user()->role !== 1) {
25+
if (!Auth::user()->isAdmin()) {
2526
abort(403);
2627
}
2728
}
@@ -44,24 +45,35 @@ public function create(): View
4445
$config = new RiskScoringConfig([
4546
'formula' => 'probability_x_impact',
4647
'probability_levels' => [
47-
['value' => 1, 'label' => 'Rare', 'description' => ''],
48-
['value' => 2, 'label' => 'Peu probable', 'description' => ''],
49-
['value' => 3, 'label' => 'Possible', 'description' => ''],
50-
['value' => 4, 'label' => 'Probable', 'description' => ''],
51-
['value' => 5, 'label' => 'Très probable', 'description' => ''],
48+
['value' => 1, 'label' => __('cruds.risk_scoring.defaults.probability_levels.rare'), 'description' => ''],
49+
['value' => 2, 'label' => __('cruds.risk_scoring.defaults.probability_levels.unlikely'), 'description' => ''],
50+
['value' => 3, 'label' => __('cruds.risk_scoring.defaults.probability_levels.possible'), 'description' => ''],
51+
['value' => 4, 'label' => __('cruds.risk_scoring.defaults.probability_levels.likely'), 'description' => ''],
52+
['value' => 5, 'label' => __('cruds.risk_scoring.defaults.probability_levels.very_likely'), 'description' => ''],
53+
],
54+
'exposure_levels' => [
55+
['value' => 0, 'label' => __('cruds.risk_scoring.defaults.exposure_levels.offline'), 'description' => ''],
56+
['value' => 1, 'label' => __('cruds.risk_scoring.defaults.exposure_levels.internal'), 'description' => ''],
57+
['value' => 2, 'label' => __('cruds.risk_scoring.defaults.exposure_levels.internet'), 'description' => ''],
58+
],
59+
'vulnerability_levels' => [
60+
['value' => 1, 'label' => __('cruds.risk_scoring.defaults.vulnerability_levels.none'), 'description' => ''],
61+
['value' => 2, 'label' => __('cruds.risk_scoring.defaults.vulnerability_levels.known'), 'description' => ''],
62+
['value' => 3, 'label' => __('cruds.risk_scoring.defaults.vulnerability_levels.exploitable_int'), 'description' => ''],
63+
['value' => 4, 'label' => __('cruds.risk_scoring.defaults.vulnerability_levels.exploitable_ext'), 'description' => ''],
5264
],
5365
'impact_levels' => [
54-
['value' => 1, 'label' => 'Négligeable', 'description' => ''],
55-
['value' => 2, 'label' => 'Faible', 'description' => ''],
56-
['value' => 3, 'label' => 'Modéré', 'description' => ''],
57-
['value' => 4, 'label' => 'Élevé', 'description' => ''],
58-
['value' => 5, 'label' => 'Critique', 'description' => ''],
66+
['value' => 1, 'label' => __('cruds.risk_scoring.defaults.impact_levels.negligible'), 'description' => ''],
67+
['value' => 2, 'label' => __('cruds.risk_scoring.defaults.impact_levels.low'), 'description' => ''],
68+
['value' => 3, 'label' => __('cruds.risk_scoring.defaults.impact_levels.moderate'), 'description' => ''],
69+
['value' => 4, 'label' => __('cruds.risk_scoring.defaults.impact_levels.high'), 'description' => ''],
70+
['value' => 5, 'label' => __('cruds.risk_scoring.defaults.impact_levels.critical'), 'description' => ''],
5971
],
6072
'risk_thresholds' => [
61-
['level' => 'low', 'label' => 'Faible', 'max' => 4, 'color' => '#27ae60'],
62-
['level' => 'medium', 'label' => 'Moyen', 'max' => 9, 'color' => '#f39c12'],
63-
['level' => 'high', 'label' => 'Élevé', 'max' => 16, 'color' => '#e74c3c'],
64-
['level' => 'critical', 'label' => 'Critique', 'max' => null, 'color' => '#c0392b'],
73+
['level' => 'low', 'label' => __('cruds.risk_scoring.defaults.risk_thresholds.low'), 'max' => 4, 'color' => '#27ae60'],
74+
['level' => 'medium', 'label' => __('cruds.risk_scoring.defaults.risk_thresholds.medium'), 'max' => 9, 'color' => '#f39c12'],
75+
['level' => 'high', 'label' => __('cruds.risk_scoring.defaults.risk_thresholds.high'), 'max' => 16, 'color' => '#e74c3c'],
76+
['level' => 'critical', 'label' => __('cruds.risk_scoring.defaults.risk_thresholds.critical'), 'max' => null, 'color' => '#c0392b'],
6577
],
6678
]);
6779

@@ -198,14 +210,14 @@ private function validateConfig(Request $request): array
198210
// Helpers couleurs : migration legacy (noms de classes MetroUI) → hex
199211
// -------------------------------------------------------------------------
200212

201-
/*
202-
private const COLOR_MAP = [
203-
'success' => '#27ae60',
204-
'warning' => '#f39c12',
205-
'danger' => '#e74c3c',
206-
'alert' => '#c0392b',
207-
'info' => '#2980b9',
208-
'secondary' => '#7f8c8d',
209-
];
210-
*/
213+
/*
214+
private const COLOR_MAP = [
215+
'success' => '#27ae60',
216+
'warning' => '#f39c12',
217+
'danger' => '#e74c3c',
218+
'alert' => '#c0392b',
219+
'info' => '#2980b9',
220+
'secondary' => '#7f8c8d',
221+
];
222+
*/
211223
}

resources/lang/de/cruds.php

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,4 +335,165 @@
335335
],
336336
],
337337
],
338+
// -------------------------------------------------------------------------
339+
// Risikoregister
340+
// -------------------------------------------------------------------------
341+
'risk' => [
342+
343+
// Seitentitel
344+
'list' => 'Risikoliste',
345+
'create' => 'Neues Risiko',
346+
'edit' => 'Risiko bearbeiten',
347+
'matrix' => 'Risikomatrix',
348+
'singular' => 'Risiko',
349+
'plural' => 'Risiken',
350+
'export' => 'Risiken',
351+
352+
// Risikostufen (in Badges und Zählern angezeigt)
353+
'levels' => [
354+
'low' => 'Gering',
355+
'medium' => 'Mittel',
356+
'high' => 'Hoch',
357+
'critical' => 'Kritisch',
358+
],
359+
360+
// Formular- und Listenfelder
361+
'fields' => [
362+
'name' => 'Name',
363+
'description' => 'Beschreibung',
364+
'owner' => 'Verantwortlicher',
365+
'no_owner' => 'Nicht zugewiesen',
366+
'choose_owner' => 'Verantwortlichen wählen',
367+
'choose_status' => 'Status wählen',
368+
369+
// Bewertung
370+
'probability' => 'Wahrscheinlichkeit',
371+
'probability_comment' => 'Kommentar Wahrscheinlichkeit',
372+
'impact' => 'Auswirkung',
373+
'impact_comment' => 'Kommentar Auswirkung',
374+
'exposure' => 'Exposition',
375+
'vulnerability' => 'Verwundbarkeit',
376+
'likelihood' => 'Eintrittswahrscheinlichkeit',
377+
'score' => 'Punktzahl',
378+
379+
// Behandlung
380+
'status' => 'Behandlungsstatus',
381+
'status_comment' => 'Kommentar Status',
382+
'measures' => 'Verknüpfte Kontrollen',
383+
'measures_hint' => 'Erforderlich bei Status = Gemindert',
384+
'action_plan' => 'Verknüpfte Aktionspläne',
385+
'actions_hint' => 'Erforderlich bei Status = Nicht akzeptiert',
386+
387+
// Planung
388+
'review_frequency' => 'Überprüfungshäufigkeit',
389+
'next_review' => 'Nächste Überprüfung',
390+
'overdue' => 'Überprüfung überfällig',
391+
'overdue_all' => 'Alle',
392+
'overdue_only' => 'Überfällig',
393+
394+
// Dashboard / Matrix
395+
'total' => 'Gesamt',
396+
'by_status' => 'Verteilung nach Status',
397+
'by_risks' => 'Verteilung nach Risiken',
398+
],
399+
400+
// Behandlungsstatus
401+
'status' => [
402+
'not_evaluated' => 'Nicht bewertet',
403+
'not_accepted' => 'Nicht akzeptiert',
404+
'temporarily_accepted' => 'Vorläufig akzeptiert',
405+
'accepted' => 'Akzeptiert',
406+
'mitigated' => 'Gemindert',
407+
'transferred' => 'Übertragen',
408+
'avoided' => 'Vermieden',
409+
],
410+
],
411+
412+
// -------------------------------------------------------------------------
413+
// Konfiguration der Risikobewertung
414+
// -------------------------------------------------------------------------
415+
'risk_scoring' => [
416+
417+
// Seitentitel
418+
'list' => 'Risikoklassifizierungsmethoden',
419+
'create' => 'Neue Klassifizierung',
420+
'edit' => 'Klassifizierung bearbeiten',
421+
'activate' => 'Diese Konfiguration aktivieren',
422+
423+
// Aktionen auf Stufen / Schwellenwerte
424+
'add_level' => 'Stufe hinzufügen',
425+
'add_threshold' => 'Schwellenwert hinzufügen',
426+
427+
// Kontexthilfen
428+
'levels_hint' => 'Mindestens 2 Stufen. Der Wert muss eine eindeutige ganze Zahl sein.',
429+
'thresholds_hint' => 'Der letzte Schwellenwert hat keine Obergrenze (Auffangwert). Vom niedrigsten zum höchsten Score sortieren.',
430+
431+
// Formularfelder
432+
'fields' => [
433+
'name' => 'Konfiguration',
434+
'formula' => 'Berechnung',
435+
'levels' => 'Stufen',
436+
'thresholds' => 'Klassifizierungsschwellen',
437+
'value' => 'Wert',
438+
'label' => 'Bezeichnung',
439+
'description' => 'Beschreibung',
440+
'level_key' => 'Interner Schlüssel',
441+
'score_max' => 'Max. Punktzahl',
442+
'color' => 'Farbe',
443+
],
444+
445+
// Verfügbare Farben für Schwellenwerte
446+
'colors' => [
447+
'success' => 'Grün',
448+
'warning' => 'Orange',
449+
'danger' => 'Rot',
450+
'alert' => 'Dunkelrot',
451+
'info' => 'Blau',
452+
'secondary' => 'Grau',
453+
],
454+
455+
// Verfügbare Formeln (Bezeichnungen)
456+
'formulas' => [
457+
'probability_x_impact' => 'Wahrscheinlichkeit × Auswirkung',
458+
'likelihood_x_impact' => 'Eintrittswahrscheinlichkeit × Auswirkung (BSI 200-3)',
459+
'additive' => 'Wahrscheinlichkeit + Auswirkung',
460+
'max_pi' => 'max(Wahrscheinlichkeit, Auswirkung)',
461+
],
462+
463+
// Standardwerte bei der Erstellung einer neuen Konfiguration
464+
'defaults' => [
465+
'probability_levels' => [
466+
'rare' => 'Selten',
467+
'unlikely' => 'Unwahrscheinlich',
468+
'possible' => 'Möglich',
469+
'likely' => 'Wahrscheinlich',
470+
'very_likely' => 'Sehr wahrscheinlich',
471+
],
472+
'exposure_levels' => [
473+
'offline' => 'Offline',
474+
'internal' => 'Intern',
475+
'internet' => 'Internet',
476+
],
477+
'vulnerability_levels' => [
478+
'none' => 'Keine',
479+
'known' => 'Bekannt',
480+
'exploitable_int' => 'Intern ausnutzbar',
481+
'exploitable_ext' => 'Extern ausnutzbar',
482+
],
483+
'impact_levels' => [
484+
'negligible' => 'Vernachlässigbar',
485+
'low' => 'Gering',
486+
'moderate' => 'Mäßig',
487+
'high' => 'Hoch',
488+
'critical' => 'Kritisch',
489+
],
490+
'risk_thresholds' => [
491+
'low' => 'Gering',
492+
'medium' => 'Mittel',
493+
'high' => 'Hoch',
494+
'critical' => 'Kritisch',
495+
],
496+
],
497+
],
498+
338499
];

resources/lang/en/cruds.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,42 @@
462462
'additive' => 'Probability + Impact',
463463
'max_pi' => 'max(Probability, Impact)',
464464
],
465+
466+
467+
// Default values suggested when creating a configuration
468+
'defaults' => [
469+
'probability_levels' => [
470+
'rare' => 'Rare',
471+
'unlikely' => 'Unlikely',
472+
'possible' => 'Possible',
473+
'likely' => 'Probable',
474+
'very_likely' => 'Very Likely',
475+
],
476+
'exposure_levels' => [
477+
'offline' => 'Offline',
478+
'internal' => 'Internal',
479+
'internet' => 'Internet',
480+
],
481+
'vulnerability_levels' => [
482+
'none' => 'None',
483+
'known' => 'Known',
484+
'exploitable_int' => 'Internally exploitable',
485+
'exploitable_ext' => 'Externally exploitable',
486+
],
487+
'impact_levels' => [
488+
'negligible' => 'Negligible',
489+
'low' => 'Low',
490+
'moderate' => 'Moderate',
491+
'high' => 'High',
492+
'critical' => 'Critical',
493+
],
494+
'risk_thresholds' => [
495+
'low' => 'Low',
496+
'medium' => 'Medium',
497+
'high' => 'High',
498+
'critical' => 'Critical',
499+
],
500+
],
465501
],
466502

467503
];

resources/lang/fr/cruds.php

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
],
5555
],
5656
'attribute' => [
57-
'fields' => [
57+
'fields' => [
5858
'name' => 'Nom',
5959
'values' => 'Valeurs',
6060
],
@@ -64,7 +64,7 @@
6464
'index' => 'Liste des attributs',
6565
'choose' => 'Choisir un attribut',
6666
'title' => 'Attribut'
67-
],
67+
],
6868
'control' => [
6969
'description' => '',
7070
'fields' => [
@@ -248,7 +248,7 @@
248248
'action' => 'Plan d\'action',
249249
'action_helper' => 'Le plan d\'action proposé',
250250
'warning' => 'Cette action est irréversible. Veuillez effectuer une sauvegarde avant !'
251-
],
251+
],
252252
'log' => [
253253
'index' => 'Liste des logs',
254254
'title' => 'Log',
@@ -335,7 +335,7 @@
335335
'month' => 'mois',
336336
'months' => 'mois',
337337
],
338-
]
338+
]
339339
],
340340

341341
// -------------------------------------------------------------------------
@@ -462,5 +462,40 @@
462462
'additive' => 'Probabilité + Impact',
463463
'max_pi' => 'max(Probabilité, Impact)',
464464
],
465+
466+
// Valeurs par défaut proposées à la création d'une configuration
467+
'defaults' => [
468+
'probability_levels' => [
469+
'rare' => 'Rare',
470+
'unlikely' => 'Peu probable',
471+
'possible' => 'Possible',
472+
'likely' => 'Probable',
473+
'very_likely' => 'Très probable',
474+
],
475+
'exposure_levels' => [
476+
'offline' => 'Hors réseau',
477+
'internal' => 'Interne',
478+
'internet' => 'Internet',
479+
],
480+
'vulnerability_levels' => [
481+
'none' => 'Aucune',
482+
'known' => 'Connue',
483+
'exploitable_int' => 'Exploitable interne',
484+
'exploitable_ext' => 'Exploitable externe',
485+
],
486+
'impact_levels' => [
487+
'negligible' => 'Négligeable',
488+
'low' => 'Faible',
489+
'moderate' => 'Modéré',
490+
'high' => 'Élevé',
491+
'critical' => 'Critique',
492+
],
493+
'risk_thresholds' => [
494+
'low' => 'Faible',
495+
'medium' => 'Moyen',
496+
'high' => 'Élevé',
497+
'critical' => 'Critique',
498+
],
499+
],
465500
],
466-
];
501+
];

resources/views/risks/scoring/form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161

162162
{{-- Vulnérabilité : pleine largeur, visible si likelihood --}}
163163
<div class="row" id="vulnerability-row" style="display:none">
164-
<div class="cell-lg-12 cell-md-12 mb-4">
164+
<div class="cell-lg-6 cell-md-6 mb-4">
165165
<div class="level-section-header" style="background:#7d3c98">
166166
<span class="mif-bug"></span>
167167
&nbsp;{{ trans("cruds.risk.fields.vulnerability") }}

0 commit comments

Comments
 (0)