Join our Newsletter — 33% off our NHI Course
Home› Guides› Leaked API Key Tabletop Exercise Kit: A Ready-to-Run…
Template Incident Response & Forensics

Leaked API Key Tabletop Exercise Kit: A Ready-to-Run Secrets Exposure Scenario

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

Most teams have a written process for a leaked API key, but few have tested who actually decides to revoke a key that production depends on, how long it takes to find every place the key lives, and who tells a customer or partner that their data may have been read. This template is a ready-to-run tabletop exercise built around a fictional organisation whose payment-integration API key is found in a public code repository. It gives facilitator timings, role cards, four timed injects with decision points, a scoring sheet and debrief questions. It is vendor-neutral: placeholders in square brackets stand for your own code host, secrets manager, cloud provider and SIEM. It is written for incident response leads, DevSecOps and platform engineering leads, and the owners of the services that depend on machine credentials. For planning exercises in general see the Tabletop Exercise Guide.

Key takeaways

  • Ownership decides the clock: the slowest step in most leaked key responses is finding who owns the key and who may revoke it, so the exercise tests that before anything technical.
  • Revoke first is a decision, not a reflex: immediate revocation is the right default, as OWASP advises, but the room must weigh it against an outage and agree who accepts that cost.
  • Blast radius is permissions plus history: responders need both what the key could do and what it did, which depends on logs existing before the incident.
  • Removing the key from the repository is not containment: forks, clones, caches and build logs keep copies, so only revocation or rotation closes the exposure.
  • The output is a backlog: the exercise ends with named owners for inventory, logging, rotation automation and communication gaps.

How to use this template

Run the exercise as a facilitated discussion lasting about 2.5 hours. Replace every placeholder in square brackets with your own systems before the session. Share the scenario setup and role cards as pre-reading; keep the injects and expected decisions with the facilitator. The structure follows the NIST SP 800-84 cycle of design, development, conduct and evaluation, and mirrors the CISA Tabletop Exercise Packages model of objectives, scenario, discussion questions, feedback form and After Action Report.

  1. Tailor (2 weeks before): map the fictional systems to real ones: [code host], [secrets manager], [cloud provider], [API provider], [SIEM], [ticketing system], [status page].
  2. Check facts privately (1 week before): find out whether your key provider logs usage per key, whether keys can be scoped or rotated without downtime, and whether your secret scanning alerts reach a named person. These answers often become the main findings.
  3. Brief the room (10 minutes): no-fault, decisions over answers, the facilitator may move time forward, and the organisation in the scenario is fictional.
  4. Run the injects: read each inject aloud, allow discussion against its questions, and capture decisions, owners, times and open questions in a shared log.
  5. Score and debrief: complete the scoring sheet together, run the hot wash, and schedule the after-action review within five working days. Record it with the Tabletop Exercise After Action Report Template.

Facilitator timings

SegmentMinutesScenario timeFacilitator focus
Welcome, rules, objectives10NoneSet no-fault tone, confirm roles
Scenario setup10Day 1, 09:00Walk the system diagram
Inject 1: discovery25Day 1, 09:12Triage, ownership, first decision
Inject 2: blast radius30Day 1, 10:30Permissions, usage history, evidence
Break10NoneFacilitator checks the log
Inject 3: revocation and rotation30Day 1, 11:15Outage trade-off, copies of the key
Inject 4: communication20Day 2, 08:30Internal, customer, provider, regulator
Scoring and debrief15NoneScoring sheet, hot wash, owners

Objectives

  • Confirm that a secret scanning alert reaches someone who can act within the agreed time.
  • Test the decision path for revoking a credential that production depends on.
  • Test the ability to establish what a key could access and what it did.
  • Test internal and external communication for a credential exposure.

Scenario setup

Setting: [Organisation] is a fictional mid-sized online retailer. Its checkout service calls [API provider], a payments and refunds platform, using a single long-lived API key with read and write scope over orders, refunds and customer records. The key is stored in [secrets manager] for production, but a copy also sits in a developer's local .env file used for testing. Six months ago a contractor built a reconciliation script that uses the same key. The key has never been rotated. [SIEM] receives code host audit logs but not [API provider] usage logs, which are available only in the provider's dashboard.

Incident (facilitator only): a developer pushed a branch containing the .env file to a public repository on [code host] at 08:47. The file was public for 3 hours before the branch was deleted. An automated scraper copied the key within minutes and made a small number of read requests that afternoon, followed by a refund request the next morning. The participants learn these facts only through the injects.

Role cards

RoleOwns in the exerciseKey question to hold
Incident commanderSeverity, decisions log, escalationWho is authorised to accept an outage to contain this?
Security operations analystAlert triage, log searches, evidenceWhat do we know for certain, and what are we assuming?
Service owner (checkout)Business impact, maintenance windowsWhat breaks, for whom, and for how long, if the key is revoked now?
Platform or DevSecOps leadSecrets manager, pipelines, rotationWhere else is this key deployed, and can we rotate without a deploy?
Developer who pushed the fileTimeline, local copiesExactly what was pushed, where, and when?
Legal and privacy leadNotification analysisDoes any of this trigger a notification duty, and by when?
Communications leadCustomer, partner and internal messagesWhat do we say, to whom, and who approves it?
Third-party managerContact with [API provider] and the contractorWhat can the provider tell us, and what must the contractor do?

Smaller teams can combine roles, but keep the incident commander separate from the service owner so the outage decision is visible.

Inject 1: discovery

Day 1, 09:12. [Code host] secret scanning raises an alert for a string matching [API provider]'s key format in a public repository under [Organisation]'s account. The alert goes to a shared security mailbox. At 09:40 an external researcher also posts in [Organisation]'s vulnerability disclosure channel saying they have seen the key.

