A stolen signing key lets an attacker produce software or tokens that your own systems, and your customers' systems, accept as genuine, and most organisations have never rehearsed what they would do about it. This guide is a ready-to-run tabletop exercise built around a fictional company that discovers one of its private signing keys has been exposed. It runs two tracks in parallel: a code signing key used to sign release builds, and a token signing key whose public half is published in a JSON Web Key Set (JWKS) for customers' services to verify access tokens. Each inject has a time, an event, discussion questions and the decisions a well-prepared team should reach. It is for incident response leads, PKI and key owners, and engineering managers who sign software or run an identity provider. For the general method of running exercises, see the Tabletop Exercise Guide; for the live response procedure, see the Compromised Code Signing Certificate Playbook.
Key takeaways
- Revoke and rotate are different decisions: rotation stops new misuse, revocation (or removal from the JWKS) withdraws trust in what was already signed, and each has its own blast radius.
- Token keys and code keys fail differently: removing a key from a JWKS ends forged tokens within cache lifetimes, while a revoked code signing certificate can break software already installed on customer machines.
- Custody evidence decides the scope: HSM audit logs, signing service logs and key export settings tell you whether the key could have left your control, and whether forgeries can be told apart from genuine output.
- Verifiers matter as much as signers: in the Storm-0558 intrusion a consumer signing key was accepted for enterprise mailboxes because scope checks were missing on the verifying side.
- Rehearse the customer message: customers may need to update software, block hashes or refresh key caches, so the communication is part of containment, not an afterthought.
Scenario overview and objectives
The scenario is fictional. Fernhill Software (a fictional company) ships a desktop agent and a cloud platform. Its build pipeline signs Windows and macOS releases through a signing service backed by a hardware security module (HSM). Its identity service issues JSON Web Tokens (JWTs) to customers' integrations, signed with a private key; the public keys are published at a JWKS endpoint and selected by the kid (key ID) header, which RFC 7517 describes as the way to choose among keys in a set during key rollover.
The exercise runs for about three hours across four injects. It is discussion based: no systems are touched.
Objectives
- Confirm who can declare a key compromise and who owns each key, by name.
- Practise scoping: which artefacts and tokens were signed, by whom, and whether forgeries are detectable.
- Decide between rotate only, rotate and revoke, and revoke with a backdated revocation date, and accept the customer impact of each.
- Agree customer, partner and regulator communication, including what customers must do.
- Identify gaps in key custody, logging and verifier configuration to fix after the exercise.
Token signing versus code signing
| Aspect | Token signing key (JWKS) | Code signing key |
|---|---|---|
| What a thief can forge | Access or ID tokens for any user or client the verifier trusts the key for | Software that appears to come from you, including malware |
| Lifetime of forged output | Minutes to hours (token expiry), but new forgeries possible while the key is trusted | Indefinite where signatures are timestamped and the certificate is not revoked |
| How trust is withdrawn | Remove the key from the JWKS; verifiers drop it when their cache refreshes | CA revokes the certificate; platform vendors may also block it; customers block hashes |
| Collateral damage | Valid sessions signed with the old key fail and users sign in again | Genuine releases signed after the revocation date stop verifying and may not run |
| Who must act outside your organisation | Customers whose services cache your JWKS or pin keys | Certificate authority, OS platform vendors, customers, package repositories |
| Deeper guidance | JSON Web Key Sets (JWKS) and Signing Key Rotation Guide | Code Signing Security Guide |
Facilitators can run both tracks, or pick one for a shorter session.
Participants and preparation
| Role | Why they are in the room |
|---|---|
| Facilitator | Delivers injects, keeps time, pushes for decisions; not a participant |
| Incident commander | Declares severity, owns the decision log |
| PKI or key owner | Knows where each key lives, its certificate chain, CA contacts and revocation process |
| Identity service engineering lead | Owns the token issuer, JWKS endpoint and verifier libraries |
| Build and release engineering lead | Owns the pipeline, signing service and release history |
| Security operations | Brings HSM, signing service and cloud audit logs; runs threat hunting |
| Legal, privacy and communications | Notification duties, customer advisories, regulator contact |
| Customer support lead | Predicts customer impact of revocation and token invalidation |
| Observer or scribe | Records decisions, times and gaps for the after action report |
Before the day: collect the real key inventory (key IDs, algorithms, HSM partitions, certificate serial numbers, expiry dates), the CA's revocation procedure, JWKS cache settings, and token lifetimes. Gaps found while collecting these are findings in their own right. CISA's Tabletop Exercise Packages provide planning templates, role guidance, a feedback form and an after action report template that can be adapted to this scenario. NIST SP 800-84 covers the design, conduct and evaluation of exercise programmes.
Ground rules: no fault finding, answer as the organisation is today rather than as it should be, and record every "we do not know" as an action.
Inject 1 Discovery
| Time | Event | Questions |
|---|---|---|
| T+0 | A threat intelligence partner reports a malware sample signed with a Fernhill code signing certificate, serial number matching the current release certificate. | Who receives this report and how fast does it reach the key owner? How do you confirm the signature is yours and not a lookalike certificate? |
| T+20m | Separately, an engineer finds an unencrypted copy of a PEM private key in a build cache bucket that was briefly public. Its kid matches a key in the production JWKS. | Is this one incident or two? Who declares a key compromise, and on what evidence? |
| T+40m | The signing service shows no record of signing the malware sample. | Does that mean the key left the HSM, or that someone used the service without logging? What would tell you which? |
Expected decisions: declare a key compromise incident with a named commander; treat both keys as compromised until custody evidence says otherwise; preserve logs before anyone rotates anything; open a decision log. A team should also ask whether the token key copy existing outside the HSM is itself a policy breach, regardless of misuse.
Inject 2 Scoping
| Time | Event | Questions |
|---|---|---|
| T+1h | HSM audit logs show the code signing key is marked non-exportable, but a pipeline service account made 40 signing calls last night outside any release window. | Which identity holds signing rights? Was its credential stolen, or was the pipeline itself compromised? What else did that account touch? |
| T+1h20m | Identity logs show tokens signed with the exposed token key, issued for client IDs that have not authenticated for months, calling customer data APIs. | Can you tell forged tokens from genuine ones? Which customers and APIs received them? Do any verifiers accept the key for audiences or issuers it was never meant for? |
| T+1h40m | Release engineering cannot list every artefact signed with the code signing certificate in the past year. | How will you decide which genuine releases a revocation would break? |
Custody evidence to preserve
- HSM records: audit logs of key generation, signing operations, key attribute changes (exportable, extractable), partition logins and backups; the key's creation and attributes as recorded by the HSM.
- Signing service logs: each request with caller identity, artefact hash, time and approval reference, so the team can produce a list of everything legitimately signed.
- Identity and cloud logs: sign-ins and API calls by the identity that holds signing rights, storage access logs for the exposed bucket, token issuance logs with
kid, client ID, audience and issuer. - Certificates and keys metadata: certificate serial numbers, timestamping authority used, JWKS snapshots over time.
- Chain of custody: who exported each log, when, and where it is stored, in case of legal or regulatory follow-up.
Expected decisions: the code key probably did not leave the HSM, but the service account that can call it is compromised, so the "key compromise" is really a signing identity compromise; the token key did leave custody. That changes the response: for code signing, disable the service account and pause all signing; for tokens, plan immediate removal from the JWKS. The pipeline identity is a non-human identity with the power to make anything look like Fernhill software; see the Cryptographic Key Management Guide and the HSM Deployment and Operations Guide.
Inject 3 Revocation and rotation
| Time | Event | Questions |
|---|---|---|
| T+2h | The CA asks for a revocation date. The first suspicious signing call was eleven days ago; the current genuine release was signed nine days ago. | Which revocation date do you choose, and what happens to the genuine release? Do you have a new certificate ready to re-sign? |
| T+2h15m | Engineering proposes adding a new token key to the JWKS and removing the old one in 24 hours "to avoid breaking sessions". | Is a normal rotation acceptable when the old key is in an attacker's hands? What is the real cost of removing it now? |
| T+2h30m | A large customer reports its gateway pins your JWKS response and refreshes it weekly. | How do you make sure that customer stops trusting the old key? Who calls them? |
Revoke versus rotate
| Option | When it fits | Blast radius |
|---|---|---|
| Rotate only (new key, old key retired on normal schedule) | Planned hygiene, or exposure ruled out by custody evidence | None; but forgeries stay valid if the key was actually stolen |
| Rotate and remove immediately (token key) | Private token key confirmed outside custody | All sessions and tokens signed with the old key fail; users and integrations re-authenticate |
| Revoke certificate from the date of compromise (code key) | Malicious signing confirmed; date of first misuse known | Releases signed after that date stop verifying; re-sign and ship them with the new certificate first |
| Revoke from issuance or an earlier date | Date of first misuse unknown, or key exposure long-standing | Every release signed with that certificate is affected; largest customer impact |
Expected decisions: remove the exposed token key from the JWKS now and accept forced re-authentication, because a 24 hour overlap is 24 hours of valid forged tokens. Reduce verifier cache lifetime for the incident if possible and contact customers who cache or pin keys. For code signing, re-sign the nine day old genuine release with a new certificate held in the HSM, publish it, then ask the CA to revoke from the date of the first suspicious signing. The Compromised Code Signing Certificate Playbook sets out the revocation steps and the controls revocation does not cover, and the Certificate Revocation Guide explains how revocation reaches clients.
The GitHub incident shows the cost: after code signing certificates were exposed in December 2022, GitHub released a Desktop build signed with unexposed certificates, then revoked three certificates on 2 February 2023, which invalidated several GitHub Desktop for Mac and Atom versions. See the GitHub Code Signing Certificate Theft 2022 analysis.
Inject 4 Customer and regulator communication
| Time | Event | Questions |
|---|---|---|
| T+3h | A journalist asks whether Fernhill software was used to distribute malware. | Who speaks? What can be said before scoping is finished? |
| T+3h15m | Scoping shows forged tokens read personal data from two customers' tenants. | Are you a processor or controller for this data? Which notification deadlines start, and when did you become aware? |
| T+3h30m | Support expects thousands of tickets when the old desktop version stops running after revocation. | What exactly must customers do? Is there a list of hashes to block and a fixed version to deploy? |
Expected decisions: one customer advisory that states which certificate serial and key ID are affected, the revocation date, the versions that will stop verifying, the fixed version, and what integrators must do to refresh JWKS caches. Legal confirms notification triggers against the contracts and applicable law (for example, GDPR Article 33, mirrored in UK GDPR, requires a controller to notify the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of a personal data breach, unless it is unlikely to result in a risk to individuals; a processor notifies the controller without undue delay). Notify the two affected customers directly before the public advisory. For running the privacy side of this inject in depth, use the Data Breach Tabletop Exercise.
Debrief questions
- Inventory: could we list every signing key, its owner, its location and every identity able to use it, within an hour?
- Custody: were all private keys non-exportable in an HSM or managed key service, and could we prove it from logs?
- Verifier scope: do our verifiers check issuer, audience and key purpose, so a key trusted for one context cannot sign for another? RFC 8725 requires verifiers to confirm the verification key belongs to the token's issuer and to reject tokens whose audience does not match. In Storm-0558, a 2016 consumer signing key that should have been retired was used to forge tokens that Exchange Online accepted for enterprise mailboxes, because issuer and scope checks were missing; the Cyber Safety Review Board judged the intrusion preventable. See the Microsoft Storm-0558 Key Breach 2023 and the Storm-0558 and Cloud Key Theft Profile.
- Detection: would we have spotted the misuse ourselves? In Storm-0558, detection came from a customer's own audit logging and alert, not the provider.
- Standby keys: did we have a pre-generated standby key and certificate, or did re-signing wait on a new certificate request?
- Decision speed: how long from first report to decision to revoke, and what slowed it?
- Customer reach: did we know which customers cache or pin our keys?
Measures to track after the exercise
- Time to declare: first report to declared key compromise, target under one hour.
- Time to remove a token key: decision to old key absent from the JWKS and from verifier caches.
- Signed artefact coverage: share of signing operations traceable to an approved release in the signing log.
- Key custody coverage: share of signing keys held non-exportable in an HSM or managed key service.
- Action closure: exercise actions closed within the agreed period.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev. 5 | IR-3, IR-4, IR-8 | Incident response testing, handling and plan |
| NIST SP 800-53 Rev. 5 | SC-12, SC-17 | Key establishment and management; PKI certificates |
| NIST CSF 2.0 | ID.IM-02, RS.MA-01 | Improvements from exercises; response coordinated with third parties |
| MITRE ATT&CK v20 | T1552.004, T1553.002, T1606 | Private key theft; abuse of code signing; forged web credentials |
Practitioner checklist
- Run this exercise with the real key inventory, CA contacts and JWKS cache settings, not placeholders.
- Name an owner for every signing key and every identity that can call the signing service.
- Hold private signing keys non-exportable in an HSM or managed key service, with signing logs that link each operation to a release.
- Keep a standby code signing certificate and a standby token key ready, so re-signing and rotation do not wait.
- Document how to remove a token key from the JWKS immediately and how to tell customers to refresh.
- Agree the revocation date logic with your CA in advance.
- Check that every verifier validates issuer, audience and key purpose.
- Pre-draft the customer advisory and confirm notification triggers with legal.
- Record findings in an after action report and track the actions to closure.
Standards and references
- CISA: Tabletop Exercise Packages
- NIST: SP 800-84 Guide to Test, Training, and Exercise Programs for IT Plans and Capabilities
- IETF: RFC 7517 JSON Web Key (JWK)
- IETF: RFC 8725 JSON Web Token Best Current Practices
- NIST: SP 800-57 Part 1 Rev. 5 Recommendation for Key Management
- EUR-Lex: Regulation (EU) 2016/679 (GDPR)
Related NHI Mgmt Group resources: Tabletop Exercise Guide · Identity Attack Tabletop Exercise Scenarios · JSON Web Key Sets (JWKS) and Signing Key Rotation Guide · Tabletop Exercise After Action Report Template