Privacy Metrics Dashboard
Overview
A privacy metrics dashboard provides quantitative visibility into the effectiveness and maturity of an organization's privacy program. This skill defines the key privacy performance indicators (KPIs), data collection methods, visualization patterns, and reporting cadences needed to measure, monitor, and continuously improve privacy operations.
Core Privacy KPI Categories
1. Data Subject Access Requests (DSARs)
| Metric |
Definition |
Target |
Frequency |
| DSAR Volume |
Total DSARs received per period |
Trend monitoring |
Monthly |
| DSAR by Type |
Breakdown by right exercised (access, deletion, portability, rectification) |
N/A (distribution) |
Monthly |
| Average Response Time |
Mean calendar days from receipt to completion |
< 25 days (GDPR: 30 day limit) |
Monthly |
| Median Response Time |
Median calendar days from receipt to completion |
< 20 days |
Monthly |
| P95 Response Time |
95th percentile response time |
< 28 days |
Monthly |
| On-Time Completion Rate |
% completed within regulatory deadline |
> 98% |
Monthly |
| DSAR Backlog |
Open DSARs at period end |
< 10% of monthly volume |
Weekly |
| Automated Fulfillment Rate |
% of DSARs fulfilled without manual intervention |
> 60% |
Quarterly |
| Identity Verification Failure Rate |
% of DSARs where identity could not be verified |
< 5% |
Monthly |
| Cost per DSAR |
Average cost to process one DSAR |
Trend reduction |
Quarterly |
2. Data Breaches
| Metric |
Definition |
Target |
Frequency |
| Breach Count |
Total confirmed breaches per period |
0 (minimize) |
Monthly |
| Breach Severity Distribution |
Count by severity level (low/medium/high/critical) |
No critical breaches |
Monthly |
| Mean Time to Detect (MTTD) |
Average hours from breach occurrence to detection |
< 24 hours |
Per incident |
| Mean Time to Notify (MTTN) |
Average hours from detection to regulatory notification |
< 48 hours (GDPR: 72 hours) |
Per incident |
| Mean Time to Contain (MTTC) |
Average hours from detection to containment |
< 12 hours |
Per incident |
| Records Affected |
Total data subject records affected |
Minimize |
Per incident |
| Repeat Breach Rate |
% of breaches with same root cause as prior breach |
0% |
Quarterly |
| Regulatory Fines |
Total fines imposed due to breaches |
$0 |
Annual |
| Breach Simulation Score |
Score from most recent tabletop exercise |
> 85% |
Semi-annual |
3. Privacy Impact Assessments (DPIAs)
| Metric |
Definition |
Target |
Frequency |
| DPIA Completion Rate |
% of high-risk processing with completed DPIA |
100% |
Quarterly |
| DPIA Backlog |
DPIAs required but not yet started |
0 |
Monthly |
| Average DPIA Duration |
Mean days from initiation to sign-off |
< 30 days |
Quarterly |
| DPIA Findings Remediated |
% of identified risks with implemented mitigations |
> 90% |
Quarterly |
| DPIA Review Rate |
% of existing DPIAs reviewed within their review cycle |
> 95% |
Quarterly |
| New Processing Without DPIA |
Count of new high-risk processing launched without DPIA |
0 |
Monthly |
4. Training and Awareness
| Metric |
Definition |
Target |
Frequency |
| Training Completion Rate |
% of staff who completed required privacy training |
> 95% |
Quarterly |
| Training Pass Rate |
% passing the assessment on first attempt |
> 85% |
Quarterly |
| New Hire Training Time |
Average days from start date to training completion |
< 14 days |
Monthly |
| Specialist Certification Rate |
% of privacy team with professional certification |
> 80% |
Annual |
| Privacy Champion Coverage |
% of business units with designated privacy champion |
100% |
Quarterly |
| Phishing Simulation Pass Rate |
% of staff correctly identifying privacy-related phishing |
> 90% |
Quarterly |
5. Consent Management
| Metric |
Definition |
Target |
Frequency |
| Consent Rate |
% of users providing consent (by purpose) |
Trend monitoring |
Monthly |
| Opt-in Rate |
% choosing to opt in to optional processing |
Trend monitoring |
Monthly |
| Opt-out/Withdrawal Rate |
% withdrawing previously given consent |
< 5% monthly |
Monthly |
| Consent Freshness |
% of active consents collected within last 12 months |
> 70% |
Quarterly |
| Consent Collection Coverage |
% of data processing with documented consent/legal basis |
100% |
Quarterly |
| Cookie Consent Rate |
% of website visitors accepting cookies (by category) |
Trend monitoring |
Monthly |
| Consent Record Accuracy |
% of consent records matching actual processing |
> 99% |
Quarterly |
6. Operational Metrics
| Metric |
Definition |
Target |
Frequency |
| Privacy Incidents Reported |
Internal privacy incidents reported (not just breaches) |
Trend monitoring |
Monthly |
| Vendor Privacy Assessments Completed |
% of high-risk vendors assessed |
100% |
Quarterly |
| Data Inventory Completeness |
% of processing activities documented in ROPA |
> 95% |
Quarterly |
| Policy Acknowledgment Rate |
% of staff acknowledging updated privacy policies |
> 98% |
Per update |
| Privacy-by-Design Gate Pass Rate |
% of projects passing privacy review at design gate |
> 85% |
Quarterly |
| Regulatory Inquiry Response Time |
Average days to respond to regulatory inquiries |
< 5 days |
Per event |
Data Collection Architecture
Data Sources Collection Layer Dashboard Layer
+------------------+
| DSAR Platform |---+
+------------------+ |
| +-------------------+ +-----------------------+
+------------------+ +--->| | | |
| Breach Tracker |------->| Data Integration |--->| Visualization Engine |
+------------------+ +--->| (ETL Pipeline) | | (Grafana / Tableau / |
| | | | Power BI / Metabase) |
+------------------+ | +-------------------+ +-----------------------+
| DPIA Register |---+ | |
+------------------+ | v v
| +-------------------+ +-----------------------+
+------------------+ | | Metrics Database | | Alerting System |
| LMS (Training) |---+ | (Time-series / | | - Threshold breaches |
+------------------+ | | PostgreSQL) | | - Trend deviations |
| +-------------------+ | - SLA warnings |
+------------------+ | +-----------------------+
| Consent Platform |---+
+------------------+
Metric Collection Implementation
"""
Privacy metrics collection and aggregation engine.
Collects KPI data from multiple privacy operational systems
and computes dashboard-ready metrics.
"""
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Optional
import statistics
@dataclass
class DSARMetrics:
period_start: datetime
period_end: datetime
total_received: int
total_completed: int
total_overdue: int
avg_response_days: float
median_response_days: float
p95_response_days: float
on_time_rate: float
by_type: dict[str, int]
backlog: int
automated_rate: float
@dataclass
class BreachMetrics:
period_start: datetime
period_end: datetime
total_breaches: int
by_severity: dict[str, int]
avg_detection_hours: float
avg_notification_hours: float
avg_containment_hours: float
total_records_affected: int
repeat_breach_count: int
@dataclass
class ConsentMetrics:
period_start: datetime
period_end: datetime
total_consent_events: int
opt_in_rate: float
withdrawal_rate: float
consent_rate_by_purpose: dict[str, float]
cookie_acceptance_rate: float
consent_freshness_pct: float
class PrivacyMetricsCollector:
"""
Collect and compute privacy KPIs from operational data sources.
"""
def __init__(self, dsar_repo, breach_repo, dpia_repo, training_repo, consent_repo):
self.dsar_repo = dsar_repo
self.breach_repo = breach_repo
self.dpia_repo = dpia_repo
self.training_repo = training_repo
self.consent_repo = consent_repo
def compute_dsar_metrics(
self,
start_date: datetime,
end_date: datetime,
regulatory_deadline_days: int = 30
) -> DSARMetrics:
"""Compute DSAR KPIs for a given period."""
dsars = self.dsar_repo.get_by_period(start_date, end_date)
completed = [d for d in dsars if d.status == "completed"]
response_times = [
(d.completed_at - d.received_at).days
for d in completed
if d.completed_at and d.received_at
]
d for d in completed
if (d.completed_at - d.received_at).days <= regulatory_deadline_days
]
automated = [d for d in completed if d.automated]
open_dsars = [d for d in dsars if d.status in ("open", "in_progress")]
by_type = {}
for d in dsars:
by_type[d.request_type] = by_type.get(d.request_type, 0) + 1
return DSARMetrics(
period_start=start_date,
period_end=end_date,
total_received=len(dsars),
total_completed=len(completed),
total_overdue=len(dsars) - len(on_time) - len(open_dsars),
avg_response_days=statistics.mean(response_times) if response_times else 0,
median_response_days=statistics.median(response_times) if response_times else 0,
p95_response_days=(
sorted(response_times)[int(len(response_times) * 0.95)]
if len(response_times) >= 20 else
max(response_times) if response_times else 0
),
/ len(completed) if completed else 1.0,
by_type=by_type,
backlog=len(open_dsars),
automated_rate=len(automated) / len(completed) if completed else 0,
)
def compute_breach_metrics(
self,
start_date: datetime,
end_date: datetime
) -> BreachMetrics:
"""Compute breach KPIs for a given period."""
breaches = self.breach_repo.get_by_period(start_date, end_date)
by_severity = {}
detection_hours = []
notification_hours = []
containment_hours = []
total_records = 0
for b in breaches:
by_severity[b.severity] = by_severity.get(b.severity, 0) + 1
total_records += b.records_affected or 0
if b.detected_at and b.occurred_at:
detection_hours.append(
(b.detected_at - b.occurred_at).total_seconds() / 3600
)
if b.notified_at and b.detected_at:
notification_hours.append(
(b.notified_at - b.detected_at).total_seconds() / 3600
)
if b.contained_at and b.detected_at:
containment_hours.append(
(b.contained_at - b.detected_at).total_seconds() / 3600
)
# Count repeat breaches (same root cause as previous)
root_causes = [b.root_cause for b in breaches if b.root_cause]
repeat_count = len(root_causes) - len(set(root_causes))
return BreachMetrics(
period_start=start_date,
period_end=end_date,
total_breaches=len(breaches),
by_severity=by_severity,
avg_detection_hours=statistics.mean(detection_hours) if detection_hours else 0,
avg_notification_hours=statistics.mean(notification_hours) if notification_hours else 0,
avg_containment_hours=statistics.mean(containment_hours) if containment_hours else 0,
total_records_affected=total_records,
repeat_breach_count=repeat_count,
)
def generate_executive_report(
self,
period_start: datetime,
period_end: datetime
) -> dict:
"""
Generate a comprehensive executive privacy report.
Combines all KPI categories into a single report structure.
"""
dsar = self.compute_dsar_metrics(period_start, period_end)
breach = self.compute_breach_metrics(period_start, period_end)
# Calculate overall privacy health score (0-100)
health_components = []
# DSAR component (25% weight)
dsar_score = min(100, dsar.on_time_rate * 100)
health_components.append(("DSAR Compliance", dsar_score, 0.25))
# Breach component (30% weight)
breach_score = 100 if breach.total_breaches == 0 else max(0, 100 - breach.total_breaches * 20)
health_components.append(("Breach Prevention", breach_score, 0.30))
# Response time component (20% weight)
response_score = min(100, max(0, (30 - dsar.avg_response_days) / 30 * 100))
health_components.append(("Response Timeliness", response_score, 0.20))
# Detection speed component (25% weight)
detection_score = min(100, max(0, (72 - breach.avg_detection_hours) / 72 * 100)) if breach.total_breaches > 0 else 100
health_components.append(("Detection Speed", detection_score, 0.25))
overall_score = sum(score * weight for _, score, weight in health_components)
return {
"period": {
"start": period_start.isoformat(),
"end": period_end.isoformat()
},
"overall_privacy_health_score": round(overall_score, 1),
"health_rating": (
"Excellent" if overall_score >= 90 else
"Good" if overall_score >= 75 else
"Needs Improvement" if overall_score >= 60 else
"Critical"
),
"components": {
name: {"score": round(score, 1), "weight": f"{weight*100:.0f}%"}
for name, score, weight in health_components
},
"dsar_summary": {
"volume": dsar.total_received,
"on_time_rate": f"{dsar.on_time_rate*100:.1f}%",
"avg_response_days": round(dsar.avg_response_days, 1),
"backlog": dsar.backlog
},
"breach_summary": {
"count": breach.total_breaches,
"severity_distribution": breach.by_severity,
"avg_detection_hours": round(breach.avg_detection_hours, 1),
"records_affected": breach.total_records_affected
},
}
Dashboard Visualization Patterns
Executive Summary View
| Panel |
Chart Type |
Metrics Displayed |
Refresh Rate |
| Privacy Health Score |
Gauge (0-100) |
Overall weighted score |
Daily |
| DSAR Volume Trend |
Line chart |
Monthly DSAR count (12-month rolling) |
Daily |
| Breach Timeline |
Event timeline |
Breaches by severity over time |
Real-time |
| On-Time Rate |
Single stat with spark line |
DSAR on-time completion % |
Daily |
| Training Coverage |
Horizontal bar |
Completion rate by department |
Weekly |
| Consent Rate Trend |
Multi-line chart |
Opt-in rate by purpose (6-month) |
Daily |
Operational View
| Panel |
Chart Type |
Metrics Displayed |
Refresh Rate |
| Active DSARs |
Table with status |
Open requests with deadlines |
Hourly |
| DSAR Aging |
Histogram |
Distribution of open DSAR ages |
Daily |
| Response Time Box Plot |
Box plot |
Response time distribution by month |
Daily |
| Breach Detection Funnel |
Funnel chart |
Detection > Assessment > Notification > Resolution |
Per event |
| DPIA Pipeline |
Kanban |
DPIAs by status (draft, review, approved) |
Daily |
| Vendor Risk Heat Map |
Heat map |
Vendors by risk score and last assessment date |
Weekly |
Alerting Rules
| Alert |
Condition |
Severity |
Recipient |
| DSAR SLA Warning |
Any DSAR open > 21 days |
Warning |
DSAR team |
| DSAR SLA Breach |
Any DSAR open > 28 days |
Critical |
CPO + Legal |
| Breach Detected |
New breach record created |
Critical |
Incident team + CPO |
| Training Compliance Drop |
Department completion < 90% |
Warning |
HR + Privacy |
| Consent Rate Anomaly |
Opt-in rate drops > 20% in a week |
Warning |
Privacy + Marketing |
| DPIA Overdue |
DPIA review past scheduled date |
Warning |
DPIA owner + CPO |
| Vendor Assessment Due |
High-risk vendor assessment > 11 months old |
Warning |
Procurement + Privacy |
Executive Reporting Template
Monthly Privacy Board Report Structure
- Privacy Health Score: Overall score with trend arrow
- Key Highlights: 3-5 bullet points on notable events
- DSAR Performance: Volume, on-time rate, top request types
- Breach Status: Count, severity, response times, lessons learned
- Compliance Posture: DPIA coverage, training rates, policy updates
- Risk Outlook: Emerging risks, regulatory developments, planned changes
- Resource Needs: Budget requests, headcount, tooling
References
- IAPP Privacy Program Management Guide (CIPM Body of Knowledge)
- NIST Privacy Framework — GV.MT Monitoring and Review
- ISO/IEC 27701:2019 — Clause 9 (Performance Evaluation)
- EDPB Guidelines on Data Breach Notification (WP250 rev.01)
- Gartner Privacy Program Metrics Framework
- ISACA Privacy Audit and Assurance Program
1---2name: privacy-metrics-dashboard3description: Build privacy KPI dashboards tracking DSAR volume and response time, breach count and severity, DPIA completion rate, training coverage, and consent rates. Includes metric definitions, data collection patterns, visualization designs, and executive reporting templates for privacy program measurement.4license: Apache-2.05---6# Privacy Metrics Dashboard
7
8## Overview
9
10A privacy metrics dashboard provides quantitative visibility into the effectiveness and maturity of an organization's privacy program. This skill defines the key privacy performance indicators (KPIs), data collection methods, visualization patterns, and reporting cadences needed to measure, monitor, and continuously improve privacy operations.
11
12## Core Privacy KPI Categories
13
14### 1. Data Subject Access Requests (DSARs)
15
16| Metric | Definition | Target | Frequency |
17|--------|-----------|--------|-----------|
18| DSAR Volume | Total DSARs received per period | Trend monitoring | Monthly |
19| DSAR by Type | Breakdown by right exercised (access, deletion, portability, rectification) | N/A (distribution) | Monthly |
20| Average Response Time | Mean calendar days from receipt to completion | < 25 days (GDPR: 30 day limit) | Monthly |
21| Median Response Time | Median calendar days from receipt to completion | < 20 days | Monthly |
22| P95 Response Time | 95th percentile response time | < 28 days | Monthly |
23| On-Time Completion Rate | % completed within regulatory deadline | > 98% | Monthly |
24| DSAR Backlog | Open DSARs at period end | < 10% of monthly volume | Weekly |
25| Automated Fulfillment Rate | % of DSARs fulfilled without manual intervention | > 60% | Quarterly |
26| Identity Verification Failure Rate | % of DSARs where identity could not be verified | < 5% | Monthly |
27| Cost per DSAR | Average cost to process one DSAR | Trend reduction | Quarterly |
28
29### 2. Data Breaches
30
31| Metric | Definition | Target | Frequency |
32|--------|-----------|--------|-----------|
33| Breach Count | Total confirmed breaches per period | 0 (minimize) | Monthly |
34| Breach Severity Distribution | Count by severity level (low/medium/high/critical) | No critical breaches | Monthly |
35| Mean Time to Detect (MTTD) | Average hours from breach occurrence to detection | < 24 hours | Per incident |
36| Mean Time to Notify (MTTN) | Average hours from detection to regulatory notification | < 48 hours (GDPR: 72 hours) | Per incident |
37| Mean Time to Contain (MTTC) | Average hours from detection to containment | < 12 hours | Per incident |
38| Records Affected | Total data subject records affected | Minimize | Per incident |
39| Repeat Breach Rate | % of breaches with same root cause as prior breach | 0% | Quarterly |
40| Regulatory Fines | Total fines imposed due to breaches | $0 | Annual |
41| Breach Simulation Score | Score from most recent tabletop exercise | > 85% | Semi-annual |
42
43### 3. Privacy Impact Assessments (DPIAs)
44
45| Metric | Definition | Target | Frequency |
46|--------|-----------|--------|-----------|
47| DPIA Completion Rate | % of high-risk processing with completed DPIA | 100% | Quarterly |
48| DPIA Backlog | DPIAs required but not yet started | 0 | Monthly |
49| Average DPIA Duration | Mean days from initiation to sign-off | < 30 days | Quarterly |
50| DPIA Findings Remediated | % of identified risks with implemented mitigations | > 90% | Quarterly |
51| DPIA Review Rate | % of existing DPIAs reviewed within their review cycle | > 95% | Quarterly |
52| New Processing Without DPIA | Count of new high-risk processing launched without DPIA | 0 | Monthly |
53
54### 4. Training and Awareness
55
56| Metric | Definition | Target | Frequency |
57|--------|-----------|--------|-----------|
58| Training Completion Rate | % of staff who completed required privacy training | > 95% | Quarterly |
59| Training Pass Rate | % passing the assessment on first attempt | > 85% | Quarterly |
60| New Hire Training Time | Average days from start date to training completion | < 14 days | Monthly |
61| Specialist Certification Rate | % of privacy team with professional certification | > 80% | Annual |
62| Privacy Champion Coverage | % of business units with designated privacy champion | 100% | Quarterly |
63| Phishing Simulation Pass Rate | % of staff correctly identifying privacy-related phishing | > 90% | Quarterly |
64
65### 5. Consent Management
66
67| Metric | Definition | Target | Frequency |
68|--------|-----------|--------|-----------|
69| Consent Rate | % of users providing consent (by purpose) | Trend monitoring | Monthly |
70| Opt-in Rate | % choosing to opt in to optional processing | Trend monitoring | Monthly |
71| Opt-out/Withdrawal Rate | % withdrawing previously given consent | < 5% monthly | Monthly |
72| Consent Freshness | % of active consents collected within last 12 months | > 70% | Quarterly |
73| Consent Collection Coverage | % of data processing with documented consent/legal basis | 100% | Quarterly |
74| Cookie Consent Rate | % of website visitors accepting cookies (by category) | Trend monitoring | Monthly |
75| Consent Record Accuracy | % of consent records matching actual processing | > 99% | Quarterly |
76
77### 6. Operational Metrics
78
79| Metric | Definition | Target | Frequency |
80|--------|-----------|--------|-----------|
81| Privacy Incidents Reported | Internal privacy incidents reported (not just breaches) | Trend monitoring | Monthly |
82| Vendor Privacy Assessments Completed | % of high-risk vendors assessed | 100% | Quarterly |
83| Data Inventory Completeness | % of processing activities documented in ROPA | > 95% | Quarterly |
84| Policy Acknowledgment Rate | % of staff acknowledging updated privacy policies | > 98% | Per update |
85| Privacy-by-Design Gate Pass Rate | % of projects passing privacy review at design gate | > 85% | Quarterly |
86| Regulatory Inquiry Response Time | Average days to respond to regulatory inquiries | < 5 days | Per event |
87
88## Data Collection Architecture
89
90```
91Data Sources Collection Layer Dashboard Layer
92+------------------+
93| DSAR Platform |---+
94+------------------+ |
95 | +-------------------+ +-----------------------+
96+------------------+ +--->| | | |
97| Breach Tracker |------->| Data Integration |--->| Visualization Engine |
98+------------------+ +--->| (ETL Pipeline) | | (Grafana / Tableau / |
99 | | | | Power BI / Metabase) |
100+------------------+ | +-------------------+ +-----------------------+
101| DPIA Register |---+ | |
102+------------------+ | v v
103 | +-------------------+ +-----------------------+
104+------------------+ | | Metrics Database | | Alerting System |
105| LMS (Training) |---+ | (Time-series / | | - Threshold breaches |
106+------------------+ | | PostgreSQL) | | - Trend deviations |
107 | +-------------------+ | - SLA warnings |
108+------------------+ | +-----------------------+
109| Consent Platform |---+
110+------------------+
111```
112
113## Metric Collection Implementation
114
115```python
116"""
117Privacy metrics collection and aggregation engine.
118Collects KPI data from multiple privacy operational systems
119and computes dashboard-ready metrics.
120"""
121
122from dataclasses import dataclass
123from datetime import datetime, timedelta
124from typing import Optional
125import statistics
126
127
128@dataclass
129class DSARMetrics:
130 period_start: datetime
131 period_end: datetime
132 total_received: int
133 total_completed: int
134 total_overdue: int
135 avg_response_days: float
136 median_response_days: float
137 p95_response_days: float
138 on_time_rate: float
139 by_type: dict[str, int]
140 backlog: int
141 automated_rate: float
142
143
144@dataclass
145class BreachMetrics:
146 period_start: datetime
147 period_end: datetime
148 total_breaches: int
149 by_severity: dict[str, int]
150 avg_detection_hours: float
151 avg_notification_hours: float
152 avg_containment_hours: float
153 total_records_affected: int
154 repeat_breach_count: int
155
156
157@dataclass
158class ConsentMetrics:
159 period_start: datetime
160 period_end: datetime
161 total_consent_events: int
162 opt_in_rate: float
163 withdrawal_rate: float
164 consent_rate_by_purpose: dict[str, float]
165 cookie_acceptance_rate: float
166 consent_freshness_pct: float
167
168
169class PrivacyMetricsCollector:
170 """
171 Collect and compute privacy KPIs from operational data sources.
172 """
173
174 def __init__(self, dsar_repo, breach_repo, dpia_repo, training_repo, consent_repo):
175 self.dsar_repo = dsar_repo
176 self.breach_repo = breach_repo
177 self.dpia_repo = dpia_repo
178 self.training_repo = training_repo
179 self.consent_repo = consent_repo
180
181 def compute_dsar_metrics(
182 self,
183 start_date: datetime,
184 end_date: datetime,
185 regulatory_deadline_days: int = 30
186 ) -> DSARMetrics:
187 """Compute DSAR KPIs for a given period."""
188 dsars = self.dsar_repo.get_by_period(start_date, end_date)
189
190 completed = [d for d in dsars if d.status == "completed"]
191 response_times = [
192 (d.completed_at - d.received_at).days
193 for d in completed
194 if d.completed_at and d.received_at
195 ]
196
197 on_time = [
198 d for d in completed
199 if (d.completed_at - d.received_at).days <= regulatory_deadline_days
200 ]
201
202 automated = [d for d in completed if d.automated]
203 open_dsars = [d for d in dsars if d.status in ("open", "in_progress")]
204
205 by_type = {}
206 for d in dsars:
207 by_type[d.request_type] = by_type.get(d.request_type, 0) + 1
208
209 return DSARMetrics(
210 period_start=start_date,
211 period_end=end_date,
212 total_received=len(dsars),
213 total_completed=len(completed),
214 total_overdue=len(dsars) - len(on_time) - len(open_dsars),
215 avg_response_days=statistics.mean(response_times) if response_times else 0,
216 median_response_days=statistics.median(response_times) if response_times else 0,
217 p95_response_days=(
218 sorted(response_times)[int(len(response_times) * 0.95)]
219 if len(response_times) >= 20 else
220 max(response_times) if response_times else 0
221 ),
222 on_time_rate=len(on_time) / len(completed) if completed else 1.0,
223 by_type=by_type,
224 backlog=len(open_dsars),
225 automated_rate=len(automated) / len(completed) if completed else 0,
226 )
227
228 def compute_breach_metrics(
229 self,
230 start_date: datetime,
231 end_date: datetime
232 ) -> BreachMetrics:
233 """Compute breach KPIs for a given period."""
234 breaches = self.breach_repo.get_by_period(start_date, end_date)
235
236 by_severity = {}
237 detection_hours = []
238 notification_hours = []
239 containment_hours = []
240 total_records = 0
241
242 for b in breaches:
243 by_severity[b.severity] = by_severity.get(b.severity, 0) + 1
244 total_records += b.records_affected or 0
245
246 if b.detected_at and b.occurred_at:
247 detection_hours.append(
248 (b.detected_at - b.occurred_at).total_seconds() / 3600
249 )
250 if b.notified_at and b.detected_at:
251 notification_hours.append(
252 (b.notified_at - b.detected_at).total_seconds() / 3600
253 )
254 if b.contained_at and b.detected_at:
255 containment_hours.append(
256 (b.contained_at - b.detected_at).total_seconds() / 3600
257 )
258
259 # Count repeat breaches (same root cause as previous)
260 root_causes = [b.root_cause for b in breaches if b.root_cause]
261 repeat_count = len(root_causes) - len(set(root_causes))
262
263 return BreachMetrics(
264 period_start=start_date,
265 period_end=end_date,
266 total_breaches=len(breaches),
267 by_severity=by_severity,
268 avg_detection_hours=statistics.mean(detection_hours) if detection_hours else 0,
269 avg_notification_hours=statistics.mean(notification_hours) if notification_hours else 0,
270 avg_containment_hours=statistics.mean(containment_hours) if containment_hours else 0,
271 total_records_affected=total_records,
272 repeat_breach_count=repeat_count,
273 )
274
275 def generate_executive_report(
276 self,
277 period_start: datetime,
278 period_end: datetime
279 ) -> dict:
280 """
281 Generate a comprehensive executive privacy report.
282 Combines all KPI categories into a single report structure.
283 """
284 dsar = self.compute_dsar_metrics(period_start, period_end)
285 breach = self.compute_breach_metrics(period_start, period_end)
286
287 # Calculate overall privacy health score (0-100)
288 health_components = []
289
290 # DSAR component (25% weight)
291 dsar_score = min(100, dsar.on_time_rate * 100)
292 health_components.append(("DSAR Compliance", dsar_score, 0.25))
293
294 # Breach component (30% weight)
295 breach_score = 100 if breach.total_breaches == 0 else max(0, 100 - breach.total_breaches * 20)
296 health_components.append(("Breach Prevention", breach_score, 0.30))
297
298 # Response time component (20% weight)
299 response_score = min(100, max(0, (30 - dsar.avg_response_days) / 30 * 100))
300 health_components.append(("Response Timeliness", response_score, 0.20))
301
302 # Detection speed component (25% weight)
303 detection_score = min(100, max(0, (72 - breach.avg_detection_hours) / 72 * 100)) if breach.total_breaches > 0 else 100
304 health_components.append(("Detection Speed", detection_score, 0.25))
305
306 overall_score = sum(score * weight for _, score, weight in health_components)
307
308 return {
309 "period": {
310 "start": period_start.isoformat(),
311 "end": period_end.isoformat()
312 },
313 "overall_privacy_health_score": round(overall_score, 1),
314 "health_rating": (
315 "Excellent" if overall_score >= 90 else
316 "Good" if overall_score >= 75 else
317 "Needs Improvement" if overall_score >= 60 else
318 "Critical"
319 ),
320 "components": {
321 name: {"score": round(score, 1), "weight": f"{weight*100:.0f}%"}
322 for name, score, weight in health_components
323 },
324 "dsar_summary": {
325 "volume": dsar.total_received,
326 "on_time_rate": f"{dsar.on_time_rate*100:.1f}%",
327 "avg_response_days": round(dsar.avg_response_days, 1),
328 "backlog": dsar.backlog
329 },
330 "breach_summary": {
331 "count": breach.total_breaches,
332 "severity_distribution": breach.by_severity,
333 "avg_detection_hours": round(breach.avg_detection_hours, 1),
334 "records_affected": breach.total_records_affected
335 },
336 }
337```
338
339## Dashboard Visualization Patterns
340
341### Executive Summary View
342
343| Panel | Chart Type | Metrics Displayed | Refresh Rate |
344|-------|-----------|-------------------|-------------|
345| Privacy Health Score | Gauge (0-100) | Overall weighted score | Daily |
346| DSAR Volume Trend | Line chart | Monthly DSAR count (12-month rolling) | Daily |
347| Breach Timeline | Event timeline | Breaches by severity over time | Real-time |
348| On-Time Rate | Single stat with spark line | DSAR on-time completion % | Daily |
349| Training Coverage | Horizontal bar | Completion rate by department | Weekly |
350| Consent Rate Trend | Multi-line chart | Opt-in rate by purpose (6-month) | Daily |
351
352### Operational View
353
354| Panel | Chart Type | Metrics Displayed | Refresh Rate |
355|-------|-----------|-------------------|-------------|
356| Active DSARs | Table with status | Open requests with deadlines | Hourly |
357| DSAR Aging | Histogram | Distribution of open DSAR ages | Daily |
358| Response Time Box Plot | Box plot | Response time distribution by month | Daily |
359| Breach Detection Funnel | Funnel chart | Detection > Assessment > Notification > Resolution | Per event |
360| DPIA Pipeline | Kanban | DPIAs by status (draft, review, approved) | Daily |
361| Vendor Risk Heat Map | Heat map | Vendors by risk score and last assessment date | Weekly |
362
363## Alerting Rules
364
365| Alert | Condition | Severity | Recipient |
366|-------|-----------|----------|-----------|
367| DSAR SLA Warning | Any DSAR open > 21 days | Warning | DSAR team |
368| DSAR SLA Breach | Any DSAR open > 28 days | Critical | CPO + Legal |
369| Breach Detected | New breach record created | Critical | Incident team + CPO |
370| Training Compliance Drop | Department completion < 90% | Warning | HR + Privacy |
371| Consent Rate Anomaly | Opt-in rate drops > 20% in a week | Warning | Privacy + Marketing |
372| DPIA Overdue | DPIA review past scheduled date | Warning | DPIA owner + CPO |
373| Vendor Assessment Due | High-risk vendor assessment > 11 months old | Warning | Procurement + Privacy |
374
375## Executive Reporting Template
376
377### Monthly Privacy Board Report Structure
378
3791. **Privacy Health Score**: Overall score with trend arrow
3802. **Key Highlights**: 3-5 bullet points on notable events
3813. **DSAR Performance**: Volume, on-time rate, top request types
3824. **Breach Status**: Count, severity, response times, lessons learned
3835. **Compliance Posture**: DPIA coverage, training rates, policy updates
3846. **Risk Outlook**: Emerging risks, regulatory developments, planned changes
3857. **Resource Needs**: Budget requests, headcount, tooling
386
387## References
388
389- IAPP Privacy Program Management Guide (CIPM Body of Knowledge)
390- NIST Privacy Framework — GV.MT Monitoring and Review
391- ISO/IEC 27701:2019 — Clause 9 (Performance Evaluation)
392- EDPB Guidelines on Data Breach Notification (WP250 rev.01)
393- Gartner Privacy Program Metrics Framework
394- ISACA Privacy Audit and Assurance Program