- Makefile: introduce CONTAINER_CMD ?= $(shell command -v docker || echo podman), replace all 12 hardcoded `docker` invocations with $(CONTAINER_CMD). User can override with `make <target> CONTAINER_CMD=podman` or env export. - e2e/tests/us1-bootstrap-admin.spec.ts: AC-1.4 regex updated to match the new variable form `$(CONTAINER_CMD) exec … flask create-admin` (was hardcoded `docker exec`). RUNTIME default also auto-detects (same logic as Makefile) so the test exec'es the right engine without a MIMIC_CONTAINER_CMD export. - e2e/tests/us6-deployment.spec.ts: same RUNTIME auto-detect so the make-dry-run regex assertions on lines 75 + 77 match what the Makefile actually emits on a podman-only host. - README + CHANGELOG document the new behavior. Fixes the user-reported issue: "Le makefile ne fonctionne pas sur ma machine qui n'a que podman." Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8.6 KiB
8.6 KiB
Changelog
All notable changes to Mimic are tracked here.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[Unreleased]
Added — Sprint 2 (Simulations + MITRE ATT&CK)
Backend (Flask + SQLAlchemy, 131 pytest passing)
Simulationmodel with redteam-side (name,mitre_technique_id,mitre_technique_name,description,commands,prerequisites,executed_at,execution_result) and SOC-side (log_source,logs,soc_comment,incident_number) fields, plusstatusenum (pending/in_progress/review_required/done), FK toEngagement(cascade delete) andUser(creator).- Alembic migration
0002_add_simulations.py. - 7 new endpoints:
GET/POST /api/engagements/<eid>/simulations,GET/PATCH/DELETE /api/simulations/<sid>,POST /api/simulations/<sid>/transition,GET /api/mitre/techniques?q=. simulation_workflowservice: field-level RBAC (SOC blocked when status ∈ {pending, in_progress}; SOC rejected if payload contains a redteam field), state machine (only forward transitions, validated by role), and auto-transitionpending → in_progresswhen admin/redteam saves any non-empty redteam field.mitreservice: STIX 2.1 Enterprise bundle loaded at boot, indexed by T-id + name + tactic. Ranked search (exact-id > prefix-id > substring-name), max 20 results. Includes sub-techniques (T1059.001). Boot-safe: missing/corrupt bundle logs a warning and the endpoint returns 503 instead of crashing the app.make update-mitreis now a real target — fetches the upstream STIX bundle and restarts the container if running. Bundle is committed atbackend/data/mitre/enterprise-attack.json(~46 MB) somake buildstays self-contained.- Upfront validation of
executed_at(no partial mutation on parse failure).
Frontend (React + TanStack Query, 63 vitest passing)
SimulationListcomponent rendered insideEngagementDetailPage(replaces the Sprint 1 placeholder). Columns: name, MITRE id, status badge, executed_at. Row click → SPA navigation viauseNavigate(no full reload).SimulationFormPage(/engagements/:eid/simulations/newand/engagements/:eid/simulations/:sid/edit): single role-aware page with two cards ("Red Team" / "SOC"). Redteam/admin can edit all fields; SOC sees the redteam card as read-only and the SOC card disabled (with an explanatory banner) until status reachesreview_required. Footer surfaces context-appropriate transition buttons ("Marquer en revue" / "Clôturer") and a confirmation modal for delete.MitreTechniquePicker: debounced (200 ms) autocomplete input with keyboard navigation (↑↓ / Enter / Escape), listbox accessibility, and an inline 503 error path. Selection populates bothmitre_technique_idandmitre_technique_name. AhasHydratedFromPropsref prevents the input from being wiped mid-stroke when the parent emitsonChange(null, null).SimulationStatusBadge: 4 variants mapped to DESIGN.md tokens (bg-fog,bg-primary-soft,bg-bloom-coral,bg-storm-deep). Sibling of the existingStatusBadgerather than a forked generic — the two badges share visual scaffolding but their enums diverge.ConfirmDialog: generic modal used by the delete flow.- TanStack Query hooks:
useEngagementSimulations,useSimulation,useCreateSimulation,useUpdateSimulation,useDeleteSimulation,useTransitionSimulation,useMitreSearch. Mutations invalidate both the simulation detail key and the engagement-scoped list key.
Acceptance tests (Playwright, 68 specs)
- 6 new spec files (one per user story US-7 → US-12), 32 tests, all green.
us4-engagements.spec.tsAC-4.9 assertion refreshed: the Sprint 1 placeholder text was correctly replaced by the newSimulationList(the test now asserts the new heading + "Nouvelle simulation" link).- 5 pre-existing failures in
us1-bootstrap-admin.spec.tsandus6-deployment.spec.tsremain — they hard-codedockerin the test body and fail in dev environments that only havepodman. The fixtures already supportMIMIC_CONTAINER_CMD; the test bodies don't yet. Out of scope for Sprint 2 — to be picked up later.
Changed
- 2026-05-26 —
make update-mitreupgraded from no-op placeholder to a realcurl+ optional container restart (Sprint 1 marker resolved). - 2026-05-26 —
EngagementDetailPageno longer renders the "Simulations à venir au Sprint 2" placeholder; it embeds<SimulationList>instead. - 2026-05-26 — Makefile now auto-detects the container engine (
CONTAINER_CMD ?= docker || podman) instead of hard-codingdocker. Override withmake <target> CONTAINER_CMD=podmanorexport CONTAINER_CMD=…. The matching e2e tests (us1,us6) were updated to mirror the same detection so they pass on podman-only machines without an explicitMIMIC_CONTAINER_CMDexport.
[Sprint 1] — Auth + CRUD Engagement (merged 2026-05-26)
Added
Backend (Flask + SQLAlchemy + SQLite, 63 pytest passing)
Usermodel withadmin / redteam / socenum, argon2 password hashing.Engagementmodel withplanned / active / closedstatus, FK to creator user.- JWT Bearer auth (
PyJWT, HS256, 60-min TTL),@login_requiredand@role_required(*roles)decorators. - 13 API endpoints:
/api/auth/{login,logout,me},/api/usersCRUD (admin-only with last-admin protection),/api/engagementsCRUD (RBAC per role),/api/health. - Alembic migration applied at container boot by
docker/entrypoint.sh. flask create-adminCLI with duplicate-username and short-password validation.- Engagement serializer returns
created_by={id, username}(not bare User object). - SPA fallback returns JSON 404 for unknown
/api/*paths (no HTML leakage).
Frontend (React + Vite + TailwindCSS + TanStack Query, 20 vitest passing)
- Inter font bundled locally via
@fontsource-variable/inter(no CDN at runtime). - Tailwind config maps the
DESIGN.mdtoken system (palette, typography, spacing, radii). - Pages:
LoginPage,EngagementsListPage,EngagementFormPage(new+edit),EngagementDetailPage(Sprint 2 placeholder),UsersAdminPage. - Components:
Layout,ProtectedRoute(auth + role gate),StatusBadge,FormField,LoadingState/ErrorState/EmptyState,Toast+ provider. - Axios client with Bearer interceptor; 401 → token purge + redirect
/login+ "Session expirée" toast (AC-2.6); 403 → "Accès refusé" toast (AC-3.7). - TanStack Query hooks:
useAuth,useEngagements,useUsers,useToast.
Deployment
- Single-container
docker/Dockerfile(multistage:node:20-alpine→python:3.12-slim). docker/entrypoint.shrunningflask db upgrade && flask run.Makefilewithbuild,start,stop,restart,update,logs,create-admin,update-mitre(no-op placeholder for Sprint 2),test-backend,test-frontend,test-e2e,clean..env.exampledocumentingMIMIC_JWT_SECRET,MIMIC_DB_PATH,MIMIC_PORT.- SQLite persisted at
/data/mimic.sqlite, volumemimic-datasurvivesmake restart.
Acceptance tests (Playwright, 36 specs, all 27 ACs covered)
e2e/scaffold:playwright.config.ts,fixtures/{auth,api}.ts, 6 spec files (one per user story).- Suite is portable via
MIMIC_CONTAINER_CMD/MIMIC_BASE_URLenv vars (works withdockerorpodman).
Docs
README.mdwith quick-start, architecture overview, project layout, make target reference, and dev workflow.pyrightconfig.jsonat repo root pointing the Python LSP tobackend/.venvand adding the worktree root toextraPathsfor absolute imports.
Changed
- 2026-05-26 —
adminrole widened inSPEC.md§ Décisions techniques. The initial draft restricted admin to user-management only; after the Sprint 1 plan review surfaced the operational pain (admin would need a secondredteamaccount just to manage engagements), the user decided to make admin a super-user that cumulates redteam rights on engagements/simulations.
Removed
- none
[Sprint 0] — Bootstrap (merged 2026-05-26)
Added
- Initial
SPEC.mdcovering project scope, simulation model, workflow, stack, and agent team. - Technical decisions section in
SPEC.md: 3-role auth (admin/redteam/soc), JWT Bearer, single-container Flask+React, local MITRE STIX bundle, minimal Engagement model, admin bootstrap via Makefile target. - Sub-agent definitions under
.claude/agents/for backend-builder, frontend-builder, spec-reviewer (project override of the built-in, covers plan-vs-spec and code-vs-spec), code-reviewer, test-verifier, devil-advocate. - Project tracking scaffold:
tasks/todo.md,tasks/lessons.md,CHANGELOG.md,.gitignore.