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