Working with Secrets in Source Control¶
The best way to avoid leaking secrets is to store them in local/private files and exclude these from git tracking with a .gitignore file. E.g. the following pattern will exclude all files with the extension .private.config
:
As an extra security measure, apply credential scanning in your CI/CD pipeline.