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

[Actions] Add RESTful OAuth support for action types by adding new SO for access/refresh token info storage. #94768

Closed
YulNaumenko opened this issue Mar 16, 2021 · 9 comments
Labels
connectivity Issues relating to connectivity between Kibana and external services estimate:needs-research Estimated as too large and requires research to break down into workable issues Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Feature:Actions/Framework Issues related to the Actions Framework Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@YulNaumenko
Copy link
Contributor

Based on the investigation done in the issue,
we were planning to use a common storage with the problem for tls/ssl, but then we found out that this is a different tasks and should be implemented independently.
From this point, we decided to provide a new SO to store the grant info for all OAuth connections.
There is a couple of thoughts from @pmuellr:
Presumably it would be keyed off the connector id. Which means after a connector is deleted, we should also delete the grant info SO.
We could do this specifically in the connector delete logic - not sure if there's a reason why we would want to keep an old version around.
What happens if a user switches from user/pass to OAuth then back to user/pass then back to OAuth - should we keep all the OAuth info around? Seems like we probably would.

@YulNaumenko YulNaumenko added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Mar 16, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@gmmorris
Copy link
Contributor

gmmorris commented Mar 23, 2021

A couple of questions:

  1. Could these fields be added to the Connector SOs rather than a separate SO?
  2. Are there security related concerns to storing OAuth tokens? (Perhaps we should include @elastic/kibana-security in this discussion)

@legrego
Copy link
Member

legrego commented Mar 23, 2021

Perhaps we should include @elastic/kibana-security in this discussion

Thanks for the ping!

It's not my place to dictate process, but I think an RFC would be appropriate here. I have a very high level understanding of what we're trying to do, so having a detailed design doc that describes the problem we're trying to solve, and how we intend to solve it would be helpful to me.

@pmuellr
Copy link
Member

pmuellr commented Mar 23, 2021

Could these fields be added to the Connector SOs rather than a separate SO?

We were thinking it would be better to keep these in a separate SO, otherwise the connector SO's will end up getting updated by the system as the tokens are refreshed, etc. Also, if we require schema changes to whatever data we're storing, it's one change vs N connector changes.

@gmmorris
Copy link
Contributor

It's not my place to dictate process, but I think an RFC would be appropriate here. I have a very high level understanding of what we're trying to do, so having a detailed design doc that describes the problem we're trying to solve, and how we intend to solve it would be helpful to me.

Yeah, I tend to agree @legrego.
Changing this kind of thing further down the line is hard, so a more concrete piece of research makes sense here.

We were thinking it would be better to keep these in a separate SO, otherwise the connector SO's will end up getting updated by the system as the tokens are refreshed, etc. Also, if we require schema changes to whatever data we're storing, it's one change vs N connector changes.

Fair points @pmuellr , I was just trying to reduce the overhead caused by maintaining multiple SOs that have these very weak links 😕
Are we expecting multiple Connectors to use the same Auth0 SO? Or will it be a 1-to-1 relationship?

@pmuellr
Copy link
Member

pmuellr commented Mar 26, 2021

Are we expecting multiple Connectors to use the same Auth0 SO? Or will it be a 1-to-1 relationship?

Good question - for the case of connectors that have multiple actions (ie, the case-related ones), I think 1-1 relationship is fine. But you could imagine a story where someone has multiple connectors to the same product, where the OAuth grants could be shared, if that's what the customer wanted to do. Would make it easier to configure - just do it once, share amongst the other connectors (somehow).

My main concern with a separate SO was to keep the mutations on the connectors to a minimum (the SO updated date will change every time we refresh a token), and keep from having to migrate N connector types that might use this, if the OAuth props need to be updated.

@zez3
Copy link

zez3 commented Mar 27, 2021

But you could imagine a story where someone has multiple connectors to the same product, where the OAuth grants could be shared, if that's what the customer wanted to do

Indeed this is exactly what I had in mind for #94518

@gmmorris gmmorris added Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Feature:Actions/Framework Issues related to the Actions Framework labels Jul 1, 2021
@gmmorris gmmorris added the loe:needs-research This issue requires some research before it can be worked on or estimated label Jul 15, 2021
@YulNaumenko
Copy link
Contributor Author

This issue is related to the research #93466

@gmmorris gmmorris added connectivity Issues relating to connectivity between Kibana and external services estimate:needs-research Estimated as too large and requires research to break down into workable issues labels Aug 13, 2021
@gmmorris gmmorris removed the loe:needs-research This issue requires some research before it can be worked on or estimated label Sep 2, 2021
@mikecote
Copy link
Contributor

Closing as we now have a storage mechanism.

@kobelb kobelb added the needs-team Issues missing a team label label Jan 31, 2022
@botelastic botelastic bot removed the needs-team Issues missing a team label label Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectivity Issues relating to connectivity between Kibana and external services estimate:needs-research Estimated as too large and requires research to break down into workable issues Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Feature:Actions/Framework Issues related to the Actions Framework Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

8 participants