A partner credential sat in a repository for six weeks; a commit deletes the line - what is still true of that credential?
answer
- one file changed, nothing else
- validity lives at the accepting system
- six weeks of accumulating copies
- readers cannot be enumerated
- ends when the old value fails
basics
~20 sNothing about the credential changed. The deleting commit edits one file at the tip of one branch. The value still authenticates, still sits in copies taken over six weeks, and is still held by anyone who read it.
solid answer
~40 sThe commit changes one file at the tip of one branch, and nothing else. The value is still accepted by the system that issued it, still present in the earlier revision, in every clone and fork taken during those six weeks, in build logs and published artefacts, in backups, and in the hands of anyone who read it. Treat anything ever committed as already taken. The exposure ends at one point: when the old value stops authenticating. So replace it for the consumers that need it, withdraw the old one at the system that accepts it, and confirm the old one now fails. Cleaning the repository afterwards is worth doing, but it is bookkeeping - it reduces how many copies of a value that should by then be dead are lying around.
go deeper
Recall the one-line version: removing the line does not make the credential invalid. The value keeps working until someone stops it at the system that accepts it.
Explain where the other copies are - the earlier revision, clones, forks, build outputs, backups - and why none of them is touched by a commit or by a history rewrite.
Show the ordering judgement: replacement takes minutes, cleanup takes days of other teams' cooperation, so the slow work never goes first. Name the end condition you would report.
Frame it as a standard: teams should not be deciding case by case whether a committed value counts as taken. Set the default - committed means taken - and make replacement cheap enough that the default is affordable.
## What the deleting commit actually changed A commit that removes the line changes exactly one thing: the contents of that file at the tip of one branch. From that revision forward, someone reading the current tree does not see the value. That is the whole effect, and it is a change to a **document**. The exposure is not a document. The exposure is a **live credential that a remote system accepts**, and nothing in the repository is connected to that system. Three things the deletion did not do: - It did not make the credential invalid. Validity is decided by whatever issues and accepts the credential - a partner's service, an internal system, a downstream account. A commit does not talk to it. - It did not reach a single copy outside the current tree: the earlier revision, clones on laptops and build machines, forks and mirrors, build logs, published artefacts, backups. - It did not establish who read the value while it was there. The repository can tell you who had access; it very rarely tells you who actually fetched that file. ## What is still true after six weeks 1. **The value still authenticates.** Any holder can use it right now, and their use is indistinguishable from legitimate use, because it is the same credential the legitimate consumer uses. 2. **Copies accumulated the whole time.** Assume one archive per night: six weeks is roughly 42 restorable snapshots that contain the value, plus every clone, fork and mirror taken in that period, plus every build that rendered the file into an output. 3. **The reader set is unenumerable.** You can list who *could* read it. You cannot list who *did*. 4. **The exposure window is six weeks, not the minutes since discovery.** Every judgement you make - what the credential could reach, how much you care - starts from the commit date, not from today. ## The actions that change the credential's state Two actions move the state, and only one of them is terminal. **Replacing** puts a new value in place so consumers keep working; **withdrawing** makes the old value stop working. They are different actions, and a replacement that never withdrew the old value left it live. | Action | What it changes | What it does not change | |---|---|---| | Replace the value | Consumers move onto a new credential | The old value still authenticates until withdrawn | | Withdraw the old value | The old value stops working - the exposure ends here | The copies still exist; they are now worthless | | Rewrite the repository's history | The repository stops serving the value | Validity, clones, forks, artefacts, backups, readers | | Make the repository private | Who may newly fetch it | Everything already copied, and the value's validity | ## Why the deletion feels like the fix The defect you can see is a line of text, so the remedy that feels proportional is deleting the line. That instinct is what this question is testing. The visible artefact is a symptom; the thing with the security property is the credential, and the credential lives somewhere else. A second version of the same instinct is rewriting the history and calling it done - which removes more copies, and still changes nothing about whether the value works. There is also an order trap hidden inside the instinct. Cleanup is slow: reaching every clone holder, every fork owner and every published artefact takes hours to days of other people's cooperation. Replacement is usually minutes. Doing the slow thing first leaves the value live for the whole of it. ## What handled means here Answer with a checkable end condition rather than a list of activities. **The exposure is over when an attempt to use the old value fails, and you can demonstrate that failure.** Until then it is open, no matter how clean the history is. After that point everything else - the rewrite, the fork owners, the artefacts, the backups - is reducing the number of stale copies of a dead value, which is worth doing and is not the same work. One practical consequence for the six-week case: do not spend the first hour deciding whether the exposure was real. A credential that has been readable by an unknown set of parties for six weeks should be treated as taken, and the cost of replacing it is almost always lower than the cost of being wrong about that.
- What is the checkable end state that lets you say this exposure is over?An attempt to authenticate with the old value fails at the system that accepts it, and you can show that result. Everything else - the history, the forks, the artefacts, the backups - is measured separately, and none of it is the end state.
- Does it matter that the value was committed six weeks ago rather than this morning?It changes the assumption, not the action. Six weeks means far more clones, forks, archived snapshots and build outputs carry it, and it widens the period whose activity you will later have to account for. The immediate move - replace, then withdraw - is the same either way.
- The value in the file was a placeholder that was never activated. Does that change the answer?Only after you have confirmed it, at the system that would accept it, rather than from the file or from memory. Placeholders get activated, get reused as real values, and get copied into other repositories. Confirm first; the confirmation is cheap and the assumption is not.
Deleting the line is like taking down the sign that showed the door code. The code still opens the door, and everyone who walked past it still knows the code.
saying these in an interview costs you the question
- Says the exposure ended when the line was deleted
- Treats pushing the removal over the old history as the fix
- Assumes a value is only at risk while it is on the default branch
- Plans to replace the credential later because the file is gone now
- Claims nobody could have seen it because nobody mentioned it