Passer la navigation

[Résolu] Warning from Google: publicly accessible Google API key

This support ticket is created Il y a 3 years, 2 months. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par simonC-7 Il y a 3 years, 2 months.

Auteur
Publications
#2567471

Tell us what you are trying to do?

I received the following warning from Google, and wonder if it is right that Toolset show the Google API Key publicly?:

~~~
We have detected a publicly accessible Google API key associated with the following Google Cloud Platform project:

Project Amii Expert Listing (id: amii-expert-listing) with API key AIzaSyCs03jjjsH2TxvU5uqwakmYP13Aoui4D2Y

The key was found at the following URL: lien caché

We believe that you or your organization may have inadvertently published the affected API key in public sources or on public websites (for example, credentials mistakenly uploaded to a service such as GitHub.)

Please note that as the project/account owner, you are responsible for securing your keys.
~~~

That page does indeed show the Google API Key in the code. Is that correct. Should Toolset be showing that publicly?

What is the link to your site?
lien caché

#2567489

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01:00)

That's perhaps a slightly confusing message from Google, inasmuch as the requests to its API from browsers *must* include the API key, and that key is visible to anyone that knows where to look for it.

You can secure such public keys within the Google API settings by adding a domain restriction, so that the API key only "works" when the request comes from amii.org.uk, making it useless to anyone else. That has always been best practice, but it seems like Google are sending warnings about this now.

#2567491

Thanks Nigel, that answers my question. I have restricted the API Key to just the production and staging sites.