CSC-210 study materials
CSC-210 study resources

The Debug Log That Recorded Session Tokens

CSC-210 · Put your knowledge to work in context.

All case studies

The Debug Log That Recorded Session Tokens

Vaultly is a five-year-old payments-adjacent startup processing card-on-file transactions for 1,200 small merchants. On a Tuesday, a contractor investigating log volume discovers that for 23 days the production API gateway has written full request headers - including the Authorization bearer token and the customer's full bank account number on a legacy ACH endpoint - to a third-party log-analytics SaaS at DEBUG level. About 240,000 requests are affected, touching the end customers of 61 merchants. The configuration change that enabled DEBUG was made during an incident and merged without review, because the config repository has no required reviewers. The CTO wants to delete the affected log indices immediately, tell nobody outside the company, rotate the gateway signing key, and move on, because the log vendor is under contract and encrypted at rest. The head of legal says the incident may not be reportable because there is no evidence of access. A junior engineer asks you, the senior engineer on call, whether deleting the logs is the right call. Vaultly operates under a 72-hour breach-notification regime and has a 24-hour notification clause with two acquiring banks.

1. Answer the junior engineer. Is deleting the logs acceptable? Give the reasoning, including what should happen to the data instead.

Read the worked answer

No, and the reason matters more than the verdict. Deleting the affected indices would destroy the only record of what was exposed, to whom, and for how long - the evidence needed to scope the incident, notify accurately, and defend the company's conduct. In most breach-notification regimes, destruction of evidence after discovery is treated as an aggravating factor and can be an independent violation; it converts a containment failure into an obstruction narrative. It also routinely fails: index deletion in a SaaS logging platform usually leaves backups, replicas, and the vendor's own retention copies, so the company would carry the appearance of concealment without achieving concealment.

What to do instead - separate remediation from evidence handling:

  • Remediate the exposure. Disable DEBUG on the gateway, add field-level redaction for Authorization headers and account numbers at the logging library, invalidate the exposed bearer tokens (they are live credentials - anything written to a third-party system must be treated as compromised), rotate the gateway signing key, and add a short-lived token policy. Remediation is about stopping ongoing harm; it is not about the archive.
  • Preserve the archive. Snapshot the affected indices, compute a hash for integrity, restrict access to a named incident team, and start a chain-of-custody log. Preservation is not the same as continued exposure: access control, not deletion.
  • Then get legal to set a retention schedule for the preserved copy, in writing, once notification obligations are discharged.

The principle to give the junior engineer: in an incident, the instinct to make the problem disappear is exactly the instinct that turns a technical incident into a legal and ethical one. The question 'can we delete this' should be answered by counsel with a retention decision, not by the person who is embarrassed by the log.

2. What are Vaultly's notification obligations, and how would you sequence the first 72 hours?

Read the worked answer

The binding clock is 24 hours, not 72. The acquiring-bank contracts require notification within 24 hours, which is stricter than the statutory regime. Where contractual and statutory timelines differ, the shortest one governs operations. The CTO's plan breaches the bank clause on day one, before any regulator is involved.

'No evidence of access' is the wrong test. Modern regimes generally ask whether there is a reasonable belief of unauthorised acquisition or a risk of harm to individuals, and several presume risk where credentials and financial account numbers are involved. Here the exposure includes full bank account numbers and live bearer tokens - the tokens alone allow account takeover without any further breach. Waiting for proof of access would mean notifying only after the harm has already occurred, which inverts the purpose of the rule. Legal should be told plainly that the assessment needs to be made against the actual regulatory standard and documented, not asserted in a corridor.

Sequencing:

  • Hours 0-4, contain. Disable DEBUG, redact, invalidate all tokens issued in the window, rotate signing keys, restrict access to the log indices, open an incident channel with a named incident commander and a scribe. Preserve evidence.
  • Hours 4-12, scope. Query the 240,000 requests: which merchants, which data elements, exact date range, whether the log vendor's subprocessors received the data. Notify the log vendor as a processor under the data processing agreement - their cooperation and their own obligations are part of the timeline.
  • Hours 12-24, notify the banks under the contract clause, with the scope as known and an explicit statement of what is still unknown.
  • Hours 24-72, regulator and individuals, as counsel directs, with the statutory clock running from awareness - and awareness arguably began Tuesday, not when the report is drafted.

Throughout: one decision log with timestamps, decision-maker, and rationale. In a post-incident review, the log is what demonstrates the company acted reasonably under pressure.

3. What caused this beyond the config edit, and what are your professional obligations if the CTO's plan stands?

Read the worked answer

Causes, in order of leverage:

  1. No review on production configuration. A config repo without required reviewers means any incident-time expedient ships unreviewed. Protected branches, mandatory review for the production config path, and a two-person rule for changes touching logging or authentication are the direct fix.
  2. Denylist thinking in the logging library. Redaction was presumably absent or field-name-based. The durable design is an allowlist: log a defined schema of fields, never raw headers or request bodies, so a new sensitive field cannot leak by default. Sensitive-field detection at the library boundary, not at review time.
  3. No automated detection. Add secret and account-number pattern scanning over log output in CI and in pre-production, plus periodic egress sampling; add canary values in test data so a leak is caught by a monitor rather than by a curious contractor.
  4. Incident-time change culture. Debug-level logging turned on during an incident should have an automatic expiry (a 4-hour TTL) so forgetting cannot become a 23-day exposure.

Professional obligations if the CTO's plan stands. The duty to the public and to avoid harm is not subordinate to the employer's commercial preference; the codes of conduct that govern software engineers place public safety and honesty above loyalty to a manager. Concretely: state the objection in writing with the reasoning and the recommended alternative, copy legal and the security lead, and ask for a written decision from whoever accepts the risk. If the decision is to suppress notification despite a live credential exposure affecting 61 merchants, escalate to the board or audit committee, and use the whistleblower channel if the company has one. Document every step. This is not insubordination; it is the professional record that distinguishes a company that made a bad call under pressure from a company in which no engineer raised a concern.

And answer the question the CTO is really asking: deletion does not reduce liability, it removes the ability to demonstrate that the exposure was bounded and remediated quickly. The cheapest defensible path is fast containment, fast notification, and a documented fix - which is also the right one.