Questions:

  • Who sees the alert first, and how long until someone with authority knows?
  • How do you confirm the key is real, live and yours without using it to call production systems?
  • Who owns this key? Where is that recorded?
  • What severity do you assign, and what does that trigger?

Decision point 1: revoke immediately, or first find dependants and rotate in a controlled way? Record who made the decision and on what information.

Expected in a prepared team: the alert routes to an on-call person, the key appears in an inventory with a named owner, and the default is immediate revocation unless the owner can show a rotation path within a short agreed window. See Developer Secret Scanning Triage.

Inject 2: blast radius

Day 1, 10:30. The [API provider] dashboard shows the key has read and write scope over orders, refunds and customer records. Usage history shows normal traffic from checkout servers plus 14 read requests from an unfamiliar IP range starting at 09:03. The platform lead finds the key in three places: [secrets manager], the developer's laptop and the contractor's reconciliation script.

Questions:

  • What could this key do, and what did it actually do? Which records could the 14 reads have returned?
  • How long does the provider keep usage logs, and who is exporting them now before they age out?
  • Was the repository forked or cloned while public? What does [code host] audit data show?
  • Does the contractor still need access, and who manages that relationship?

Decision point 2: does this become a personal data incident now, or only if customer records are confirmed in the responses? Who decides, and what evidence would change the answer?

Expected: logs exported and preserved, a written scope statement separating "could access" from "did access", and the legal lead engaged early. See How to work out what a leaked API key could access and what it actually did.

Inject 3: revocation and rotation

Day 1, 11:15. The service owner says revoking the key will stop checkout for an estimated 20 minutes while a new key is deployed, during a sales campaign. The platform lead reports the pipeline can inject a new key from [secrets manager] but the contractor's script has the key hard-coded. The developer reports the branch has been deleted.

Questions:

  • Does deleting the branch contain anything? What about forks, clones, caches and CI logs?
  • Can a second key be issued and deployed before the first is revoked, and does [API provider] allow two active keys?
  • Who accepts the 20 minute outage if overlap is not possible?
  • Can the new key be scoped more narrowly, for example refunds only from checkout, read-only for reconciliation?
  • How will you confirm the old key is dead and nothing legitimate still uses it?

Decision point 3: overlap rotation with a short window of exposure, or immediate revocation with an outage. Record the decision, the approver and the time the old key stopped working.

Expected: revocation or rotation completed the same morning, separate keys per consumer, the hard-coded copy replaced, and the history rewrite treated as clean-up rather than containment, since OWASP notes rewriting git history needs careful planning. See Deleted but Not Revoked and the API Key Leak Response Playbook.

Inject 4: communication

Day 2, 08:30. Overnight, [API provider] usage logs show a refund request made with the old key at 07:55, before revocation took effect in one region, to an account not linked to any customer order. The provider's security team emails asking whether [Organisation] authorised it. A journalist messages the press office after the researcher posts about the exposure.

Questions:

  • Who speaks to the provider, the researcher, the journalist, customers and staff, and who approves each message?
  • Does the confirmed misuse change the notification analysis? Which rule applies, and what is the deadline?
  • Was the old key fully revoked everywhere? Why did a request succeed after the decision?
  • What does the status page say, if anything?

Decision point 4: notify customers now on current evidence, or wait for the provider's investigation? Record the reasoning.

Expected: one approved holding statement, a single point of contact for the provider, a timed notification decision recorded by the legal lead, and a check that revocation took effect across every region and key copy.

Scoring sheet

Score each area 0 to 3 as a group: 0 not done or not possible, 1 possible but slow or reliant on one person, 2 done with gaps, 3 done within target. Scores track improvement between exercises; they are not a pass mark.

AreaWhat a 3 looks likeTargetScore
Alert routingAlert reaches a named on-call person automatically[15 minutes][ ]
OwnershipKey owner and dependants found in an inventory[30 minutes][ ]
Revocation decisionDecision made by an authorised person and logged[1 hour from alert][ ]
Blast radiusWritten could-access and did-access statement[4 hours][ ]
EvidenceProvider and code host logs exported and preserved[Same day][ ]
RotationNew scoped keys deployed, old key confirmed dead[Same day][ ]
Copies removedLocal, contractor and history copies addressed[3 days][ ]
CommunicationApproved messages, notification decision recorded[Per policy][ ]

Debrief questions

  • Timeline: where did the most time go between the push at 08:47 and the key being dead?
  • Prevention: what would have stopped the push: pre-commit scanning, push protection, or not having a production key on a laptop?
  • Design: why did three consumers share one key with write scope, and what would per-consumer, least-privilege keys have changed?
  • Logging: which logs did you wish you had in [SIEM], and how long are provider logs kept?
  • Authority: was anyone unsure whether they could revoke the key? Where should that authority be written down?
  • Third parties: how do you know which contractors and suppliers hold your keys?
  • Next time: which three backlog items, with owners and dates, come out of today?

Feed the findings into your improvement process, as NIST CSF 2.0 ID.IM-02 expects for improvements identified from exercises.

Practitioner checklist

  • Tailor the placeholders and confirm the private fact-check answers before the session.
  • Invite the service owner and legal lead, not only security and engineering.
  • Keep injects and expected decisions with the facilitator; share only the setup and role cards.
  • Log every decision with the approver and the scenario time.
  • Complete the scoring sheet together and keep it for comparison with the next run.
  • Turn each gap into a backlog item with an owner and a date, and record it in an after-action report.
  • Re-run the scenario within 12 months, or after major changes to secrets management.

Standards and references

Related NHI Mgmt Group resources: Tabletop Exercise Guide · Tabletop Exercise Scenario Pack · Identity Attack Tabletop Exercise Scenarios · API Key Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.