Skip to content

Commit 6af1613

Browse files
authored
doc: update documentation to point to security best practice (#14942)
1 parent 706353d commit 6af1613

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

google/cloud/credentials.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ std::shared_ptr<Credentials> MakeInsecureCredentials(Options opts = {});
119119
* service account key file, or a JSON object describing your user
120120
* credentials.
121121
*
122+
* @warning If you accept a credential configuration (credential
123+
* JSON/File/Stream) from an external source for authentication to Google Cloud
124+
* Platform, you must validate it before providing it to any Google API or
125+
* client library. Providing an unvalidated credential configuration to Google
126+
* APIs can compromise the security of your systems and data. For more
127+
* information, refer to
128+
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
129+
*
122130
* @see https://cloud.google.com/docs/authentication for more information on
123131
* authentication in GCP.
124132
*
@@ -265,6 +273,14 @@ std::shared_ptr<Credentials> MakeServiceAccountCredentials(
265273
* identity provider that supports OpenID Connect (OIDC), such as Microsoft
266274
* Azure, or SAML 2.0.
267275
*
276+
* @warning If you accept a credential configuration (credential
277+
* JSON/File/Stream) from an external source for authentication to Google Cloud
278+
* Platform, you must validate it before providing it to any Google API or
279+
* client library. Providing an unvalidated credential configuration to Google
280+
* APIs can compromise the security of your systems and data. For more
281+
* information, refer to
282+
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials.
283+
*
268284
* @see https://cloud.google.com/docs/authentication for more information on
269285
* authentication in GCP.
270286
*

google/cloud/doc/guac.dox

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,19 @@ considered implementation details. If you would like to use them in your
8989
own libraries please file a [feature request]. We cannot promise that we will
9090
be able to satisfy these requests, but we will give them full consideration.
9191

92+
**Important**: If you accept a credential configuration (credential JSON/File/Stream)
93+
from an external source for authentication to Google Cloud Platform, you must
94+
validate it before providing it to any Google API or client library. Providing
95+
an unvalidated credential configuration to Google APIs can compromise the security
96+
of your systems and data. For more information, refer to [externally sourced credentials].
97+
9298
[principal-overview]: https://cloud.google.com/iam/docs/overview#how_cloud_iam_works
9399
[Authentication at Google]: https://cloud.google.com/docs/authentication
94100
[IAM overview]: https://cloud.google.com/iam/docs/overview
95101
[Application Default Credentials]: https://cloud.google.com/docs/authentication/application-default-credentials
96102
[Oauth2]: https://oauth.net/2/
97103
[service account keyfile]: https://cloud.google.com/iam/docs/creating-managing-service-account-keys
98104
[feature request]: https://github.com/googleapis/google-cloud-cpp/issues
105+
[externally sourced credentials]: (https://cloud.google.com/docs/authentication/external/externally-sourced-credentials)
99106

100107
*/

0 commit comments

Comments
 (0)