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

Add support for "impersonating" users in Ditto #2101

Open
thjaeckle opened this issue Jan 21, 2025 · 1 comment
Open

Add support for "impersonating" users in Ditto #2101

thjaeckle opened this issue Jan 21, 2025 · 1 comment

Comments

@thjaeckle
Copy link
Member

In application development it is often required to e.g. inspect data or a user interface "through the eyes" of a certain user.
E.g. in order for an engineer to be able to get the exact same information shown as a certain user.
For that, it would be great if Ditto could allow certain users to "impersonate" certain other users.

I don't think it makes sense to add this to Ditto policies, but to statically configure this.

First ideas on how to configure and actually perform the "impersonation" follow in this issue.

Configuration

This is a very delicate feature (regarding security) - when wrongly configured or applied, Ditto authorization can be bypassed.
It is therefore important to be able to really strictly configure:

  • which auth subjects (users/groups) are allowed to impersonate
  • which auth subjects (users/groups) can be impersonated
  • for which entities impersonation should work
    • things
    • policies (more delicate, as they control authorization)
    • connections (also delicate, as they could be used to tamper with data or publish data to the outside)
  • additional rules for impersonation
    • limiting it to certain namespaces (for things + policies)
    • limiting it to certain permissions (READ / WRITE)
    • e.g. presence of other HTTP headers (to be injected e.g. via infrastructure to provide another "factor" - thinking of MFA)
    • integration with OTP mechanisms?

Do the impersonation

  • this has to be possible for all Ditto HTTP / Websocket / SSE APIs
  • the APIs have to be usable as they normally would
  • that leads to the suggestion to impersonate using HTTP headers
    • e.g.: impersonate-as: "[\"some-idp:some-sub\",\"some-idp:some-group\"]"
@thjaeckle
Copy link
Member Author

Also check existing standards on this, e.g. on OAuth:
https://curity.io/resources/learn/impersonation-flow-approaches/#protocol-standards

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

No branches or pull requests

1 participant