Skip to content
Back to projects
PERSONAL PROJECT

Matrice de Risques — Interactive Risk Register (Rebuilt)

Matrice de Risques — Interactive Risk Register (Rebuilt)

Interactive 5×5 likelihood/impact risk matrix — localStorage persistence, in-place editing, and a tested Python CLI for report generation

Context

matrice-risques rebuilds and extends risk-assessment-matrix, an open-source risk assessment project. Goal: an interactive risk register with a live Likelihood × Impact heat map (5×5), paired with a Python CLI for automation (bulk import, HTML report generation) — while fixing several blocking limitations of the original along the way.

Features

  • Likelihood × Impact matrix (5×5) with automatic scoring and color coding (Critical / High / Moderate / Low)
  • Risk register: categories, owners, mitigations, due dates, statuses
  • Client-side persistence (localStorage) — the register survives a page reload
  • In-place editing of existing risks (not just add/remove)
  • Search and filtering, including click-to-filter on a matrix cell (drill-down)
  • JSON and CSV export (UTF-8 BOM for Excel compatibility)
  • Python CLI: HTML report generation from a JSON register, on-demand risk scoring
  • pytest test suite covering the scoring engine

What was fixed vs. the original

  • No persistence, the register was lost on page reload → Persistence via localStorage, full register serialization/deserialization
  • README documented a flat CLI (--input, --risk) but the code required undocumented subcommands (report, eval) → CLI rewritten to match exactly what's documented
  • The register class's update() method was never called by the UI → Full "Edit" button, pre-filled form, in-place save
  • Likelihood/impact labels hardcoded in JS despite already existing in JSON → JS now loads categories_risques.json dynamically (single source of truth)
  • No automated tests → 6 pytest tests covering scoring, level boundaries, sorting, and example-data validation
  • Windows CLI output mis-encoded (cp1252) → sys.stdout.reconfigure(encoding="utf-8") — correct accented characters in console

Stack & Technologies

  • Vanilla HTML/CSS/JS (ES modules, zero dependencies) — standalone browser app
  • Python CLI (argparse, Jinja2, pytest) — automation and reporting
  • localStorage — client-side persistence
  • JSON / CSV export with UTF-8 BOM

Risk scoring

Score 20-25
Critical
Immediate remediation
Score 12-19
High
Remediation within 30 days
Score 6-11
Moderate
Remediation within 90 days
Score 1-5
Low
Acceptance or monitoring

Outcomes

Stack
Vanilla HTML/CSS/JS + Python CLI(argparse, Jinja2, pytest)
Tests
6 pytest tests(Scoring, level boundaries, sorting, data validation)
Persistence
localStorage(Fixes the original's main limitation)
Foundation for
risque360(matrice-risques later became the base for a platform combining STRIDE, vendor risk, and incident-driven recalibration)