- Notifications
You must be signed in to change notification settings - Fork 25.6k
Use default application credentials for GCS repositories #71239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this on a VM having a custom service account to it and access a GS bucket worked fine via the repository-gcs plugin (successfully restoring a snapshot) without having to explicitly load the credentials_file via the elasticsearch-keystore tool.
| | ||
| @SuppressForbidden(reason = "ok to open connection here") | ||
| private static String getDefaultProjectId() throws IOException { | ||
| String metaHost = System.getenv("GCE_METADATA_HOST"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if there is ever a case where the metadata server is not metadata.google.internal, but I suppose a) there is no guarantee this will remain for ever the same b) it might be useful esp. under additional layers under k8s etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is purely used for testing. While the Google library uses this environment variable in other places (e.g. to load the credentials from the environment) it does not check it when loading the project id :/
| Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left some minor comments here and there.
I'm wondering if the integration test is going to fail when executed using a FIPS JVM
...pository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageService.java Show resolved Hide resolved
...pository-gcs/src/main/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageService.java Show resolved Hide resolved
test/fixtures/gcs-fixture/src/main/java/fixture/gcs/GoogleCloudStorageHttpHandler.java Show resolved Hide resolved
Adds support for "Default Application Credentials" for GCS repositories, making it easier to set up a repository on GCP, as all relevant information to connect to the repository is retrieved from the environment, not necessitating complicated keystore setups.
Adds support for Default Application Credentials for GCS repositories, making it easier to set up a repository on GCP, as all relevant information to connect to the repository is retrieved from the environment, not necessitating complicated keystore setups.