## 🛠️ 專業框架與方法論

### 法規與標準體系
| 框架 | 應用場景 |
|------|----------|
| **GDPR** (EU 2016/679) | 資料主體權利、DPIA、DPO、跨境傳輸、72h breach notification |
| **CCPA/CPRA** (California) | opt-out of sale/share、sensitive PI、automated decision-making |
| **PDPO** (Cap. 486, Hong Kong) | DPP1-6、直接促銷、資料使用者責任、PDPC 執法 |
| **PIPL** (China) | 個人資訊處理告知同意、跨境提供安全評估、單獨同意 |
| **LGPD** (Brazil) | 10 項法律基礎、ANPD 框架 |
| **ISO/IEC 27701:2019** | PIMS 擴展、隱私控制對照 |
| **NIST Privacy Framework** | Identify-Predict-Prevent-Detect-Respond 五功能 |
| **ISO/IEC 29134:2017** | PIA/DPIA 方法論 |

### 隱私工程方法論

#### Privacy by Design (PbD) — Ann Cavoukian 七原則
1. Proactive not Reactive
2. Privacy as the Default
3. Privacy Embedded into Design
4. Full Functionality (Positive-Sum)
5. End-to-End Security
6. Visibility and Transparency
7. Respect for User Privacy

#### 威脅建模
- **LINDDUN**：Linkability, Identifiability, Non-repudiation, Detectability, Disclosure, Unawareness, Non-compliance
- **PLOT4ai**：ML/AI 系統專用隱私威脅建模
- **STRIDE** + Privacy Extensions：與 Security 威脅模型整合

#### 資料生命週期控制
```
Collect → Store → Use → Share → Retain → Delete
   ↓        ↓       ↓       ↓        ↓        ↓
 Consent  Encrypt  Purpose  DPA/SCC  TTL Job  Crypto-shred
```

### 技術實作模式（Design Patterns）

| Pattern | 說明 | 適用場景 |
|---------|------|----------|
| **Consent Gateway** | API gateway 層攔截，驗證 consent token 與 purpose binding | 微服務架構 |
| **Privacy Vault** | 將 PII 隔離至獨立加密儲存，業務 DB 僅存 tokenized reference | 多租戶 SaaS |
| **Event Sourcing for DSAR** | 所有資料變更以 event 記錄，支援 efficient DSAR fulfillment | 高 DSAR 量企業 |
| **Field-Level Encryption** | 敏感欄位獨立金鑰加密，支援 selective decryption | 混合敏感等級資料 |
| **TTL + Crypto-shredding** | 結合資料保留政策與金鑰銷毀實現「被遺忘權」 | GDPR Art. 17 |
| **Synthetic Data Pipeline** | 生產環境資料脫敏後用於 dev/staging/ML training | 開發測試環境 |

### 隱私增強技術（PETs）選型矩陣
| 技術 | 隱私保護等級 | 效能成本 | 適用場景 |
|------|-------------|----------|----------|
| Differential Privacy | 高（統計層面） | 中-高 | 聚合分析、公開資料集 |
| k-anonymity / l-diversity | 中 | 低 | 資料發布、研究共享 |
| Homomorphic Encryption | 極高 | 極高 | 加密狀態計算 |
| Secure MPC | 高 | 高 | 跨組織聯合分析 |
| Federated Learning | 中高 | 中 | 分散式 ML 訓練 |
| TEE (SGX/SEV) | 高 | 中 | 機密運算 enclave |

### DPIA 執行模板
1. **處理活動描述**：目的、資料類別、資料主體、接收方、保留期限
2. **必要性與比例原則**：為何需要這些資料？有無更少侵入性替代方案？
3. **風險識別**：LINDDUN 威脅清單逐項評估
4. **既有控制措施**：技術與組織措施（TOMs）清單
5. **殘餘風險與決策**：接受 / 緩解 / 避免 / 轉移
6. **諮詢記錄**：DPO、資料主體代表（如適用）、監管機構（高風險時）
7. **審查週期**：觸發重新評估的條件（架構變更、新用途、新法規）

### 工具生態系（參考，非背書）
- **Consent/CMP**：OneTrust, Cookiebot, Osano, Didomi
- **Data Discovery**：BigID, Securiti.ai, Microsoft Purview
- **DSAR Automation**：Transcend, DataGrail, Ketch
- **Privacy Engineering**：Skyflow, Privitar, Immuta
- **Open Source**：OPA (policy-as-code), Fides (Ethyca), db-anonymizer

### CI/CD 隱私閘門（Privacy Gates）
```yaml
# 範例：PR 隱私檢查閘門
privacy_gates:
  - name: pii_schema_scan
    trigger: pull_request
    checks:
      - new_pii_fields_require_dpia_link
      - consent_purpose_mapping_updated
      - retention_policy_defined
  - name: third_party_sdk_review
    trigger: dependency_change
    checks:
      - sdk_privacy_manifest_present
      - data_sharing_disclosure_updated
```