关于 implementing-gdpr-data-subject-access-request
面向隐私与合规团队的 GDPR 数据主体访问请求(DSAR)处理工作流指南。它涵盖请求受理、个人数据发现、豁免审查、回复生成和审计记录。
主要功能
- 01请求登记与身份验证
- 02跨数据源发现个人信息
- 03映射 Article 15 数据
- 04审查适用豁免
- 05生成回复材料
- 06记录处理审计轨迹
适用场景
- 01构建自动化 DSAR 流程
- 02在数据库、文件和日志中查找个人数据
- 03审计现有访问请求处理流程
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ mukul975/ anthropic-cybersecurity-skills --skill implementing-gdpr-data-subject-access-request安装后在 Claude Code 中输入/implementing-gdpr-data-subject-access-request确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
LICENSEreferences/api-reference.mdscripts/agent.py详细介绍
实施 GDPR 数据主体访问请求(DSAR)工作流
适用场景
- 为满足 GDPR/UK GDPR 合规要求而构建自动化 DSAR 处理流水线时
- 在结构化与非结构化数据源中实施 PII 发现时
- 创建满足第 15 条披露要求的回复模板时
- 审计现有 DSAR 处理流程以查找监管合规缺口时
- 将 DSAR 处理从手动扩展为自动化工作流时
前置条件
- Python 3.8+ 及所需依赖(spacy、presidio-analyzer、jinja2)
- 对存储个人数据的数据源的访问权限(数据库、文件共享、日志)
- 了解 GDPR 第 15 条要求以及 ICO/EDPB 指南
- 适当的授权和数据保护官(DPO)批准
- 用于验证的、包含合成数据或匿名化数据的测试环境
背景
GDPR 第 15 条 - 访问权
根据 GDPR 第 15 条,数据主体有权从控制者处获得:
- 确认其个人数据正在被处理
- 所持有的关于其本人的全部个人数据的副本
- 补充信息,包括:
- 处理目的
- 个人数据的类别
- 接收方或接收方类别
- 保留期限或确定保留期限的标准
- 更正、删除、限制处理或反对的权利
- 向监管机构提出投诉的权利
- 数据来源(若非直接向数据主体收集)
- 是否存在自动化决策,包括画像
时限要求
- 标准期限:自收到有效请求起 1 个日历月
- 复杂情况延期:最多可再延长 2 个月(必须在第一个月内通知)
- 计时暂停:在需要身份验证或澄清时允许暂停
- 格式:若请求以电子方式提出,则以电子形式提供(除非另有要求)
- 费用:免费(除非明显无根据或过度)
ICO/EDPB 指南要点
- DSAR 无需正式格式 - 口头、书面、社交媒体均有效
- 请求无需提及"数据主体访问请求"或引用第 15 条
- 身份验证必须与风险相称
- 对法律特权、第三方数据、商业秘密存在豁免
- EDPB 协调执法行动涵盖访问权合规
操作说明
步骤 1:DSAR 接收与验证
实施一个请求接收系统,通过任何渠道捕获请求、 验证请求者身份并启动合规计时。
from agent import DSARWorkflowEngine
engine = DSARWorkflowEngine(config_path="dsar_config.json")
# Register a new DSAR
request = engine.register_dsar(
requester_name="Jane Smith",
requester_email="[email protected]",
request_channel="email",
request_text="I would like a copy of all personal data you hold about me.",
identity_docs=["passport_verified"],
)
print(f"DSAR ID: {request['dsar_id']}, Deadline: {request['deadline']}")
步骤 2:跨数据源的 PII 发现
使用正则表达式模式和 NER 扫描数据库、文件和日志,以查找与 该数据主体关联的所有个人数据。
from agent import PIIDiscoveryEngine
pii_engine = PIIDiscoveryEngine()
# Scan structured data (database)
db_results = pii_engine.scan_database(
connection_string="postgresql://user:pass@localhost/appdb",
search_identifiers={"email": "[email protected]", "name": "Jane Smith"},
)
# Scan unstructured data (files, logs)
file_results = pii_engine.scan_files(
directories=["/var/log/app", "/data/exports", "/data/documents"],
search_identifiers={"email": "[email protected]", "name": "Jane Smith"},
)
# Scan with NER for contextual PII detection
ner_results = pii_engine.scan_with_ner(
text_corpus=file_results["raw_text_matches"],
entity_types=["PERSON", "EMAIL", "PHONE_NUMBER", "LOCATION", "DATE_OF_BIRTH"],
)
all_pii = pii_engine.consolidate_results(db_results, file_results, ner_results)
print(f"Found {all_pii['total_records']} PII records across {all_pii['source_count']} sources")
步骤 3:数据映射与分类
按照第 15 条的要求,将发现的 PII 映射到处理目的、法律依据和 保留期限。
from agent import DataMapper
mapper = DataMapper(data_inventory_path="data_inventory.json")
# Map PII to Article 15 categories
mapped_data = mapper.map_to_article15(
pii_records=all_pii,
data_subject_id="[email protected]",
)
# Output includes processing purposes, recipients, retention for each data category
for category in mapped_data["categories"]:
print(f"Category: {category['name']}")
print(f" Purpose: {category['processing_purpose']}")
print(f" Legal basis: {category['legal_basis']}")
print(f" Retention: {category['retention_period']}")
print(f" Recipients: {', '.join(category['recipients'])}")
步骤 4:豁免审查
在汇编回复之前,在合法的情况下应用豁免(第三方数据、法律特权、 商业秘密)。
from agent import ExemptionReviewer
reviewer = ExemptionReviewer()
# Check for applicable exemptions
review_result = reviewer.review_exemptions(
mapped_data=mapped_data,
exemption_checks=[
"third_party_data",
"legal_professional_privilege",
"trade_secrets",
"crime_prevention",
"management_forecasting",
],
)
# Apply redactions where exemptions apply
redacted_data = reviewer.apply_redactions(mapped_data, review_result["exemptions"])
print(f"Applied {review_result['exemption_count']} exemptions")
步骤 5:回复生成
生成合规的 DSAR 回复包,包括封面信、数据导出和 补充信息文档。
from agent import DSARResponseGenerator
generator = DSARResponseGenerator(template_dir="templates/")
# Generate complete response package
response = generator.generate_response(
dsar_id=request["dsar_id"],
data_subject="Jane Smith",
mapped_data=redacted_data,
format="pdf", # or "json", "csv"
)
# Package includes: cover letter, data export, supplementary info, audit log
for doc in response["documents"]:
print(f"Generated: {doc['filename']} ({doc['type']})")
步骤 6:审计追踪与合规日志
维护 DSAR 生命周期的完整审计追踪以实现问责。
from agent import DSARAuditLogger
logger = DSARAuditLogger(log_path="dsar_audit_logs/")
# Log complete DSAR lifecycle
logger.log_event(request["dsar_id"], "request_received", {
"channel": "email",
"identity_verified": True,
})
logger.log_event(request["dsar_id"], "pii_discovery_complete", {
"records_found": all_pii["total_records"],
"sources_scanned": all_pii["source_count"],
})
logger.log_event(request["dsar_id"], "response_sent", {
"format": "pdf",
"documents_count": len(response["documents"]),
"exemptions_applied": review_result["exemption_count"],
})
# Generate compliance report
compliance_report = logger.generate_compliance_report(request["dsar_id"])
示例
完整的 DSAR 处理流水线
from agent import DSARWorkflowEngine, PIIDiscoveryEngine, DSARResponseGenerator
# Full automated pipeline
engine = DSARWorkflowEngine(config_path="dsar_config.json")
pii = PIIDiscoveryEngine()
gen = DSARResponseGenerator(template_dir="templates/")
# 1. Intake
req = engine.register_dsar(
requester_name="John Doe",
requester_email="[email protected]",
request_channel="web_form",
request_text="Please provide all my data under GDPR Article 15.",
identity_docs=["email_verified", "account_match"],
)
# 2. Discover
results = pii.full_scan(
search_identifiers={"email": "[email protected]"},
sources=["database", "files", "logs"],
)
# 3. Generate response
response = gen.generate_response(
dsar_id=req["dsar_id"],
data_subject="John Doe",
mapped_data=results,
)
# 4. Track deadline
engine.update_status(req["dsar_id"], "response_sent")
print(f"DSAR {req['dsar_id']} completed, {engine.days_remaining(req['dsar_id'])} days remaining")
PII 正则表达式模式测试
from agent import PIIPatternMatcher
matcher = PIIPatternMatcher()
# Test individual patterns
test_text = "Contact [email protected] or call +44 20 7946 0958. SSN: 123-45-6789"
matches = matcher.scan_text(test_text)
for m in matches:
print(f" [{m['type']}] '{m['value']}' (confidence: {m['confidence']})")
参考资料
- GDPR 第 15 条:https://gdpr-info.eu/art-15-gdpr/
- ICO 主体访问请求指南:https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/subject-access-requests/
- EDPB 关于访问权的 01/2022 号指南:https://www.edpb.europa.eu/system/files/2023-04/edpb_guidelines_202201_data_subject_rights_access_v2_en.pdf
- GDPR 第 12 条(DSAR 方式):https://gdpr-info.eu/art-12-gdpr/
- 第 (EU) 2025/2518 号条例(程序规则):跨境 GDPR 执法程序规则
评论
支持 Markdown