GCP API keys Your app contains exposed Google Cloud Platform GCP API keys

0 votes

When uploading a build to the Google Play Store Console, an issue occurs. 

The mistake is as follows.

Leaking GCP API Keys 

Keys to Google Cloud Platform (GCP) APIs are exposed in your app.

The offending code is listed below.

Places.initialize(getApplicationContext(), BuildConfig.GOOGLE_API_KEY);

I am reading the key from BuildConfig and also restricting it, as per the guidelines. But the problem is still there. How can I resolve this problem?

Nov 4 in GCP by Ashwini
• 2,760 points
73 views

1 answer to this question.

0 votes
You must look under "Credentials" in the Cloud Platform Console to safeguard your GCP API Keys. Using the Create credentials button, generate a new API Key with the same configuration as the compromised API Key. You risk experiencing an outage if the limitations on the API Key do not line up.
The old key was deleted after pushing the new one to all the areas where it was previously active.
For further information, I advise you to look at the official documentation for handling compromised credentials in GCP.
In addition, you may wish to take into account Keyless API authentication by utilizing workload identify federation.
answered Nov 7 by Tejashwini
• 2,860 points

Related Questions In GCP

0 votes
0 answers
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,190 points
5,122 views
0 votes
1 answer

How do I create a Google Cloud Platform (GCP) account?

In order to access the services provided ...READ MORE

answered Sep 20, 2019 in GCP by Sirajul
• 59,190 points
2,102 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Changing Machine Instance on GCP

There is no direct method to change ...READ MORE

answered Aug 1, 2018 in GCP by kurt_cobain
• 9,390 points
232 views
0 votes
1 answer
0 votes
1 answer

Using the Google Cloud Platform SDK CLI to List all Active Resources Under a Given Project

For a specific organization, folder, or project, ...READ MORE

answered Nov 7 in GCP by Tejashwini
• 2,860 points
37 views
0 votes
1 answer

How to get a list of Google Cloud services with their description?

Use just Google's provided API Discovery Service. Here ...READ MORE

answered Nov 4 in GCP by Tejashwini
• 2,860 points
33 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP