feat(phase-37): timer pause/resume + professional reporting engine
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

Pause/Resume timer:
- Add paused_at, red_paused_seconds, blue_paused_seconds fields to Test model
- Add pause_timer/resume_timer workflow functions with accumulated pause tracking
- Auto-resume on phase submit; subtract paused time from worklog duration
- Add POST /tests/{id}/pause-timer and resume-timer endpoints
- Update LiveTimer component with pause/resume button and paused visual state
- Wire pause/resume mutations through TestDetailPage and TestDetailHeader

Professional Reporting Engine - Fase 2:
- Add ReportEngine service with Jinja2 HTML rendering, WeasyPrint PDF, and docxtpl DOCX
- Add corporate CSS stylesheet with cover page, data tables, stats grid, findings
- Create purple_campaign, coverage_report, and executive_summary HTML templates
- Add report_generation_service collecting domain data for each report type
- Add professional_reports router: GET /reports/generate/purple-campaign/{id}, coverage-summary, executive-summary
- Add analytics router with flat JSON endpoints for PowerBI: /coverage, /tests, /trends, /operators
- Add advanced_metrics router: /coverage-by-tactic, /never-tested, /avg-validation-time, /detection-rate-trend
- Add weasyprint and docxtpl to requirements.txt
- Add REPORT_TEMPLATES_DIR, REPORT_OUTPUT_DIR, COMPANY_NAME, COMPANY_LOGO_PATH to config
This commit is contained in:
2026-02-17 17:20:45 +01:00
parent febf460580
commit 31e116b4ba
23 changed files with 1564 additions and 25 deletions

View File

@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles/report.css">
<title>Coverage Report — {{ company_name }}</title>
</head>
<body>
<section class="cover-page">
<img src="assets/logo.png" class="logo" alt="Logo">
<h1>MITRE ATT&amp;CK Coverage Report</h1>
<h2>{{ company_name }}</h2>
<p class="date">{{ generated_at }}</p>
<p class="classification">{{ classification | default('INTERNAL') }}</p>
</section>
<section>
<h2>1. Organization Score</h2>
<div class="stats-grid">
<div class="stat">
<span class="number">{{ org_score.overall | default(0) }}%</span>
<span class="label">Overall Score</span>
</div>
<div class="stat">
<span class="number">{{ org_score.coverage | default(0) }}%</span>
<span class="label">Coverage</span>
</div>
<div class="stat">
<span class="number">{{ org_score.detection_maturity | default(0) }}%</span>
<span class="label">Detection Maturity</span>
</div>
</div>
</section>
<section>
<h2>2. Coverage Summary</h2>
<div class="metric-cards">
<div class="metric-card">
<div class="value">{{ summary.total_techniques }}</div>
<div class="label">Total Techniques</div>
</div>
<div class="metric-card">
<div class="value">{{ summary.validated }}</div>
<div class="label">Validated</div>
</div>
<div class="metric-card">
<div class="value">{{ summary.partial }}</div>
<div class="label">Partial</div>
</div>
<div class="metric-card">
<div class="value">{{ summary.not_covered }}</div>
<div class="label">Not Covered</div>
</div>
<div class="metric-card">
<div class="value">{{ summary.in_progress }}</div>
<div class="label">In Progress</div>
</div>
<div class="metric-card">
<div class="value">{{ summary.not_evaluated }}</div>
<div class="label">Not Evaluated</div>
</div>
</div>
</section>
<section>
<h2>3. Coverage by Tactic</h2>
<table class="data-table">
<thead>
<tr>
<th>Tactic</th>
<th>Total</th>
<th>Validated</th>
<th>Coverage %</th>
</tr>
</thead>
<tbody>
{% for tactic in tactics_coverage %}
<tr>
<td>{{ tactic.tactic }}</td>
<td>{{ tactic.total }}</td>
<td>{{ tactic.validated }}</td>
<td>{{ tactic.coverage_pct }}%</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
<section>
<h2>4. Never-Tested Techniques</h2>
{% if never_tested %}
<table class="data-table">
<thead>
<tr>
<th>MITRE ID</th>
<th>Name</th>
<th>Tactic</th>
</tr>
</thead>
<tbody>
{% for t in never_tested %}
<tr>
<td>{{ t.mitre_id }}</td>
<td>{{ t.name }}</td>
<td>{{ t.tactic }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>All techniques have been tested at least once.</p>
{% endif %}
</section>
<footer>
<p>{{ company_name }} — Confidential</p>
</footer>
</body>
</html>