Skip to content

Commit cffaf58

Browse files
authored
Merge pull request #609 from dbarzin/dev
improve seed
2 parents b629e7d + 7ac0950 commit cffaf58

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

DOCKER.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,24 +179,18 @@ docker compose build --no-cache deming
179179
180180
These variables in `docker-compose.yml` control the first-run initialization:
181181
182-
| Variable | Values | Description |
183-
|---|---|---|
184-
| `INITIAL_DB` | `EN` / `FR` | Run migrations and seed the database in English or French |
185-
| `UPLOAD_DB_ISO27001` | `EN` / `FR` | Import the ISO 27001 control framework |
186-
| `USE_DEMO_DATA` | `1` / unset | Generate demo controls, measures and audit data |
187-
| `RESET_DB` | `EN` / `FR` | **⚠️ Wipe and recreate the entire database** |
188-
| `DB_SLEEP` | integer (seconds) | Extra wait before migration attempts (default: 10) |
182+
| Variable | Values | Description |
183+
|----------------|-------------------|----------------------------------------------------|
184+
| `RESET_DB` | `EN` / `FR` | **⚠️ Wipe and recreate the entire database** |
185+
| `DB_SLEEP` | integer (seconds) | Extra wait before migration attempts (default: 10) |
189186
190187
### Recommended lifecycle
191188
192189
```yaml
193190
# docker-compose.yml — first run
194191
environment:
195-
- INITIAL_DB=FR
196-
- UPLOAD_DB_ISO27001=FR
197-
- USE_DEMO_DATA=1
198-
- DB_SLEEP=10
199192
- TZ=Europe/Paris
193+
- DB_SLEEP=10
200194
- APP_FORCE_HTTPS=false
201195
```
202196

database/migrations/2026_04_07_152854_create_risk_scoring_table.php

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,37 +39,42 @@ public function up(): void
3939
});
4040

4141
// Insérer la configuration par défaut (ISO 27005 classique, alignée lb-consult)
42+
4243
DB::table('risk_scoring_configs')->insert([
43-
'name' => 'ISO 27005 — Probabilité × Impact (défaut)',
44+
'name' => 'ISO 27005',
4445
'formula' => 'probability_x_impact',
4546
'is_active' => true,
46-
47-
'probability_levels' => json_encode([
48-
['value' => 1, 'label' => 'Rare', 'description' => 'Moins d\'une fois tous les 10 ans'],
49-
['value' => 2, 'label' => 'Peu probable', 'description' => 'Tous les 5 à 10 ans'],
50-
['value' => 3, 'label' => 'Possible', 'description' => 'Tous les 1 à 5 ans'],
51-
['value' => 4, 'label' => 'Probable', 'description' => 'Plusieurs fois par an'],
52-
['value' => 5, 'label' => 'Très probable', 'description' => 'Plusieurs fois par mois'],
47+
'probability_levels' => json_encode([
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' => json_encode([
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' => json_encode([
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' => ''],
5364
]),
54-
5565
'impact_levels' => json_encode([
56-
['value' => 1, 'label' => 'Négligeable', 'description' => 'Aucun impact opérationnel mesurable'],
57-
['value' => 2, 'label' => 'Faible', 'description' => 'Impact limité, facilement résorbé'],
58-
['value' => 3, 'label' => 'Modéré', 'description' => 'Perturbation significative, récupérable'],
59-
['value' => 4, 'label' => 'Élevé', 'description' => 'Impact majeur sur les opérations'],
60-
['value' => 5, 'label' => 'Critique', 'description' => 'Menace existentielle pour l\'organisation'],
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' => ''],
6171
]),
62-
63-
'exposure_levels' => null,
64-
'vulnerability_levels' => null,
65-
6672
'risk_thresholds' => json_encode([
67-
['level' => 'low', 'label' => 'Faible', 'max' => 4, 'color' => 'success'],
68-
['level' => 'medium', 'label' => 'Moyen', 'max' => 9, 'color' => 'warning'],
69-
['level' => 'high', 'label' => 'Élevé', 'max' => 16, 'color' => 'danger'],
70-
['level' => 'critical', 'label' => 'Critique', 'max' => null, 'color' => 'alert'],
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'],
7177
]),
72-
7378
'created_at' => now(),
7479
'updated_at' => now(),
7580
]);

0 commit comments

Comments
 (0)