# Data Protection Impact Assessment (DPIA) **Project:** Diana Beauty School Plymouth — public website, student/staff portal, privacy notice **Controller:** Diana Beauty School Plymouth, 92 Cornwall Street, Plymouth PL1 1NF **Build version:** 1.0 (front-end build, no server or database) **Author / contact:** info@strykora.co.uk **Status:** DRAFT — requires owner sign-off before any backend is connected **Legal basis for this assessment:** UK GDPR Article 35; Data Protection Act 2018 s.64; ICO Children's Code (s.123 DPA 2018) --- ## 1. Description of the processing ### 1.1 What the system is A three-surface web property for a Plymouth beauty salon and training academy: | Surface | Route | Purpose | |---|---|---| | Marketing site | `/index.html` | Describe treatments and courses; capture booking enquiries | | Portal | `/portal/` | Staff course builder with draft→publish; student view | | Privacy notice | `/privacy/` | Article 13 information, age-appropriate explainers | ### 1.2 Data flows **as built (v1.1 — staff authentication added)** ``` Visitor → booking form → validation in the browser → payload rendered on screen → copied to the visitor's clipboard → (nothing transmitted, nothing stored) Staff → POST /portal/login → 6-digit code emailed (HMAC-SHA256 at rest) → POST /portal/login/verify → constant-time check, 5 attempts, 5 min → session cookie (HttpOnly) → GET /portal/ → session checked server-side → portal HTML → portal data → localStorage on the staff device only ``` **What changed from v1.0, and why this DPIA changed with it.** The earlier version of this document stated there was no server and no network transmission of personal data. That is no longer true, and leaving the claim in place would have made this a false record. The system now runs a server that processes **staff authentication data**: a username, a password presented once for verification, a derived session token, and request metadata (IP, user agent, timestamps) written to the process log. This is personal data about employees, not about children or customers. The **visitor** data flow is unchanged: the enquiry form still transmits nothing. There is still no database in use. The Postgres container is provisioned but no application writes to it yet. **Consequence:** this DPIA now covers two distinct processing operations with different data subjects and different lawful bases, assessed separately below. The child-facing assessment in §3 continues to apply to the marketing site and privacy notice; the authentication processing is assessed in §3A. ### 1.2A Authentication processing — lawful basis and minimisation | Element | Assessment | |---|---| | Data subjects | Staff of the controller. **Not children.** | | Lawful basis | UK GDPR Art 6(1)(f) legitimate interests — controlling access to an internal management system, protecting the controller's and students' data. Not Art 6(1)(a): consent is not appropriate for a condition of employment. | | Special category | None. No health, biometric or diversity data is processed. No passwords are stored at all — see *Authentication* below. | | Data minimisation | Email address (the sign-in identity — unavoidable for emailed codes), display name, role, session token, timestamps. **No** phone numbers, no dates of birth, no photographs. | | **Authentication** | **No passwords exist.** Sign-in is a 6-digit code emailed to a registered address. The code is stored only as an HMAC-SHA256 digest keyed with `OTP_SECRET`, compared in constant time, expires after 5 minutes, is single-use, and is destroyed after 5 wrong attempts. Request caps: 3 per email and 10 per IP per 15 minutes. | | Retention | Session records and codes exist only in process memory and die on restart or expiry (code 5 min; session 30 min idle / 8 h absolute). Request logs are stdout and inherit the container's log retention. In the dev mail transport, message files are deleted after 10 minutes. **No authentication record is persisted to a database.** | | Transparency | Staff are informed through the employment privacy notice, which is **not yet written** — see §9, issue 7. | | Encryption | TLS required in production; the `Secure` cookie flag is set whenever the request arrives over TLS. `OTP_SECRET` lives in `.env.dev` (mode 600), never in the image or in git. | | Access | Only the controller's operator holds `.env.dev`, which contains `OTP_SECRET` and the staff address list. | **Risk specific to this processing:** a 6-digit code has only 10⁶ values, so the brute-force defence cannot rest on code length. It rests on the 5-attempt cap, which destroys the code, plus the 5-minute expiry, single use and per-email request cap (without which an attacker could farm fresh codes after each lockout). A shared shop-floor tablet also creates a real risk of a session left open. Mitigations: SameSite=Strict cookies, a visible Sign out control that is deliberately *not* hidden on mobile, and a 30-minute idle timeout. **New risk introduced by the change to OTP-only:** if email delivery fails, **nobody can sign in, including the owner** — there is no password fallback and no break-glass path. This is an availability risk to the controller, not a risk to data subjects, but it is the most likely operational failure. A break-glass mechanism must exist before go-live. **Residual risk: LOW** for confidentiality, provided the production deployment uses real SMTP with SPF/DKIM/DMARC, replaces the in-memory session store with a shared store, and adds a break-glass path. ### 1.3 Data flows **planned for v1.1** (the processing this DPIA assesses) | Element | Data | Purpose | Basis | |---|---|---|---| | Enquiry submission | name, phone, service interest, preferred date/time, consent flags | Reply to the enquiry, confirm a slot | Art 6(1)(a) consent | | Course enrolment | name, email, phone, course, payment reference | Deliver the course, issue a certificate | Art 6(1)(b) contract | | Lesson progress | user id, lesson id, completion, timestamps | Teach the course; unlock practical sessions | Art 6(1)(b) contract | | Quiz attempts | answers, score, pass/fail | Mark the work; gate practical sessions | Art 6(1)(b) contract | | Treatment consultation | health information relevant to a specific treatment | Treat safely | Art 9(2)(a) explicit consent + 9(2)(h) health care | | Marketing preference | opt-in flag + timestamp | Send course dates/offers, only if opted in | Art 6(1)(a) consent (PECR) | | Audit log | actor id, action, resource, UTC time, outcome | Security, accountability, breach investigation | Art 6(1)(c) legal obligation / 6(1)(f) legitimate interests | ### 1.4 Retention schedule | Data | Retention | Enforced by | |---|---|---| | Enquiry (name, phone, interest, date) | 24 months, then deleted | Scheduled job + `retention_policy` column | | Course record | Course end + 24 months | Scheduled job | | Certificate + verification record | 7 years (insurance/accreditation defence) | Scheduled job | | Treatment consultation | 7 years (clinical record convention) | Scheduled job | | Marketing consent record | Until withdrawn + 24 months as proof | Scheduled job | | Audit log | 12 months rolling, append-only | Partition drop | ### 1.5 Recipients and processors | Recipient | Role | Safeguards | |---|---|---| | Hosting provider (UK VPS) | Processor | UK-only region, DPA in place, encrypted volume | | Booking system (Versum / Booksy) | Separate controller for appointments | Not integrated in v1.0; no automated data transfer | | Payment provider | Separate controller for card data | Hosted payment fields only — no card data reaches our servers | | AI assistant (if enabled) | Processor for chat prose | Server-side proxy; no PII in prompts; kill-switch to deterministic-only replies | **No** advertising networks, **no** analytics providers, **no** data brokers, **no** social pixels. Verified: the pages make zero third-party network requests (see §8). --- ## 2. Necessity and proportionality | Question | Answer | |---|---| | Is each field needed for the stated purpose? | Yes. Name + phone are the minimum to reply to an enquiry. Date/time are needed to offer a slot. Nothing is collected "just in case". | | Could we collect less? | The v1.0 form already collects only five fields plus two consent flags. Date of birth is **not** collected (age band is used where age matters). Address is not collected. | | Is the retention justified? | Enquiry data is short-lived (24 months). Course and treatment records follow insurance/accreditation and clinical conventions, not convenience. | | Are defaults high-privacy? | Yes — marketing opt-in is unticked, profiling is off, geolocation is off, analytics cookies are absent, data sharing is denied by default. | | Is there a less intrusive alternative? | For enquiries, yes: a phone number. The form exists because the phone line is unconfirmed (see §9 open issues); if a phone line is published, the form becomes an optional convenience, not the only route. | --- ## 3. Risks to children, by age band The ICO Children's Code applies to services **likely to be accessed by children**, even when not targeted at them. This service is a beauty salon and an adult training academy. A child is likely to reach the public site (a parent researching a child's haircut, or a 15-year-old curious about a career). Therefore the Code is engaged for the public surface. Design decision, recorded: **apply the high-privacy standards to all users**, which the ICO accepts as an alternative to age assurance. See `childrens-code.md`. | Band | Realistic exposure | Risk | Inherent | Mitigation | Residual | |---|---|---|---|---|---| | **0–5** | None directly; a parent may book a child's dry cut | A child's name/age shared with the salon | Low | Booking is by the parent in the salon system; no child accounts; no child assessment data; no marketing to the child | Low | | **6–9** | Accidental arrival via a parent's device | Confusion; a form that looks like it wants their details | Low | Plain-language age notice; courses clearly labelled 18+; no gamification, no nudges, no streaks | Low | | **10–12** | Curious browsing; may read the courses page | Expectation of being able to enrol | Low | Explicit "18 and over" labelling on every course card and the age notice; marketing off by default | Low | | **13–15** | Genuine interest in a beauty career; may submit an enquiry | Enquiry data from a minor; disappointed expectation; possible contact by an adult business | Medium | Enquiry is answered with an 18+ explanation, no mailing-list addition; no profiling; no location; safeguarding route published; deletion on request | Low–Medium | | **16–17** | Realistic: can enquire about treatments; wants to train | Being treated as an adult customer for marketing; data retained longer than needed | Medium | Same high-privacy defaults; courses still 18+ (insurance/accreditation); marketing only on explicit opt-in; retention enforced | Low | ### 3.1 Specific risks considered | Risk | Assessment | Control | |---|---|---| | Behavioural profiling of a child | Not possible — no profiling code exists | Profiling is off and documented as locked in Settings | | Location tracking | Not possible — geolocation is never requested | No `navigator.geolocation` call anywhere in the codebase | | Targeted advertising | Not possible — no ad code, no third-party scripts | Zero third-party requests, verified | | Nudge techniques / dark patterns | Rejected — no pre-ticked boxes, no countdown pressure, no "only 2 left" | Marketing checkbox unticked by default; no scarcity messaging | | Contact by an adult business | Real for a 13–17 year old who enquires | Reply is by the route they chose; the safeguarding and complaint route is published on the privacy page | | Safeguarding disclosure in a chat | Relevant if an AI assistant is added | The build prompt requires a safeguarding path with **zero offers** and the 0808 2000 247 number. Not implemented in v1.0 because there is no chat surface — see §7 | | Stored XSS via course content | Was a defect in the prototype (`innerHTML` interpolation) | **Fixed**: every node is built with `createElement`/`textContent`; no `innerHTML` with data anywhere | --- ## 4. Mitigations implemented in this build | Control | Where | Evidence | |---|---|---| | No `innerHTML` string interpolation with data | `assets/js/*.js` | DOM built via helper `el()` with `textContent` | | Consent not pre-ticked | `index.html` marketing checkbox | `interact.py`: "marketing unchecked by default" | | Explicit consent required before submit | `landing.js` `submitEnquiry()` | `interact.py`: consent error on empty submit | | UK phone validation | `landing.js` `ukPhoneValid()` | `interact.py`: "bad phone rejected" | | Date bounded to today…+180 days | `landing.js` `initBookingForm()` | `min`/`max` attributes + submit validation | | No transmission of enquiry data | `landing.js` | Payload is displayed and copied only; no `fetch` | | Placeholder phone never presented as dialable | `data.js` `PHONE_PLACEHOLDER` + `renderContact()` | Phone row hidden; notice shown instead | | Draft/live separation (students cannot see drafts) | `portal.js` `isDirty()`, `initPublish()` | `interact.py`: "draft does not leak to live" | | Destructive actions confirmed | `portal.js` `askConfirm()` | `interact.py`: "delete confirm opens" / "cancel keeps lesson" | | Portrait of privacy defaults, locked in UI | `portal/index.html` Settings | 5 locked items rendered | | Reduced-motion honoured | `tokens.css`, `landing.css` | `a11y.py`: 5 reduced-motion checks pass | | Accessible names, labels, focus trap, Escape | all pages | `a11y.py`: 0 issues across 4 viewports | | No horizontal overflow at 320 px | CSS | `a11y.py`: 320×700 passes | | Portal requires an authenticated session | `serve.mjs` gate before filesystem access | Unauthenticated `GET /portal/` → 302, zero portal bytes returned | | Admin and Settings are owner-only | `auth.mjs` `AREA_ROLES` | Staff session → 403 on `/portal/admin` and `/portal/settings` | | **No passwords stored anywhere** | `auth.mjs` `loadUsers()`, `otp.mjs` | `grep -r argon2` returns nothing; login page has no password field | | Code single-use and destroyed on use | `otp.mjs` `verify()` | Replay of a used code → 401; verified over HTTP | | Code destroyed after 5 wrong attempts | `otp.mjs` `verify()` | 6th attempt → `locked`; the **correct** code is then rejected too | | Code expires after 5 minutes | `otp.mjs` `OTP_LIMITS.ttlMs` | Short-TTL store test: expired code → 401 `expired` | | Code requests rate-limited | `serve.mjs` + `RequestLimiter` | 4th request for one address within 15 min → 429 | | No user enumeration | `serve.mjs` `handleLoginRequest()` | Unknown and known addresses return identical JSON shape and status; mail is only sent for a real account | | Session cookie not readable by script | `auth.mjs` `buildSessionCookie()` | `HttpOnly; SameSite=Strict; Path=/` (+`Secure` under TLS) | | Session tokens unguessable and un-replayable after logout | `auth.mjs` `SessionStore` | 32-byte CSPRNG token; only SHA-256 stored; old token → 401 after logout | | Brute force limited | `otp.mjs` attempt cap + `RateLimiter` | 5 wrong codes → challenge destroyed; 6th verify → 429 with `Retry-After` | | CSRF on authenticated writes | `auth.mjs` `verifyCsrf()` | POST without token → 403; with valid token → passes the CSRF layer | | Sign out available on mobile | `portal.css` | `.topbar-actions > .btn-ghost` hidden, logout form explicitly kept visible | --- ## 5. Consultation | Stakeholder | Status | |---|---| | Owner (Diana) | **Required** — must confirm the open issues in §9 before launch | | Staff who will use the portal | **Required** — 30-minute usability session on the course builder | | Students (16–17 band especially) | **Required** — review the age-appropriate notices in `/privacy/` for comprehension | | Parents of prospective students | Recommended — review the under-18 section | | ICO guidance | Consulted (Children's Code, DPIA guidance, PECR marketing rules) | --- ## 6. Residual risk and sign-off | Residual risk | Level | Accepted by | Date | |---|---|---|---| | Enquiry from a 13–17 year old answered without verification of age | Low–Medium | *pending owner sign-off* | — | | No server-side enforcement of the publish boundary at v1.0 (a technically able user could edit localStorage) | Low | *pending* — acceptable because v1.0 stores no third-party personal data | — | | Quiz marked in the browser at v1.0 | Low | *pending* — must move server-side before real certification | — | **This DPIA is not approved until the owner signs §9 and the pre-launch gates in §7 are closed.** --- ## 7. Pre-launch gates (blocking before v1.1) 1. [ ] Resolve the four owner decisions in `../README.md` §Open issues (phone, price set, address confirmation, chat assistant scope). 2. [ ] Move quiz marking server-side; a tampered request must not force a pass. 3. [ ] Enforce tenant/role isolation in the query layer, not just the UI. 4. [ ] Add an append-only audit store; app role must not have UPDATE/DELETE on it. 5. [ ] Implement genuine deletion (hard delete or irreversible anonymisation) across DB, cache, object storage and search index — `is_deleted = true` is not sufficient. 6. [ ] Retention job running in dry-run, then enabled. 7. [ ] Integrate a payment provider using hosted fields only (no card data on our servers). 8. [x] **Chat assistant built in deterministic-only mode.** No LLM, no network call, no API key in the browser. Safeguarding path implemented (zero offers, clear basket, 0808 2000 247 and 999). Lead hand-off is clipboard-only and states plainly that nothing was transmitted. [ ] Still outstanding **only if** a language model is ever introduced: the server-side proxy. A model must never be called with a browser-side key. 9. [ ] Re-run this DPIA and sign it. 10. [ ] Publish the named DPO/contact and the ICO complaint route (already drafted on `/privacy/`). --- ## 8. Verification evidence Run against the v1.0 build over a local HTTP server with headless Chromium: | Suite | Result | |---|---| | Load + console + network (`smoke.py`) | PASS — 0 exceptions, 0 console errors, 0 third-party requests on all three pages | | Interaction (`interact.py`) | PASS — 40 checks (form validation, lightbox, publish boundary, quiz gate, reorder, delete confirm, reset, theme) | | Responsive + a11y + reduced motion (`a11y.py`) | PASS — 3 pages × 4 viewports (1440/820/390/320), no overflow, no unlabelled fields, no duplicate ids, no heading jumps, reduced-motion honoured | The test harnesses live in `/tmp` during this build and are not shipped. Recreate them in CI when the backend lands. --- ## 9. Open issues requiring owner decision | # | Issue | Blocking | Why it matters legally | |---|---|---|---| | 1 | Direct phone number is unconfirmed (placeholder) | Yes | A privacy notice must state how to exercise rights by a route that works; the form degrades to "copy details", which is unusual | | 2 | Canonical price set (landing vs chat catalogue vs Versum export) | No | Displaying two price lists is a consumer-protection and transparency problem, not a data-protection one | | 3 | Confirm 92 Cornwall Street, Plymouth is the current address | Yes | It appears in the privacy notice as the place to exercise rights | | 4 | Whether an AI chat assistant will be added at all | **Closed** | Decided: built as a deterministic rules engine with no LLM. The safeguarding path is in scope and implemented; the LLM proxy is out of scope unless a model is added later | | 5 | Whether under-18s may ever be enrolled | Yes | Determines whether age assurance is needed, or whether the adult-only rule stands | | 6 | Identity of the DPO / privacy contact | Yes | Article 13(1)(b) requires it to be named | | 7 | **Staff privacy notice** for the authentication processing | Yes | Article 13 requires staff to be told what is collected, why, the lawful basis and retention. Not yet written | | 8 | **Session store is in memory** — restart signs everyone out, limits are per-process | Yes (before production) | Not a legal defect, but a control that does not survive a restart or a second replica is not a control. Needs Redis or a Postgres table | | 9 | No MFA and no lockout notification for the owner account | No (recommended) | The owner account can reach Admin; a single password is the only thing in front of it | | 10 | **Compliance documents are published publicly** (DPIA, Children's Code assessment, ROPA) | No — owner decision | The footer and `/privacy/` link to them, so they must be reachable; they previously returned 403 because `compliance/` was excluded from the image and denied in `serve.mjs`. **Residual risk accepted by the owner:** these documents describe internal controls (one-time-code design, rate limits, break-glass recovery, retention). Publishing them gives an attacker a map, though none of it is a secret that provides access — there are no credentials, keys or personal data in them. Mitigation: the documents contain no secrets by construction, and this is reviewed whenever they change. Revisit if any document starts to carry operational detail that would materially help an attacker | --- *Prepared for Diana Beauty School Plymouth. This document is a draft assessment, not legal advice.*