We have a Java app which uses Google Auth to allow uses in. The app needs to connect to a Google Cloud SQL database which is locked down behind IP restrictions.
We need to use Cloud SQL Socket Factory with Cloud SQL Proxy to get access to the database, this requires Application Default Credentials with an environment variable GOOGLE_APPLICATION_CREDENTIALS
pointing at service account credentials JSON file. I'm unsure of how to store this securely, putting that file on the user's PC is obviously not secure.
As per best practices on https://cloud.google.com/docs/authentication/production, it says
You can use an environment variable pointing to credentials outside of the application's source code, such as Cloud Key Management Service.
But this doesn't go on to explain how to do it. How can I store this file securely, in KMS or otherwise, in a way that only authorized Google accounts can access?