Scrivio Interview library
LeadershipAdvanced5 min read · updated 12 November 2026

Secret scanning found 1,200 credentials in your company's Git history and CI logs. How would you run the clean-up and change practices?

The first rule is to rotate every exposed credential, because deleting it from Git history does not undo a leak that clones, forks and logs already captured. We rank the 1,200 findings by privilege and exposure so production, cloud admin and customer-data credentials are rotated first, assign an owner to every one and report progress until the list is closed. To stop it happening again, we give teams a standard secret store and workload identity so they do not need static secrets, and add pre-commit and CI secret scanning that blocks new leaks.

Why this question is asked

A first secret scan of a company's history is always a shock. Credentials accumulate for years: a database password in a test, a cloud key pasted into a script, a token printed by a CI job in debug mode. Twelve hundred findings is a normal number for a mid-sized engineering organisation. Interviewers ask this to see whether we can lead a clean-up that actually reduces risk, not just one that makes the scanner report look green, and whether we fix the habits that created the problem. In this answer, we will see why rotation comes before deletion, how to triage 1,200 findings, how to run the work with owners and reporting, and how to change practices so the number stays low.

1Why Rotation Comes First

Once a credential has been pushed to a shared repository or printed in a CI log, we must assume someone copied it. Every developer clone has the history, forks and mirrors may exist, CI logs may have been shipped to a log platform, and attackers scan public and leaked repositories automatically within minutes of a push. Rewriting history with a tool such as git filter-repo removes the value from future clones, but it does nothing to copies that already exist.

So the only fix that changes the risk is rotation: issue a new credential, move consumers to it, and revoke the old one so it no longer works. Cleaning history is still worth doing afterwards, mainly so the scanner stops reporting old findings and nobody reuses an old value by mistake, but it is the second step, not the first.

2Triage: 1,200 Findings Are Not 1,200 Equal Problems

The first pass is to deduplicate and validate. The same key often appears in many commits and logs, so 1,200 findings might be 400 distinct credentials. Many scanners can check whether a credential is still live, for example by calling the provider's API with it, and that splits the list into live and already dead.

Then we rank the live ones by privilege and exposure. Privilege asks what the credential can do: a cloud admin key or a production database owner is far more dangerous than a read-only test key. Exposure asks where it leaked: a public repository or a widely shared CI log is worse than a private repository with five readers. A credential that is both high privilege and widely exposed is rotated today.

Rotation order
PriorityExamplesTarget
P0Cloud admin keys, prod DB owner, payment keys, public repoRotate within 24 hours
P1Other production credentials, customer data accessWithin 1 week
P2Staging and shared test systemsWithin 1 month
P3Dead, revoked or local-only valuesConfirm dead, clean history

3Running the Clean-Up

Each distinct credential becomes a ticket with an owner, the team that owns the system the credential grants access to, not the person who happened to commit it. Where ownership is unknown, the platform security team takes it and finds the owner, because an unowned credential is never rotated. Each ticket closes only when the old value is verified revoked, not when a new one is created.

For P0 credentials we also check for misuse: cloud audit logs, database logs and provider dashboards for activity from unknown addresses during the exposure window. If we find any, that credential becomes a security incident.

Progress is reported weekly to engineering leadership as a burn-down: distinct live credentials remaining by priority, and overdue tickets per team. Seeing "P0: 37 -> 0 in four days, P1: 210 -> 140" keeps attention on the work, and naming overdue teams in the report, politely, gets them unblocked.

4Changing Practices So It Stays Fixed

Credentials end up in Git because developers need them and have nowhere better to put them. So the lasting fix is to give them a better place and, where possible, remove the need for a static secret entirely. The platform provides a standard secret store, such as Vault or the cloud provider's secret manager, integrated into the service templates, so reading a secret is one line of configuration. For cloud access, workload identity, meaning the platform gives each service an identity and short-lived credentials (for example IAM roles for Kubernetes service accounts), replaces access keys altogether.

Then we close the doors. A pre-commit hook with a secret scanner catches most mistakes on the developer's machine. The CI pipeline and repository push protection scan every push and block those that contain secrets, and CI logs are masked so tokens printed by jobs are not stored in plain text. The scanner keeps running across all history, so if something slips through, we hear about it in minutes, not years.

Java
# .pre-commit-config.yaml (example with gitleaks; pin the rev your team approves)
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.x.y
hooks:
- id: gitleaks
# $ git commit -m "add config"
# Finding: aws_secret_access_key = "wJalr..." RuleID: aws-secret-access-key
# gitleaks......Failed
Step throughLayers that keep secrets out of Git
  1. Workload identityno static cloud keys to leak
  2. Standard secret storeVault or cloud secret manager in templates
  3. Pre-commit scanningcatches mistakes on the laptop
  4. CI and push protectionblocks pushes and masks logs
  5. Continuous history scanalerts within minutes if anything slips

5 layers, from the top down. Step through them one at a time.

5Follow-up questions

Should we rewrite Git history for all repositories?

Only after rotation, and only where it is worth the disruption, because rewriting forces every developer to re-clone and breaks open pull requests. For repositories that are or were public, it is worth it. For private ones, marking old findings as rotated in the scanner is often enough.

A team says rotating their key will cause an outage. What do you do?

Help them plan an overlapping rotation: create the new key, deploy consumers with the new one, verify, and only then revoke the old key. For a P0 key, we accept a short planned disruption rather than leave a live exposed credential; the risk of an attacker using it is worse.

6Conclusion

In this answer, we ran a clean-up of 1,200 leaked credentials. We rotate first, because deleting history does not undo a leak, then deduplicate, check which credentials are live and rank them by privilege and exposure. Every credential gets an owner and a ticket that closes only when the old value is revoked, with weekly burn-down reports to leadership. To change practices, we provide a standard secret store and workload identity so teams do not need static secrets, and add pre-commit, CI and push-protection scanning that blocks new leaks.

What to say in the interviewAbout 90 seconds aloud

Open with

The first thing I would make clear is that we rotate, not delete. Once a credential is in Git history or a CI log, copies exist in clones, forks and log systems, so rewriting history does not reduce the risk; only revoking the old value does.

Then, if they want more

Then I would triage. Twelve hundred findings usually collapse to a few hundred distinct credentials after deduplication, and many scanners can check which are still live.

I rank the live ones by privilege and exposure: cloud admin keys, production database owners, payment keys and anything in a public repository are P0, rotated within 24 hours, with a check of audit logs for misuse during the exposure window.

Every credential gets an owner from the team that owns the target system, and the ticket closes only when the old value is verified revoked. I report a weekly burn-down by priority and overdue teams to engineering leadership. For the long term, I fix the reason it happened.

The platform provides a standard secret store in the service templates, and workload identity so services get short-lived cloud credentials instead of access keys. Then pre-commit hooks, CI scanning with push protection and masked CI logs block new leaks, and a continuous scan of all repositories alerts us within minutes if something still gets through. History rewriting comes last, mainly for repositories that were public.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Security reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Secret scanning found 1,200 credentials in your company's Git history and CI logs. How...": https://scrivio-interview-library.netlify.app/spring-boot/secrets-and-crypto/5144f90fb0/