run-as-privilege.asciidoc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. [role="xpack"]
  2. [[run-as-privilege]]
  3. === Submitting requests on behalf of other users
  4. The {es} {security-features} support a permission that enables an authenticated
  5. user to submit
  6. requests on behalf of other users. If your application already authenticates
  7. users, you can use the _run as_ mechanism to restrict data access according to
  8. {es} permissions without having to re-authenticate each user through.
  9. To "run as" (impersonate) another user, you must be able to retrieve the user from
  10. the realm you use to authenticate. Both the internal `native` and `file` realms
  11. support this out of the box. The LDAP realm must be configured to run in
  12. <<ldap-realm-configuration,_user search_ mode>>. The Active Directory realm must be
  13. <<ad-settings,configured with a `bind_dn` and `secure_bind_password`>> to support
  14. _run as_. The PKI, Kerberos, and SAML realms do not support _run as_.
  15. To submit requests on behalf of other users, you need to have the `run_as`
  16. permission. For example, the following role grants permission to submit request
  17. on behalf of `jacknich` or `redeniro`:
  18. [source,js]
  19. ---------------------------------------------------
  20. {
  21. "run_as" : [ "jacknich", "rdeniro" ]
  22. }
  23. ---------------------------------------------------
  24. To submit a request as another user, you specify the user in the
  25. `es-security-runas-user` request header. For example:
  26. [source,shell]
  27. ---------------------------------------------------
  28. curl -H "es-security-runas-user: jacknich" -u es_admin -XGET 'http://localhost:9200/'
  29. ---------------------------------------------------