India’s Leading Domain & Web Hosting Provider
Ad-tech DSP vaults 340 hard-coded credentials and rotates exchange keys in minutes
DSP processing 1.8 billion bid requests a day for Indian and Southeast Asian advertisers · Google Cloud asia-south1 (Mumbai), with bidders in asia-southeast1 · 12 weeks
As-is situation
The bidder, campaign management and reporting services ran on GKE and Dataflow, built over six years by a team that had grown from 8 to 90 engineers. A Gitleaks scan of 140 repositories found 340 live credentials: ad exchange API keys, BigQuery service account keys, Redis passwords and two payment gateway keys. Four exchange keys had been exposed in a public fork for eleven months. Rotating any credential meant redeploying 20 or more services, so nothing had been rotated since launch, and one exchange had already threatened suspension.
- 340 live credentials across 140 repositories, 4 exposed publicly
- No rotation in six years because each change required redeploying 20+ services
- 41 downloaded service account keys used by GKE workloads
Approach, tools and architecture
NTSPL rotated the four publicly exposed keys and the payment keys within 48 hours, coordinating with exchanges and the gateway. Remaining credentials moved into Secret Manager with one project per environment, read at runtime by GKE workloads through Workload Identity Federation for GKE and the Secret Manager add-on, with a 10-minute refresh. The 41 service account keys were replaced by Workload Identity bindings and the iam.disableServiceAccountKeyCreation constraint was enforced. Rotation schedules on exchange keys publish Pub/Sub notifications to a Cloud Run function that calls each exchange's key API, keeps both keys valid for an hour, then revokes the old one. Gitleaks now runs in pre-commit and Cloud Build.
Implementation approach
Measured results
Operational improvements
- Pre-commit and pipeline scanning blocked 23 new secrets in the first quarter
- Exchange partners receive rotation confirmations automatically
Cost considerations
Secret Manager charges for about 420 secret versions and access calls, cached by the add-on, run under INR 12,000 a month. Cloud Run rotation functions are negligible. NTSPL's fee was INR 13 lakh. Pipeline scanning runs on existing Cloud Build capacity.
Return on investment
The threatened exchange suspension would have cut roughly 12% of daily bid volume. Removing 340 live credentials and all service account keys eliminates the most common cloud breach path, and engineers no longer coordinate multi-service redeploys for each rotation.