quarkiverse / quarkus-google-cloud-services

Google Cloud Services Quarkus Extensions
https://docs.quarkiverse.io/quarkus-google-cloud-services/main/index.html
Apache License 2.0
54 stars 33 forks source link

Prevent access token forwarding for Secret Manager #108

Open manuelbl opened 3 years ago

manuelbl commented 3 years ago

In an application using OIDC or OAuth 2, the Secret Manager extension will use the access token of the current user to access the Secret Manager. Usually, the first user's token after startup will be used.

While this behavior is documented in Authenticating to the Google Cloud and makes sense for several Google services (such as Storage), it does not make sense for the Secret Manager and can even be considered a security issue.

The behavior can be disabled in application.properties:

quarkus.google.cloud.access-token-enabled=false

However, by disabling it globally it will not be available for other services. So it renders the Secret Manager extension incompatible with access token forwarding. It's not possible to use both the Secret Manager and access Google Storage with user credentials.

I therefore propose to enhance the Secret Manager extension:

loicmathieu commented 3 years ago

Maybe we need a way to override the global authentication for the Secret Manager to be able to choose a different authentication mechanism for it. So you can have OIDC for Storage and json service account (or automatic auth when running in GCP) for Secret Manager.

This makes sense.