Skip to content
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

support changing default SHub credentials without restarting the web app #327

Open
bossie opened this issue Jan 30, 2023 · 0 comments
Open

Comments

@bossie
Copy link
Collaborator

bossie commented Jan 30, 2023

Open-EO/openeo-geotrellis-extensions#77 implemented a way to get the (default) credentials from Vault instead of hard-coding them in probav-mep.py. In particular, it will fetch those credentials once @ startup time and propagate them to the components (objects) that need them: see e.g. probav-mep.py and async_task.py:

default_sentinel_hub_credentials = vault.get_sentinel_hub_credentials(
sentinel_hub_client_alias='default',
vault_token=vault.login_kerberos(args.principal, args.keytab))
batch_jobs.set_default_sentinel_hub_credentials(
client_id=default_sentinel_hub_credentials.client_id,
client_secret=default_sentinel_hub_credentials.client_secret)

The fact that the credentials are only fetched once @ startup time means that they are considered fixed during the lifetime of the application. In the case of the web app, this means that a restart is necessary if we need to change them for some reason, for example when they get compromised.

At the moment this is maybe a theoretical problem and just something that we have to keep in mind, should the problem arise.

I did an attempt to fix this but ultimately reverted it because it didn't play nice with batch job impersonation (IIRC it's because a batch job with impersonation doesn't have the openeo.keytab at its disposal to access Vault).

Another, maybe cleaner, way might be to pass on the Vault token like we do in the non-default SHub credentials case but we have to consider that a synchronous load_collection will also require a Vault token (it won't be in the EvalEnv like it is for a batch job).

I suspect that implementing this will also clean up our APIs a bit because things like set_default_sentinel_hub_credentials will no longer be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant