Skip to content

hashgraph-online/awesome-codex-plugins / plugins/AltByteSG/personal-data-protection-skill/skills/personal-data-protection

personal-data-protection

Verified

Personal-data-protection compliance reference for engineers building applications subject to Singapore PDPA, Indonesia UU PDP, Thailand PDPA, Malaysia PDPA, Philippines DPA (RA 10173), or Vietnam PDPL (91/2025/QH15). Use when reviewing or modifying code that touches personal data — signup/auth/consent, data export, account deletion, retention/purging, admin access to personal-data stores, third-party processors, breach response, or privacy/T&C documents.

FileKindSize
SKILL.mdskill md14.5 KB
checklists/breach-response.mdmarkdown5.6 KB
checklists/new-data-field.mdmarkdown6.8 KB
checklists/new-feature.mdmarkdown11.2 KB
checklists/new-vendor.mdmarkdown7.1 KB
jurisdictions/_index.mdmarkdown12.6 KB
jurisdictions/id-pdp/README.mdmarkdown8.7 KB
jurisdictions/id-pdp/obligations/01-accountability.mdmarkdown12.4 KB
jurisdictions/id-pdp/obligations/02-consent.mdmarkdown7.5 KB
jurisdictions/id-pdp/obligations/03-purpose.mdmarkdown7.0 KB
jurisdictions/id-pdp/obligations/04-access-correction.mdmarkdown8.9 KB
jurisdictions/id-pdp/obligations/05-care.mdmarkdown7.1 KB
jurisdictions/id-pdp/obligations/06-breach-notification.mdmarkdown7.4 KB
jurisdictions/id-pdp/obligations/07-offences.mdmarkdown7.6 KB
jurisdictions/id-pdp/statute-map.mdmarkdown12.5 KB
jurisdictions/my-pdpa/README.mdmarkdown10.2 KB
jurisdictions/my-pdpa/obligations/01-accountability.mdmarkdown6.5 KB
jurisdictions/my-pdpa/obligations/02-consent.mdmarkdown10.0 KB
jurisdictions/my-pdpa/obligations/03-purpose.mdmarkdown9.1 KB
jurisdictions/my-pdpa/obligations/04-access-correction.mdmarkdown11.1 KB
jurisdictions/my-pdpa/obligations/05-care.mdmarkdown11.5 KB
jurisdictions/my-pdpa/obligations/06-breach-notification.mdmarkdown7.6 KB
jurisdictions/my-pdpa/obligations/07-offences.mdmarkdown8.1 KB
jurisdictions/my-pdpa/statute-map.mdmarkdown10.4 KB
jurisdictions/ph-dpa/README.mdmarkdown12.8 KB
jurisdictions/ph-dpa/obligations/01-accountability.mdmarkdown8.3 KB
jurisdictions/ph-dpa/obligations/02-consent.mdmarkdown12.0 KB
jurisdictions/ph-dpa/obligations/03-purpose.mdmarkdown8.7 KB
jurisdictions/ph-dpa/obligations/04-access-correction.mdmarkdown13.4 KB
jurisdictions/ph-dpa/obligations/05-care.mdmarkdown13.6 KB
jurisdictions/ph-dpa/obligations/06-breach-notification.mdmarkdown11.2 KB
jurisdictions/ph-dpa/obligations/07-offences.mdmarkdown11.3 KB
jurisdictions/ph-dpa/statute-map.mdmarkdown10.9 KB
jurisdictions/sg-pdpa/README.mdmarkdown5.4 KB
jurisdictions/sg-pdpa/obligations/01-accountability.mdmarkdown4.0 KB
jurisdictions/sg-pdpa/obligations/02-consent.mdmarkdown6.9 KB
jurisdictions/sg-pdpa/obligations/03-purpose.mdmarkdown4.4 KB
jurisdictions/sg-pdpa/obligations/04-access-correction.mdmarkdown6.5 KB
jurisdictions/sg-pdpa/obligations/05-care.mdmarkdown6.9 KB
jurisdictions/sg-pdpa/obligations/06-breach-notification.mdmarkdown10.5 KB
jurisdictions/sg-pdpa/obligations/07-offences.mdmarkdown6.6 KB
jurisdictions/sg-pdpa/statute-map.mdmarkdown8.0 KB
jurisdictions/th-pdpa/README.mdmarkdown7.3 KB
jurisdictions/th-pdpa/obligations/01-accountability.mdmarkdown7.1 KB
jurisdictions/th-pdpa/obligations/02-consent.mdmarkdown8.5 KB
jurisdictions/th-pdpa/obligations/03-purpose.mdmarkdown4.9 KB
jurisdictions/th-pdpa/obligations/04-access-correction.mdmarkdown7.0 KB
jurisdictions/th-pdpa/obligations/05-care.mdmarkdown7.3 KB
jurisdictions/th-pdpa/obligations/06-breach-notification.mdmarkdown7.0 KB
jurisdictions/th-pdpa/obligations/07-offences.mdmarkdown8.5 KB
jurisdictions/th-pdpa/statute-map.mdmarkdown8.1 KB
jurisdictions/vn-pdpl/README.mdmarkdown9.9 KB
jurisdictions/vn-pdpl/obligations/01-accountability.mdmarkdown5.0 KB
jurisdictions/vn-pdpl/obligations/02-consent.mdmarkdown5.1 KB
jurisdictions/vn-pdpl/obligations/03-purpose.mdmarkdown6.7 KB
jurisdictions/vn-pdpl/obligations/04-access-correction.mdmarkdown4.9 KB
jurisdictions/vn-pdpl/obligations/05-care.mdmarkdown5.0 KB
jurisdictions/vn-pdpl/obligations/06-breach-notification.mdmarkdown5.6 KB
jurisdictions/vn-pdpl/obligations/07-offences.mdmarkdown3.0 KB
jurisdictions/vn-pdpl/obligations/08-sector-specific.mdmarkdown4.4 KB
jurisdictions/vn-pdpl/statute-map.mdmarkdown9.5 KB
layers/01-non-technical.mdmarkdown4.9 KB
layers/02-architecture.mdmarkdown8.0 KB
layers/03-data-model.mdmarkdown8.4 KB
layers/04-controls-and-processes.mdmarkdown9.1 KB
layers/05-feature-ux.mdmarkdown9.0 KB
layers/06-disclosure.mdmarkdown6.5 KB
layers/07-operational.mdmarkdown9.5 KB
templates/INCIDENT_RESPONSE.md.templateother13.2 KB
templates/pdp-nudge.sh.templateother4.5 KB

