es-security-principles.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. [[es-security-principles]]
  2. == {es} security principles
  3. Protecting your {es} cluster and the data it contains is of utmost importance.
  4. Implementing a defense in depth strategy provides multiple layers of security
  5. to help safeguard your system. The following principles provide a foundation
  6. for running {es} in a secure manner that helps to mitigate attacks on your
  7. system at multiple levels.
  8. [discrete]
  9. [[security-run-with-security]]
  10. === Run {es} with security enabled
  11. Never run an {es} cluster without security enabled. This principle cannot be
  12. overstated. Running {es} without security leaves your cluster exposed to anyone
  13. who can send network traffic to {es}, permitting these individuals to download,
  14. modify, or delete any data in your cluster.
  15. <<configuring-stack-security,Start the {stack} with security enabled>> or
  16. <<manually-configure-security,manually configure security>> to prevent
  17. unauthorized access to your clusters and ensure that internode communication
  18. is secure.
  19. [discrete]
  20. [[security-not-root-user]]
  21. === Run {es} with a dedicated non-root user
  22. Never try to run {es} as the `root` user, which would invalidate any defense
  23. strategy and permit a malicious user to do *anything* on your server. You must
  24. create a dedicated, unprivileged user to run {es}. By default, the `rpm`, `deb`,
  25. `docker`, and Windows packages of {es} contain an `elasticsearch` user with
  26. this scope.
  27. [discrete]
  28. [[security-protect-cluster-traffic]]
  29. === Protect {es} from public internet traffic
  30. Even with security enabled, never expose {es} to public internet traffic.
  31. Using an application to sanitize requests to {es} still poses risks, such as
  32. a malicious user writing <<search,`_search`>> requests that could overwhelm an
  33. {es} cluster and bring it down. Keep {es} as isolated as possible, preferably
  34. behind a firewall and a VPN. Any internet-facing applications should run
  35. pre-canned aggregations, or not run aggregations at all.
  36. While you absolutely shouldn't expose {es} directly to the internet, you also
  37. shouldn't expose {es} directly to users. Instead, use an intermediary
  38. application to make requests on behalf of users. This implementation allows you
  39. to track user behaviors, such as can submit requests, and to which specific
  40. nodes in the cluster. For example, you can implement an application that accepts
  41. a search term from a user and funnels it through a
  42. <<query-dsl-simple-query-string-query,`simple_query_string`>> query.
  43. [discrete]
  44. [[security-create-appropriate-users]]
  45. === Implement role based access control
  46. <<defining-roles,Define roles>> for your users and
  47. <<security-privileges,assign appropriate privileges>> to ensure that users have
  48. access only to the resources that they need. This process determines whether the
  49. user behind an incoming request is allowed to run that request.