mcpField
I
implementing-gdpr-data-subject-access-request

implementing-gdpr-data-subject-access-request

github.com/mukul975セキュリティ35.2k65 回インストール8 週間前に更新
リポジトリ

implementing-gdpr-data-subject-access-request について

プライバシー・コンプライアンスチーム向けの、GDPR データ主体アクセス要求(DSAR)ワークフローガイドです。受付、個人データの発見、適用除外の確認、回答の作成、監査記録を扱います。

主な機能

  1. 01要求の登録と本人確認
  2. 02複数データソースでの個人データ発見
  3. 03Article 15 の項目へのデータ分類
  4. 04適用除外の確認
  5. 05回答パッケージの生成
  6. 06監査記録の保持

活用シーン

  1. 01DSAR ワークフローの自動化
  2. 02データベース、ファイル、ログでの個人データ検索
  3. 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 と一緒にインストールされる参考資料やスクリプト。

LICENSE
references/
api-reference.md
scripts/
agent.py

詳細

GDPR データ主体アクセス請求(DSAR)ワークフローの実装

使用する場面

  • GDPR/UK GDPR に準拠した DSAR 処理パイプラインを自動化する場合
  • 構造化データソースと非構造化データソース全体で PII を検出する場合
  • 第 15 条の開示要件を満たす回答テンプレートを作成する場合
  • 既存の DSAR 対応を監査し、規制遵守上の不備を確認する場合
  • DSAR 処理を手作業から自動化されたワークフローへ拡張する場合

前提条件

  • 必要な依存関係(spacy、presidio-analyzer、jinja2)を含む Python 3.8 以降
  • 個人データが保存されているデータソース(データベース、ファイル共有、ログ)へのアクセス
  • GDPR 第 15 条の要件と ICO/EDPB のガイダンスに関する理解
  • 適切な権限とデータ保護責任者(DPO)の承認
  • 検証用の合成データまたは匿名化データを使えるテスト環境

背景

GDPR 第 15 条 — アクセス権

GDPR 第 15 条に基づき、データ主体は管理者から以下を取得する権利を有します。

  1. 個人データが処理されていることの確認
  2. 自身について保有されているすべての個人データのコピー
  3. 以下を含む補足情報:
    • 処理の目的
    • 個人データの種類
    • 受領者または受領者の種類
    • 保存期間、または保存期間を決定する基準
    • 訂正、消去、処理の制限、または異議申し立てを求める権利
    • 監督機関に苦情を申し立てる権利
    • データの取得元(データ主体から直接収集した場合を除く)
    • プロファイリングを含む、自動化された意思決定の有無
期限要件
  • 標準期限:有効な請求を受領してから暦月で 1 か月
  • 複雑な請求の延長:さらに最大 2 か月(最初の 1 か月以内に通知が必要)
  • 期限の一時停止:本人確認または確認事項が必要な場合に認められます
  • 形式:電子的に請求された場合は電子形式(別途要望がある場合を除く)
  • 費用:無料(請求に明らかな根拠がない、または過度な場合を除く)
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']})")

参考資料

コメント