data-privacy-compliance について
data-privacy-compliance は、GDPR、CCPA、HIPAA などに沿ったプライバシー対策を進めるチーム向けのガイダンスです。データ主体の請求、同意管理、影響評価、プライバシー・バイ・デザイン、漏えい対応を扱います。
主な機能
- 01GDPR、CCPA、HIPAA のガイダンス
- 02データ主体の権利対応フロー
- 03同意管理のパターン
- 04DPIA の計画
- 05プライバシー・バイ・デザイン
- 06データ漏えい対応のガイダンス
活用シーン
- 01プライバシー遵守プロセスの整備
- 02アクセス・削除請求への対応
- 03同意や Cookie 制御の設計
- 04データ漏えい対応の計画
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill data-privacy-complianceインストール後、Claude Code で/data-privacy-complianceを入力して読み込まれたか確認します。
詳細
データプライバシーコンプライアンス
GDPR、CCPA、HIPAA、その他の世界的なデータ保護規制に対応するためのデータプライバシーコンプライアンスの実装に関する包括的なガイダンスです。
このスキルを使用するタイミング
次のような場合にこのスキルを使用してください。
- GDPR、CCPA、または HIPAA のコンプライアンスを実装する場合
- データprotection影響評価(DPIA)を実施する場合
- データ主体の権利(アクセス、削除、ポータビリティ)を管理する場合
- 同意管理システムを実装する場合
- プライバシーポリシーと通知を作成する場合
- データ侵害とインシデント対応を処理する場合
- プライバシー・バイ・デザインのシステムを設計する場合
- プライバシー監査と評価を実施する場合
主要な規制の概要
GDPR(一般データ保護規則)
適用範囲: 企業の所在地に関係なく、EU 居住者のデータ 主な要件:
- 処理の適法な根拠(同意、契約、正当な利益など)
- データ主体の権利(アクセス、削除、ポータビリティ、異議申し立て)
- 高リスクの処理に対するデータprotection影響評価
- 72時間以内の侵害通知要件
- 処理活動の記録
- 設計によるプライバシーおよびデフォルトによるプライバシー
罰則: 最大 2,000 万ユーロまたは全世界の年間売上高の 4%
CCPA/CPRA(カリフォルニア州消費者プライバシー法)
適用範囲: カリフォルニア州居住者のデータ 主な要件:
- 収集されているデータを知る権利
- 個人情報を削除する権利
- 販売・共有へのオプトアウトの権利
- 不正確な情報を訂正する権利
- 機微な個人情報の利用を制限する権利
罰則: 故意の違反 1 件につき最大 7,500 ドル
HIPAA(医療保険の相互運用性と説明責任に関する法律)
適用範囲: 米国における保護対象保健情報(PHI) 主な要件:
- プライバシールール(患者の権利と情報の利用)
- セキュリティルール(ePHI の保護措置)
- 侵害通知ルール(60 日以内の通知)
- ビジネスアソシエイト契約(BAA)
罰則: 違反の類型ごと、年間最大 150 万ドル
データ主体の権利の実装
1. アクセス権(GDPR 第 15 条 / CCPA § 1798.100)
リクエストハンドラー:
async function handleAccessRequest(userId, email) {
// Verify identity
const verified = await verifyIdentity(email);
if (!verified) throw new Error('Identity verification failed');
// Collect all personal data
const userData = await collectUserData(userId);
// Format for readability
const report = {
personalInfo: userData.profile,
activityLogs: userData.activities,
preferences: userData.settings,
thirdPartySharing: userData.dataSharing,
retentionPeriod: '2 years from last activity',
dataProtectionOfficer: '[email protected]'
};
// Generate downloadable report
const pdf = await generatePDFReport(report);
// Log request for compliance
await logAccessRequest(userId, 'completed');
return pdf;
}
対応期限:
- GDPR: 1 か月(最大 3 か月まで延長可能)
- CCPA: 45 日(最大 90 日まで延長可能)
2. 削除権(GDPR 第 17 条 / CCPA § 1798.105)
削除ハンドラー:
async function handleDeletionRequest(userId, email) {
// Verify identity
const verified = await verifyIdentity(email);
if (!verified) throw new Error('Identity verification failed');
// Check for legal obligations to retain
const mustRetain = await checkRetentionRequirements(userId);
if (mustRetain.required) {
return {
status: 'partial_deletion',
retained: mustRetain.data,
reason: mustRetain.legalBasis,
retentionPeriod: mustRetain.period
};
}
// Delete from all systems
await Promise.all([
deleteFromDatabase(userId),
deleteFromBackups(userId), // Mark for deletion in next backup cycle
deleteFromAnalytics(userId),
deleteFromThirdPartyServices(userId),
revokeAPIKeys(userId),
anonymizeHistoricalRecords(userId)
]);
// Confirm deletion
await sendDeletionConfirmation(email);
await logDeletionRequest(userId, 'completed');
return { status: 'deleted', timestamp: new Date() };
}
例外(削除を拒否できる場合):
- 法的義務(税務記録、契約など)
- 公益・科学研究
- 法的請求の防御
- 表現の自由の行使
3. データポータビリティの権利(GDPR 第 20 条)
エクスポートハンドラー:
async function handlePortabilityRequest(userId, format = 'json') {
const userData = await collectUserData(userId);
// Structure in machine-readable format
const portableData = {
exportDate: new Date().toISOString(),
userId: userId,
data: {
profile: userData.profile,
content: userData.userGeneratedContent,
settings: userData.preferences,
history: userData.activityHistory
}
};
// Support multiple formats
if (format === 'csv') {
return convertToCSV(portableData);
} else if (format === 'xml') {
return convertToXML(portableData);
}
return portableData; // JSON by default
}
要件:
- 構造化され、一般的に利用され、機械可読な形式
- 別の管理者へ直接送信できること
- データ主体が提供したデータにのみ適用されること
- 同意または契約に基づく自動処理の場合にのみ適用されること
4. 異議申し立て権(GDPR 第 21 条)
異議申し立てハンドラー:
async function handleObjectionRequest(userId, processingType) {
switch (processingType) {
case 'direct_marketing':
// Must stop immediately
await disableMarketing(userId);
await updateConsent(userId, 'marketing', false);
break;
case 'legitimate_interest':
// Assess if we have compelling grounds
const assessment = await assessLegitimateInterest(userId);
if (!assessment.compelling) {
await stopProcessing(userId, processingType);
}
return assessment;
case 'profiling':
await disableProfiling(userId);
await updateConsent(userId, 'profiling', false);
break;
default:
throw new Error('Invalid processing type');
}
await logObjectionRequest(userId, processingType, 'granted');
}
同意管理
同意の要件(GDPR)
有効な同意は次を満たす必要があります:
- 自由に与えられること(強制がないこと)
- 特定されていること(目的ごと)
- 説明を受けた上でのものであること(明確な言葉で)
- 曖昧でないこと(明確な肯定的行為)
- 撤回可能であること(与えるのと同じくらい容易に撤回できること)
同意の実装:
<form>
<h3>Privacy Preferences</h3>
<label>
<input type="checkbox" name="essential" checked disabled>
<strong>Essential cookies (Required)</strong>
<p>Necessary for website functionality</p>
</label>
<label>
<input type="checkbox" name="analytics" value="analytics">
<strong>Analytics cookies</strong>
<p>Help us improve our website by collecting usage data</p>
</label>
<label>
<input type="checkbox" name="marketing" value="marketing">
<strong>Marketing cookies</strong>
<p>Show you personalized ads based on your interests</p>
</label>
<button type="submit">Save Preferences</button>
<a href="/privacy-policy">Learn More</a>
</form>
同意記録の保存:
const consentRecord = {
userId: 'user123',
timestamp: new Date().toISOString(),
consentVersion: '2.0',
purposes: {
essential: { granted: true, required: true },
analytics: { granted: true, purpose: 'Website improvement' },
marketing: { granted: false, purpose: 'Personalized advertising' }
},
ipAddress: '192.168.1.1', // For proof
userAgent: 'Mozilla/5.0...', // For context
method: 'explicit_opt_in' // or 'implicit', 'presumed'
};
await saveConsentRecord(consentRecord);
Cookie バナー(GDPR 準拠)
<div id="cookie-banner" role="dialog" aria-labelledby="cookie-title">
<h2 id="cookie-title">Cookie Preferences</h2>
<p>
We use cookies to enhance your experience. Choose which cookies you
allow us to use. You can change your preferences at any time.
</p>
<button onclick="acceptAll()">Accept All</button>
<button onclick="rejectNonEssential()">Reject Non-Essential</button>
<button onclick="showPreferences()">Manage Preferences</button>
</div>
<script>
// Must not load non-essential cookies until consent given
function acceptAll() {
setConsent({ analytics: true, marketing: true });
loadAnalyticsCookies();
loadMarketingCookies();
hideBanner();
}
function rejectNonEssential() {
setConsent({ analytics: false, marketing: false });
hideBanner();
}
</script>
プライバシー・バイ・デザインの原則
1. データ最小化
原則: 指定された目的に必要なデータのみを収集すること
実装:
// ❌ Bad: Collecting unnecessary data
const userRegistration = {
email: req.body.email,
password: req.body.password,
fullName: req.body.fullName,
phoneNumber: req.body.phoneNumber, // Not needed
dateOfBirth: req.body.dateOfBirth, // Not needed
address: req.body.address, // Not needed
socialSecurityNumber: req.body.ssn // Definitely not needed!
};
// ✅ Good: Only essential data
const userRegistration = {
email: req.body.email,
password: hashPassword(req.body.password),
displayName: req.body.displayName // Optional
};
2. 目的による制限
原則: 指定され明示された目的にのみデータを利用すること
実装:
// Document and enforce purpose
const dataProcessingPurpose = {
email: [
'account_authentication',
'order_confirmations',
'password_reset'
],
phoneNumber: [
'order_delivery_notifications'
// NOT: 'marketing_calls' (requires separate consent)
],
purchaseHistory: [
'order_fulfillment',
'customer_support'
// NOT: 'targeted_advertising' (requires separate consent)
]
};
async function processData(data, purpose) {
if (!isAllowedPurpose(data.type, purpose)) {
throw new Error('Purpose not authorized for this data');
}
// Proceed with processing
}
3. 保存期間の制限
原則: 必要な期間に限ってデータを保持すること
実装:
const retentionPolicy = {
userAccounts: {
active: 'indefinite',
inactive: '2 years',
deleted: '30 days grace period'
},
orderRecords: '7 years', // Legal requirement
supportTickets: '3 years',
analytics: '26 months',
marketingData: '1 year or until consent withdrawn'
};
// Automated data deletion
async function enforceRetentionPolicy() {
const now = new Date();
// Delete inactive accounts
await User.deleteMany({
lastActive: { $lt: subYears(now, 2) },
status: 'inactive'
});
// Anonymize old analytics
await Analytics.updateMany(
{ createdAt: { $lt: subMonths(now, 26) } },
{ $unset: { userId: 1, ipAddress: 1 } }
);
// Delete expired marketing consent
await MarketingConsent.deleteMany({
$or: [
{ expiresAt: { $lt: now } },
{ withdrawnAt: { $lt: subDays(now, 30) } }
]
});
}
// Schedule daily
cron.schedule('0 2 * * *', enforceRetentionPolicy);
データprotection影響評価(DPIA)
実施が必要な場合(GDPR 第 35 条):
- 体系的かつ広範なプロファイリング
- 機微なデータの大規模な処理
- 公的にアクセス可能な領域の体系的な監視
- 高いプライバシーリスクを伴う新技術
DPIA テンプレート:
# Data Protection Impact Assessment
## Processing Overview
- **Purpose**: [Describe the processing activity]
- **Data Types**: [Personal data categories]
- **Data Subjects**: [Who is affected]
- **Recipients**: [Who receives the data]
## Necessity Assessment
- [ ] Is processing necessary for the stated purpose?
- [ ] Could the purpose be achieved with less data?
- [ ] Is the retention period justified?
## Risk Assessment
| Risk | Likelihood | Severity | Mitigation |
|------|------------|----------|------------|
| Data breach | Medium | High | Encryption, access controls |
| Unauthorized access | Low | High | 2FA, audit logs |
| Purpose creep | Medium | Medium | Purpose documentation, training |
## Safeguards
- [ ] Encryption at rest and in transit
- [ ] Access controls and authentication
- [ ] Regular security audits
- [ ] Data minimization applied
- [ ] Retention policies enforced
- [ ] DPO consulted
- [ ] Data subject rights mechanism in place
## Conclusion
Processing is/is not acceptable with proposed safeguards.
Signed: [Data Protection Officer]
Date: [Assessment Date]
プライバシーポリシーの要件
必須要素:
# Privacy Policy
## 1. Identity of Controller
Company Name, Address, Contact Information
Data Protection Officer: [email protected]
## 2. Data We Collect
- Account data: email, name
- Usage data: pages visited, features used
- Technical data: IP address, browser type
## 3. Legal Basis for Processing
- **Consent**: Marketing communications
- **Contract**: Order fulfillment
- **Legitimate Interest**: Fraud prevention
- **Legal Obligation**: Tax records
## 4. How We Use Your Data
- Provide services you requested
- Improve our products
- Send important updates
- [Be specific, avoid vague statements]
## 5. Data Sharing
- Payment processors (Stripe, PayPal)
- Shipping providers (FedEx, UPS)
- Analytics (Google Analytics)
We do NOT sell your personal data.
## 6. Your Rights
- Right to access your data
- Right to correct inaccuracies
- Right to delete your data
- Right to object to processing
- Right to data portability
- Right to withdraw consent
Contact: [email protected]
## 7. Data Retention
- Account data: Until account deletion + 30 days
- Order history: 7 years (legal requirement)
- Marketing data: 1 year or until opt-out
## 8. Security
We use industry-standard security measures including
encryption, secure servers, and regular security audits.
## 9. International Transfers
Data may be transferred to US servers. We use Standard
Contractual Clauses approved by the EU Commission.
## 10. Changes to Policy
Last updated: [Date]
We will notify you of material changes via email.
## 11. Contact
Questions? Contact our Data Protection Officer at [email protected]
インシデント対応
データ侵害対応計画
72時間以内(GDPR):
1. **Detect & Contain** (0-4 hours)
- Identify scope of breach
- Isolate affected systems
- Prevent further data loss
2. **Assess** (4-24 hours)
- Determine data types affected
- Identify number of individuals
- Assess risk to rights and freedoms
- Document everything
3. **Notify Authority** (24-72 hours)
- Report to supervisory authority
- Include: nature, categories, approximate numbers,
likely consequences, measures taken
4. **Notify Data Subjects** (ASAP if high risk)
- Direct communication required
- Describe breach in clear language
- Provide recommendations for protection
侵害通知テンプレート:
Subject: Important Security Notice
Dear [Name],
We are writing to inform you of a data security incident that may
have affected your personal information.
WHAT HAPPENED:
On [date], we discovered that [brief description].
WHAT INFORMATION WAS INVOLVED:
[List specific data types: name, email, etc.]
[List what was NOT involved]
WHAT WE ARE DOING:
- [Immediate actions taken]
- [Ongoing security enhancements]
- [Resources provided to affected individuals]
WHAT YOU CAN DO:
- Change your password immediately
- Monitor your accounts for suspicious activity
- [Specific recommendations]
FOR MORE INFORMATION:
Contact our dedicated hotline: [phone]
Email: [email protected]
We sincerely apologize for this incident and the inconvenience
it may cause.
Sincerely,
[Name, Title]
コンプライアンスチェックリスト
GDPR コンプライアンス
- すべての処理について、適法な根拠を文書化している
- プライバシーポリシーを公開し、誰でもアクセスできる状態にしている
- 同意の仕組みで、きめ細かな管理機能を実装している
- データ主体の権利に関する要求の処理プロセスを確立している
- 処理活動の記録を維持している
- データ保護責任者を任命している(必要な場合)
- 高リスクの処理についてDPIAを実施している
- データ侵害の通知手順を整備している
- ベンダーとの契約にデータ処理契約を含めている
- 国際的なデータ移転に対する保護措置を実装している
- データ保護に関するスタッフ研修を完了している
CCPA コンプライアンス
- ホームページに「個人情報を販売しないでください」リンクを設置している
- プライバシーポリシーで、データの収集および販売について開示している
- 消費者の要求を検証できる仕組みを備えている
- オプトアウト要求の処理プロセスを設けている(48時間以内に対応)
- 要求およびコンプライアンスに関する年次報告書を作成している
- サービスプロバイダー契約を更新している
- 収集時の通知を提供している
HIPAA コンプライアンス
- リスク評価を完了している
- セキュリティポリシーおよび手順を文書化している
- 従業員にHIPAA要件に関する研修を実施している
- ビジネスアソシエイト契約を締結している
- アクセス制御および監査証跡を実装している
- ePHIの暗号化を実施している
- 侵害通知の手順を確立している
- 緊急時対応計画および災害復旧計画を整備している
プライバシーコンプライアンスは一度きりのチェックリストではなく、継続的なプロセスです。規制の変化やデータ処理の変更に応じて、定期的に実務を見直し、更新してください。