Subchapter 179.2
references/Security.mdMarkdown12 KBView on GitHub
Load this file when you need implementation detail on: encryption, password hashing, secrets management, anonymization/pseudonymization, cloud/DevOps practices, CI/CD controls, incident response, architecture patterns.
| Data sensitivity | Minimum standard |
|---|---|
| Standard personal data (name, address, email) | AES-256 disk/volume encryption (cloud provider default) |
| Sensitive personal data (health, biometric, financial, national ID) | AES-256 column-level encryption + envelope encryption via KMS |
| Encryption keys | HSM-backed KMS (Azure Key Vault Premium / AWS KMS CMK / GCP Cloud KMS) |
Envelope encryption pattern:
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.| Algorithm | Parameters | Notes |
|---|---|---|
| Argon2id recommended | memory ≥ 64 MB, iterations ≥ 3, parallelism ≥ 4 | OWASP and NIST recommended |
| bcrypt acceptable | cost factor ≥ 12 | Widely supported; use if Argon2id unavailable |
| scrypt acceptable | N=32768, r=8, p=1 | Good alternative |
| MD5 | — | Never — trivially broken |
| SHA-1 / SHA-256 | — | Never for passwords — not designed for this purpose |
MUST
SHOULD
haveibeenpwned API, k-anonymity mode).MUST NOT
MUST
gitleaks, detect-secrets, GitHub native secret scanning.SHOULD
.gitignore MUST include:
.env
.env.*
*.pem
*.key
*.pfx
*.p12
secrets/
appsettings.*.json # if it may contain connection stringsMUST NOT
| Term | Reversible? | GDPR scope? | Use case |
|---|---|---|---|
| Anonymization | No | Outside GDPR scope | Retained records after erasure, analytics datasets |
| Pseudonymization | Yes (with key) | Still personal data | Analytics pipelines, audit logs, reduced-risk processing |
| Technique | How | When |
|---|---|---|
| Suppression | Remove the field entirely | Fields with no analytical value |
| Masking | Replace with fixed placeholder ("ANONYMIZED_USER") | Audit log identifiers after erasure |
| Generalization | Replace exact value with a range (age 34 → “30–40”) | Analytics |
| Noise addition | Add statistical noise to numerical values | Aggregate analytics |
| Aggregation | Report group statistics, never individual values | Reporting |
| K-anonymity | Ensure each record is indistinguishable from k-1 others | Analytics datasets |
| Technique | How |
|---|---|
| HMAC-SHA256 with secret key | Consistent, one-way, keyed. Use for user IDs in analytics. Key in KMS. |
| Tokenization | Replace value with opaque token; mapping in separate secure vault. |
| Encryption with separate key | Decrypt only with explicit KMS authorization. |
MUST
"ANONYMIZED" or a hashed placeholder.Crypto-shredding pattern (event sourcing): Encrypt personal data in events with a per-user DEK. Store the DEK in the KMS. On erasure: delete the DEK from the KMS → all events for that user are effectively anonymized.
MUST NOT
MUST
DataClassification tag.SHOULD
MUST NOT
MUST
gitleaks, detect-secrets, GitHub secret scanning.npm audit, dotnet list package --vulnerable, trivy, snyk.SHOULD
trivy, Snyk Container, or AWS ECR scanning.Pipeline secret rules:
# MUST: mask secrets before use
- name: Mask secret
run: echo "::add-mask::${{ secrets.MY_SECRET }}"
# MUST NOT: echo secrets to console
- run: echo "Key=$API_KEY" # Never
# SHOULD: use OIDC federation (no long-lived keys)
- uses: azure/login@v1
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}| Window | Obligation |
|---|---|
| 72 hours from awareness | Notify the supervisory authority (CNIL, APD, ICO…) — unless breach is unlikely to risk individuals |
| Without undue delay | Notify affected data subjects if breach is likely to result in high risk to their rights |
Log all personal data breaches internally — even those that do not require DPA notification.
Configure alerts for:
Store breach records internally for at least 5 years.
Separate operational data (transactional DB) from analytical data (data warehouse). Apply different retention periods and access controls to each. The analytics store MUST NOT read directly from production operational tables.
Track consent as an immutable event log in a separate store, not a boolean column on the user table. This enables: auditable consent history, version tracking, easy withdrawal without data loss.
Store audit logs in a separate, append-only store. The application service account MUST NOT be able to delete audit log entries. Use a separate DB user with INSERT-only rights on the audit table.
Implement Data Subject Requests as an asynchronous workflow:
POST /api/v1/me/erasure-request → enqueue a job → worker scrubs all stores → notify user on completion.
This handles the complexity of multi-store scrubbing reliably and provides a retry mechanism.
For analytics pipelines, implement a pseudonymization service at the boundary between operational and analytical systems. The mapping key (HMAC secret or tokenization vault) never leaves the operational zone. The analytics zone receives only pseudonymized identifiers.
Encrypt personal data in events with a per-user DEK stored in the KMS. On user erasure: delete the DEK → all historical events for that user are effectively anonymized without modifying the event log.