Files
2nd/10_Wiki/Topic_Programming/DevOps_and_Security/Ensuring-Data-Privacy.md
T
Antigravity Agent 9148c358d0 docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
2026-07-05 00:33:48 +09:00

5.6 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-ensuring-data-privacy Ensuring Data Privacy 10_Wiki/Topics verified self
Data Privacy
Privacy Engineering
GDPR Compliance
none A 0.9 applied
privacy
gdpr
security
compliance
2026-05-10 applied
language framework
Python/TypeScript OneTrust/Fides/OPA

Ensuring Data Privacy

매 한 줄

"매 personal data 가 lawful basis + minimum + purpose-limited 로 다뤄진다.". Data privacy engineering 은 매 GDPR/CCPA/LGPD/K-PIPA 의 legal requirement 를 매 storage, processing, transfer, retention 의 매 단계 에 deterministic control 로 구현. 2026 stack: classification + DLP + tokenization/PETs (DP, FHE, TEE) + consent management + DSAR automation + privacy-by-design.

매 핵심

매 Privacy Principle (GDPR Art.5)

  1. Lawfulness, fairness, transparency — consent / legitimate interest.
  2. Purpose limitation — 매 collected purpose 외 사용 금지.
  3. Data minimization — 매 필요한 최소.
  4. Accuracy — correctable.
  5. Storage limitation — retention schedule.
  6. Integrity & confidentiality — encryption.
  7. Accountability — DPO, audit, DPIA.

매 PET (Privacy-Enhancing Tech) 2026

  • Pseudonymization: tokenization, format-preserving encryption (FPE).
  • Anonymization: k-anonymity, l-diversity, t-closeness.
  • Differential Privacy: ε,δ noise — Apple, US Census, Chrome.
  • Federated learning: 매 model travels, data stays.
  • Homomorphic encryption (FHE): 매 compute on encrypted — Microsoft SEAL, OpenFHE.
  • Confidential computing (TEE): Intel TDX, AMD SEV-SNP, Apple Private Cloud Compute.
  • Zero-Knowledge Proofs: identity 증명 without disclose.

매 응용

  1. EU GDPR + 한국 PIPA + 중국 PIPL compliance.
  2. Healthcare HIPAA, PCI-DSS payment.
  3. ML training without raw data (FL, DP).
  4. Cross-border transfer (SCC, BCR, DPF).
  5. Right to be forgotten (RTBF) automation.

💻 패턴

Data classification + DLP

# 매 PII detection — Microsoft Presidio
from presidio_analyzer import AnalyzerEngine
analyzer = AnalyzerEngine()
results = analyzer.analyze(text=user_input, language='en',
  entities=['EMAIL_ADDRESS','PHONE_NUMBER','CREDIT_CARD','PERSON','KR_RRN'])
for r in results: redact_or_mask(text, r.start, r.end)

Format-preserving tokenization

# 매 ff3-1 — preserves format (e.g., card number)
from ff3 import FF3Cipher
c = FF3Cipher(key, tweak)
token = c.encrypt("4242424242424242")  # → 16-digit string
plain = c.decrypt(token)

Differential Privacy noise

import numpy as np
def laplace_mechanism(true_val, sensitivity, epsilon):
    return true_val + np.random.laplace(0, sensitivity / epsilon)
# 매 query: count of users in segment
noisy_count = laplace_mechanism(true_count=1234, sensitivity=1, epsilon=1.0)

k-anonymity check

import pandas as pd
def k_anonymity(df: pd.DataFrame, quasi_ids: list[str]) -> int:
    return df.groupby(quasi_ids).size().min()
# 매 ensure k>=5 before release
assert k_anonymity(df, ['zip','age','gender']) >= 5

DSAR (Data Subject Access Request) automation

async def dsar_export(user_id: str) -> bytes:
    bundle = {
      'profile': await db.users.find_one({'_id':user_id}),
      'orders':  [o async for o in db.orders.find({'userId':user_id})],
      'logs':    await elasticsearch_export(user_id),
    }
    return json.dumps(bundle, default=str).encode()

async def dsar_erasure(user_id: str):
    await db.users.update_one({'_id':user_id},
        {'$set': {'email':None,'name':None,'erasedAt':datetime.utcnow()}})
    await s3.delete_objects(Bucket='pii', Prefix=f'users/{user_id}/')
const consent = {
  userId: 'u_123',
  purposes: { analytics: true, marketing: false, personalization: true },
  vendors: { google: true },
  timestamp: new Date().toISOString(),
  version: 'tcf-2.2',
  signature: hmac(record),
};
await db.consents.insertOne(consent);

매 결정 기준

상황 Approach
EU users GDPR + Schrems II SCC
한국 users PIPA — 개인정보처리방침, 위탁 동의
Aggregate analytics Differential Privacy
Payment data PCI-DSS tokenization
ML training Federated learning + DP
Cross-org compute TEE (Confidential Computing)

기본값: 매 minimize + classify + tokenize + consent ledger + DSAR API.

🔗 Graph

🤖 LLM 활용

언제: privacy policy 검토, DSAR response draft, PIA 질문 generation. 언제 X: 매 PII 를 third-party LLM 에 raw 로 전송 — anonymize 먼저.

안티패턴

  • Hash = anonymized 오해: 매 hash 는 pseudonymization, GDPR 적용.
  • Consent on entry-only: 매 ongoing — withdrawable, granular.
  • Log PII: 매 logger 가 leak source — redact filter.
  • Forever retention: 매 GDPR 위반 — TTL + erasure.
  • Plaintext backup: 매 encryption at rest 필수.

🧪 검증 / 중복

  • Verified: GDPR Art.5/17/25; ISO/IEC 27701; NIST SP 800-188; Microsoft Presidio docs.
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — principles + PETs + DSAR/DP patterns