layers/07-operational.md

View on GitHub
# Layer 07 — Operational

> ⚠ **Reference material only — not legal advice.** See [DISCLAIMER.md](https://github.com/AltByteSG/personal-data-protection-skill/blob/main/DISCLAIMER.md). Verify against the official statute and consult a qualified DPO / lawyer.

Run-time concerns: incidents, retention sweeps, monitoring, vendor reviews. Universal across stacks; specific deadlines vary by jurisdiction (see active `jurisdictions/<code>/obligations/06-breach-notification.md`).

## Contents

- Incident response
- Retention sweeps
- Log retention
- Backups
- Vendor reviews
- Monitoring and breach detection
- Admin audit log review (when multi-admin)
- Insurance
- Documentation discipline

## Incident response

**Primary document:** an incident-response runbook that lives in the project repo, owned by the DPO. Template at `templates/INCIDENT_RESPONSE.md.template` — copy and customise for your stack and contacts.

The runbook must be specific enough to act on at 2am. Generic content ("notify the regulator") is useless during an incident; specific content ("file via [portal URL] using the saved template at [path]") is what matters.

### Quick reference (do not substitute for the runbook)

| Step | When |
|---|---|
| Detect / become aware | Happens by chance until observability is in place |
| Contain (rotate keys, revoke endpoints, sign out users) | First hour |
| Assess notifiability per the active jurisdiction's threshold | "Reasonable + expeditious" — most regulators target ≤ 30 days from awareness |
| Notify regulator if notifiable | **Jurisdiction-specific deadline — see active `jurisdictions/<code>/obligations/06-breach-notification.md`** |
| Notify affected individuals if significant harm likely | Concurrent or shortly after regulator notification |
| Post-mortem | Within 30 days of resolution |

### Notifiability shortcuts (use the active jurisdiction's actual rules)

Most PDP-family statutes treat as notifiable:

- A breach affecting at least N individuals (the "significant scale" threshold; varies by jurisdiction)
- A breach involving sensitive categories at any scale (auth credentials, health, location-with-identity, children's data, financial info, private communications)
- An internal-only access (e.g. curious admin) is **not universally carved out — check the active jurisdiction before closing one without notifying.** SG has an explicit exclusion (s26B(4)); **TH does not** — under s37(1) it remains a breach and notifiability falls to the risk assessment. ID / MY / PH carry no explicit carve-out either, so treat the assessment as required. In every jurisdiction it IS a personal offence under the individual-criminal-liability provisions

### Sub-processor / vendor breaches

When a processor you use has a breach affecting your data, the procedure is the same
everywhere; only the provision that puts the reporting duty on the processor differs.

- Your DPA should require the processor to notify you **without undue delay**. Best
  practice is to contractually require **≤ 24 hours**, so you retain time to assess
  before your own clock expires.
- Your regulatory clock starts when **you** become aware — in practice, when the
  processor notifies you. Their delay consumes your window, which is why the
  contractual ceiling matters.
- Record the chain in the incident log: when the processor became aware → when they
  notified you → when you assessed.

The statutory hook is per-jurisdiction — see the active
`jurisdictions/<code>/obligations/06-breach-notification.md`.

### Post-incident records

After any breach, add the post-incident remediation to your processing / security
records. This is the demonstrable-accountability principle in practice, and it is the
first thing a regulator asks for if they investigate. Each jurisdiction's obligation
file names the record-keeping provision that applies.

### Runbook readiness checklist

Verify before an incident, not during one:

- [ ] Regulator notification form pre-filled and saved, with the current submission
      method confirmed
- [ ] DPO **and** a backup contact both hold credentials to submit
- [ ] Data-subject notification template pre-staged **in the languages your users
      read** — several jurisdictions expect or require the local language
- [ ] Incident log location documented, using the awareness-timestamp pattern
- [ ] Vendor DPAs carry a breach-notification clause with a time ceiling
- [ ] Annual review of the runbook scheduled

Starting point: `templates/INCIDENT_RESPONSE.md.template`.

## Retention sweeps

A canonical "PDP cleanup" job that runs daily at off-peak (e.g. 03:00 local time):

1. Soft- or hard-deletes data past its retention period
2. Cleans up associated storage (files, blobs)
3. Logs what was removed (counts, not content)

**Verify the job is alive (recommended monthly):**
- Check the cron / scheduler dashboard for the last successful run
- Alert if the last run is more than ~25 hours old (one cycle missed)

If your platform supports it, expose a manual "run now" trigger in admin tooling so the job can be invoked outside its normal schedule for testing or after a recovery.

## Log retention

| Log source | Retention | Why |
|---|---|---|
| Admin audit log (table) | 7 years (defensible); indefinite (debatable when challenged) | Accountability evidence |
| Consent log (table) | Indefinite or per consent-record retention rule | Consent evidence |
| Operational rate-limit ledgers | Hours to days | Operational only, not PII |
| Deletion audit (email hashes etc.) | 7 years (defensible) | Deletion-request evidence |
| Application server logs | Whatever your platform default is (typically days–weeks) | Operational debugging |
| Database query logs | Same as application logs | Operational |
| Crash / error reporting | 30–90 days typical | Incident investigation |

**PII in logs:** apply the redaction patterns from [layer 04](04-controls-and-processes.md) at every log site. Verify periodically by sampling production logs for raw email addresses, full UUIDs, or token-shaped strings.

## Backups

Most managed databases offer point-in-time recovery (PITR) with a configurable retention window (typically 7–30 days). Backups inherit:
- Same encryption-at-rest as primary
- Same regional placement
- Same access controls on restore

When a user deletes their account, their data persists in backups for the backup retention window. Disclose this in the privacy policy: *"Some data may be retained longer in encrypted backups, which are purged on a rolling schedule."*

PDP-family statutes generally accept backup retention as long as the schedule is documented and bounded.

## Vendor reviews

When adding a new sub-processor: see [`checklists/new-vendor.md`](../checklists/new-vendor.md).

**Quarterly** (when scaling past beta / first 100 users):
- Walk through the sub-processor table in the privacy policy and verify each entry against actual code paths (any new external-domain calls?).
- Confirm DPAs are still in force.
- Check vendor status pages for incidents during the quarter.
- Note any pending vendor changes (deprecations, region migrations) that need privacy-policy updates.

## Monitoring and breach detection

Without monitoring, breach detection is luck. Minimum signals to set up before scaling past beta:

| Signal | Why |
|---|---|
| Failed-auth volume alarm | Credential-stuffing or brute-force attempts |
| Mass-export rate-limit alert | Abuse of the data-export endpoint, or compromise via legitimate sessions |
| Storage egress anomaly | Bulk download of user files |
| Repository secret scanning | Leaked API keys / credentials in commits |
| External monitoring of key user-facing endpoints | Detect outages and misconfigurations |
| Quarterly admin audit log review | Detect unauthorised access by authorised people |

These feed the breach-detection capability that the regulatory clock depends on. Without them, "detection" means "a user complains" — and the clock has been ticking for an unknown period before that.

## Admin audit log review (when multi-admin)

Once more than one person has admin access:

**Quarterly schedule:**
1. Pull the past 90 days of admin audit log entries
2. Spot-check unusual patterns:
   - One admin viewing many distinct users in a short time
   - Off-hours activity
   - Repeat views of the same record
   - Actions on accounts the admin had no reason to touch
3. Document findings in the staff access log
4. Adjust AUP or training as needed

While solo: this is a self-discipline check — useful but not load-bearing. The moment a second person has the role, it becomes structurally necessary.

## Insurance

Cyber-liability insurance is increasingly available for small organisations. Premiums depend on:
- Number of records held
- Categories of data (sensitive categories raise premiums)
- Existing controls (MFA, encryption, audit logging, breach response capability)
- Industry sector

Worth a conversation with a broker once you have meaningful numbers of users. Not a substitute for compliance, but a backstop.

## Documentation discipline

Compliance posture in an audit is judged in large part on what you can show. Keep:

- A dated **compliance evidence bundle** per major release (snapshot of policies, vendor list, audit log review, etc.)
- **Incident logs** for every incident, even minor ones — pattern visibility matters more than individual severity
- **Decision logs** for compliance-relevant choices ("we decided X because Y, accepting risk Z")
- **Training records** if more than one person has access

Solo founders often skip this. Don't — the cost of writing it down is small; the cost of not having it during an enforcement action is large.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall