Serious question, our API keys sat in mobile app code for 3 years and nobody caught it
We finally ran a scan of our old Android builds last Tuesday and found hardcoded keys in the release APK going back to 2021, so now I'm stuck rotating everything and begging teams to move to a token service, has anyone had luck getting mobile devs to stop hardcoding secrets for real?
My own laptop probably has a test key from 2019 still hiding in some folder I forgot about, so no judgment here. Jokes aside, the hard truth is that devs hardcode secrets because it is the fastest path and nothing breaks until someone scans. What has worked for a few teams I know is making the safe way the easy way, like a shared token service with a one line setup and a build step that fails the release if it spots a key pattern. Add a pre commit hook so the code never even reaches review with a secret in it. Once the scan is automated and the fix is less work than the shortcut, people stop doing it, but begging alone will not move anyone.