Skip to content
live350 pts

Her laptop said goodbye before she did

41 GB of customer rows walked out over three afternoons. Every query was technically allowed.

The scene

Reported: a customer finds their account rows inside a paste advertised as "38M records — sudosec forums dump". Legal wants the how before Friday.

DB audit log — principal moka, senior backend engineer, on the read replica:

Dec 08 13:02  moka@10.8.0.44  SELECT count(*) FROM customers;
Dec 08 13:04  moka@10.8.0.44  COPY (SELECT * FROM customers ORDER BY id
                              LIMIT 50000 OFFSET 0) TO STDOUT;
Dec 08 13:11  moka@10.8.0.44  COPY (SELECT * FROM customers ORDER BY id
                              LIMIT 50000 OFFSET 50000) TO STDOUT;
…                                   # 763 more COPY statements

Three afternoons — Tue/Wed/Thu, 13:00–16:40 — 41.3 GB of COPY … TO STDOUT and paged SELECTs covering customers, orders, payment_methods (tokenized, luckily), api_keys, support_tickets, and private_messages.

Session metadata: application name psql, source 10.8.0.44 (office VPN pool), TLS verified, role analytics_reader — read-only, legitimately granted six months ago for the metrics project:

forums=> \du moka
  Role: moka   Member of: analytics_reader   Valid until: (none)
forums=> select grantee, privilege_type from information_schema
         .role_table_grants where grantee='analytics_reader' limit 3;
analytics_reader | SELECT
analytics_reader | SELECT            # COPY TO inherits SELECT — by design

VPN DHCP lease logs bind 10.8.0.44 to her workstation's MAC for the whole window.

Alert config:

dlp_rules:
  - name: big-query
    match: rows_returned > 1_000_000 per single query
  - name: exfil-egress
    match: outbound_bytes > 5 GB per session per day   # proxy only

The proxy rule can't see psql — VPN traffic to the replica isn't proxied. The per-query rule never fired: every COPY stopped at 50k rows. 765 of them still sum to the entire schema. The DLP incident queue for December shows zero matches.

HR timeline:

Nov 30  resignation letter drafted (Docs version history, 18:42)
Dec 07  offer letter signed with a competitor; calendar shows
        "dentist" blocks Tue/Wed/Thu afternoons
Dec 11  resignation tendered to her manager
Dec 18  last day scheduled

The bulk reads started Dec 08 — a day after the offer was signed, three days before anyone at the company knew.

Git mirror: git clone of 14 private repos on Monday Dec 07 — "handoff prep", she told her manager; all authorized, all within policy.

Endpoint telemetry:

Dec 10 16:52  usb_mount  volume=128GB exfat   (first external mount in 3 yrs)
Dec 10 16:47  mdm: dropbox.app installed      (personal account, not the org's)
Dec 11 02:11  dropbox first-sync, 39.8 GB, from her home IP
Dec 10 13:15  prefetch: export.ps1 executed   (one-shot wrapper: psql loop,
                                             gzip, writes to usb volume)

Baseline vs incident window:

dayqueriesrows returnedGB out
normal weekday~300~40k0.1
Dec 0812,1029.4M12.7
Dec 099,8477.9M11.9
Dec 1014,36312.1M16.7
  • pg_stat_statements shows ORDER BY id added to every COPY — deterministic, resumable pagination. Chunk intervals run 4–7 seconds apart, metronome-steady. No human types that evenly.
  • The paste's customers.csv is ordered id ascending — identical to her pagination order, including the LIMIT 50000 boundary artifacts where duplicate timestamps would otherwise interleave.
  • The exfil stops Thursday 16:40. The USB mount is Thursday 16:52.
  • She never touched the audit_log table — didn't need to; it's a table, not a tripwire.
  • Nobody else queried the replica those afternoons. The metrics dashboards she was "working on" have no new generated SQL that week.
  • Her manager's calendar: she was in no meetings during the query windows — the "dentist" blocks.

The paste itself (first rows of the advertised sample):

id,email,created_at,plan
10041,dan@acme.com,2025-11-02,business-10
10042,billing@blueteam.io,2025-11-02,team-5

Row 10041's created_at matches production to the second. The sample's api_keys.csv lists live key hashes — six already confirmed against prod (which means they're burned and need rotation regardless of how the rest plays out).

Her access history:

forums=> select granted_at, granted_by from role_audit
         where role='analytics_reader' and member='moka';
2026-06-02   dba-lead   "metrics project"

Six months of legitimate use before this. TLS on her sessions verified with her own client cert; MFA clean; the credential was hers — nothing was stolen. The question was never who; it's how much.

What it's not:

  • Not a credential theft — MFA, cert pinning, and her own VPN session all check out; every row was read by the person the badge belongs to.

  • Not a SQL injection path — COPY TO STDOUT is a granted, intended capability of her role.

  • Not a DLP rule failure — the rules ran fine; they were scoped to a pipe the traffic never entered.

  • The replica's pg_stat_activity snapshot shows her psql sessions held idle in transaction for minutes between chunks — a script pacing itself, not a human browsing.

  • Workstation prefetch records export.ps1 ran Thursday 13:15 — a one-shot wrapper: psql loop, gzip, writes straight to the USB volume.

  • Legal's evidence checklist needs the audit rows, the MDM sync log, and the paste's row ordering — all present and mutually consistent.

Diagnoses — hidden until the incident closes

Sign in to post your root-cause diagnosis.