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

Augment authentication behaviour to support Cognito credential set #36

Closed
alexdunnjpl opened this issue May 22, 2023 · 20 comments · Fixed by #47
Closed

Augment authentication behaviour to support Cognito credential set #36

alexdunnjpl opened this issue May 22, 2023 · 20 comments · Fixed by #47

Comments

@alexdunnjpl
Copy link
Contributor

💡 Description

Currently, auth.cfg contains a user/pass set which is passed to OpenSearch as a Basic header. It is now necessary to support Cognito alongside Basic auth (Basic may be deprecated later).

This will required shoehorning additional functionality into gov.nasa.pds.registry.common.es.client.EsRestClientBld (probably).

See Slack convo for more details

May be smart to depend this issue on #15 if still applicable (it appears so - registry-commons is still using an ElasticSearch client)

@tloubrieu-jpl
Copy link
Member

@alexdunnjpl can consider realizing this ticket #15 for the current task.

@alexdunnjpl
Copy link
Contributor Author

Status: Blocked pending provision of en_test OpenSearch credentials (ticket open)

@tloubrieu-jpl
Copy link
Member

@alexdunnjpl is working on that.

@jordanpadams
Copy link
Member

@alexdunnjpl continuing to work on this.

@nutjob4life
Copy link
Member

Ongoing. Aid from @nutjob4life.

@nutjob4life
Copy link
Member

Back and forth w/@nutjob4life and on hold today due to provenance issues

@nutjob4life nutjob4life self-assigned this Aug 14, 2023
@tloubrieu-jpl
Copy link
Member

@nutjob4life is taking that on his shoulders

@tloubrieu-jpl
Copy link
Member

@nutjob4life can you pause on that development ? We have just discussed during the breakout that the multitenant deployment might use a serverless version of the AWS managed opensearch which does not support Cognito as an authentication system.

If we go for that, we would implement the cognito authentication in API proxies in front of opensearch. That would change/simplify the authentication for harvest/registry-mgr. Maybe we would have one API end-point for each opensearch role... That to say, you should not spend more time on this ticket until we know better what we are going to do.

We are waiting for expert feedback on the opensearch solution chosen before we move on. We'll let you know.

@nutjob4life
Copy link
Member

@tloubrieu-jpl I pressed the ⏸️ button on this ticket. However, this is my only ticket! I need something else to work on.

@tloubrieu-jpl
Copy link
Member

Blocked until we decide on the AWS OpenSearch service we eventually use.

@tloubrieu-jpl
Copy link
Member

Regarding the signed URL management there is some new doc: https://code.dblock.org/2022/07/11/making-sigv4-authenticated-requests-to-managed-opensearch.html

@al-niessner
Copy link
Contributor

al-niessner commented Jan 22, 2024

@nutjob4life @alexdunnjpl @jordanpadams @tloubrieu-jpl

I need to make some pretty sweeping changes for cognito: see NASA-PDS/harvest#146 if you like gore. Point is, it looks like it y'all may have done some of it already. Maybe you had a different plan of attack. I want to make a bunch of the classes polymorphic so that we do not have CollectionWriterHTTPS and CollectionWriterCognito sprinkled heavily throughout the code. Do y'all have a branch with changes on it that you could push/PR so that I can see where it is at and maybe where it was going before the great pause.

PS: Tried looking at slack convo and had screen that said did not have permissions to read it.

@alexdunnjpl
Copy link
Contributor Author

alexdunnjpl commented Jan 22, 2024

@al-niessner I've added you to that slack convo, and mailed over snips from another DM between Sean and I which may have some useful gotchas/thoughts.

No code to show apart from that toy sandbox I sent over a while back

@tloubrieu-jpl
Copy link
Member

To be tested with harvest and registry-common before we merge.

@tloubrieu-jpl
Copy link
Member

@al-niessner is working with the lambda now and experimenting issues with it. @sjoshi-jpl is investigation this issues.

@tloubrieu-jpl
Copy link
Member

There are issues when using the opensearch java sdk with the api gateway proxy. To be discussed at the breakout.

@tloubrieu-jpl
Copy link
Member

@al-niessner is progressing on using and expending the OpenSearch AWS SDK to work with Cognito authentication.

@tloubrieu-jpl
Copy link
Member

@al-niessner was able to get the credential from the lambda developed by @sjoshi-jpl .

now he's getting a 404 error when trying to reach to the OpenSearch server.

@tloubrieu-jpl
Copy link
Member

The new SDK requires some more updates.

@jordanpadams
Copy link
Member

Status: PR created to fix bug introduced with initial refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏁 Done
5 participants