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, 2022 in GCP by Ashwini
• 5,430 points
1,987 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.

Hope this helps!

Get GCP Certification and become certified today!

answered Nov 7, 2022 by Tejashwini
• 3,820 points

edited Sep 6, 2023 by Khan Sarfaraz

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,230 points
7,013 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,230 points
2,754 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,350 points
645 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, 2022 in GCP by Tejashwini
• 3,820 points
848 views
0 votes
1 answer

Google cloud: How to list all service-accounts from all Projects in GCP

It's been noted by the commenters that ...READ MORE

answered Nov 10, 2022 in GCP by Tejashwini
• 3,820 points
1,463 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