# TEPL DHMS — VAPT scope and rules of engagement

For the security testers engaged for weeks 14–15. Agree dates, source IPs and
contacts in writing before testing starts.

## In scope

| Target | What |
|---|---|
| Web app (staging) | The React portal at the staging URL — desktop and phone widths; every role below |
| API (staging) | `https://<staging-api>/api/*` — JWT sign-in, refresh cookie, two-step sign-in |
| Device / feed endpoints | `POST /api/biometric/punches`, `/api/energy/readings`, `/api/canteen/swipes`, `/api/asset-tags/reads`, `/api/integrations/roster`, `/api/integrations/plant-leave`, `/api/laundry/feed` — `X-Device-Serial` + `X-Device-Key` |
| File handling | Attachments (photos, PDFs) on requests, cleaning, work orders, medical, compliance; Excel imports and downloads |

Out of scope: the live HostelCare servers and their data, the platform
super-admin and CRM, third-party services (Meta/WhatsApp, the mail provider,
payment gateways, S3), denial-of-service and load tests, social engineering,
physical access.

## Accounts

One tenant, "TEPL Employee Hostel (Demo)", made fresh with
`npm run seed:enterprise-demo -- --reset`. Passwords are given to the testers
separately, never in this document. A second tenant is created for
cross-tenant tests.

| Role | Login (`@demo.example`) | Can |
|---|---|---|
| Owner | `admin` | everything in the tenant except opening medical records |
| Wardens | `warden.a`, `warden.b` | residents, rooms, gate, terminals (not system-feed keys) |
| Canteen | `canteen` | mess and canteen |
| Security | `security.a` | gate only |
| Plant approvers | `plant.assembly`, `plant.quality` | the plant step of leave, for their departments |
| Housekeeping | `housekeeping` (supervisor), `housekeeper1/2`, `electrician` | cleaning, laundry desk; their own tasks |
| OHC | `ohc` | medical records (sealed; every look logged) |
| Leadership | `leadership` | leadership dashboard, compliance (read) |
| EHS | `ehs` | statutory compliance |
| Employees | `employee1–3` | their own leave, requests, health, laundry, feedback… |

Device keys for each feed are issued by the owner on request.

## What we most want tested

1. **Tenant isolation** — any way for one tenant's user, device key or report
   schedule to read or change another tenant's data.
2. **Role boundaries** — custom roles grant permissions; check each role above
   against what it should not reach. Employees must never reach other
   employees' records (leave, requests, medical, special needs, laundry,
   feedback identity).
3. **Medical records** — only OHC logins may read clinical content; the owner
   sees counts and the access log, never content; every look is logged; no one
   can grant themselves OHC access.
4. **Anonymity** — anonymous complaints and feedback must not reveal who wrote
   them, to any role.
5. **Device endpoints** — purpose checks (a key for one feed used on another),
   replay, brute force on keys, oversized batches.
6. **Outbound calls** — the BMS pull address (owner sets it in Energy →
   Settings): SSRF to internal or metadata addresses.
7. **Files** — upload type and size checks, download authorisation, Excel
   formula injection in exports.

## Rules

- Test only the staging hosts and accounts above, from the agreed IPs.
- Stop and call us on finding anything that exposes real personal data, or
  that would let you leave the staging environment.
- No destructive tests on shared infrastructure; deleting records inside the
  demo tenant is fine — we reseed.
- Report each finding with steps, the request and response, severity (CVSS
  3.1) and a suggested fix. We fix and send back for retest within the
  window.

## Already reviewed

A pre-VAPT code review on 3 Nov 2026 covered isolation, authorisation, device
keys, SSRF, crypto, files and notifications; its fixes are listed under
"Security changes in this release" in `release-candidate.md`.
