how-security-works.asciidoc 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [role="xpack"]
  2. [[how-security-works]]
  3. == How security works
  4. An Elasticsearch cluster is typically made out of many moving parts. There are
  5. the Elasticsearch nodes that form the cluster, and often Logstash instances,
  6. Kibana instances, Beats agents an clients, all communicating with the it.
  7. It should not come as a surprise that securing such clusters has many facets and
  8. layers.
  9. {security} provides the means to secure the Elastic cluster on several levels:
  10. * <<setting-up-authentication>>
  11. * Authorization and Role Based Access Control (a.k.a RBAC)
  12. * Node/Client Authentication and Channel Encryption
  13. * Auditing
  14. [float]
  15. === Authorization
  16. The authorization process takes place once a request is authenticated and the
  17. User behind the request is identified. Authorization is the process of determining
  18. whether the user behind an incoming request is allowed to execute it. Naturally,
  19. this process takes place right after an successful authentication - when the
  20. user identity is known.
  21. The authorization process revolves around the following 5 constructs:
  22. _Secured Resource_::
  23. A resource to which access is restricted. Indices/aliases, documents, fields,
  24. users and the Elasticsearch cluster itself are all examples of secured objects.
  25. _Privilege_::
  26. A named group representing one or more actions that a user may execute against a
  27. secured resource. Each secured resource has its own sets of available privileges.
  28. For example, `read` is an index privilege that represents all actions that enable
  29. reading the indexed/stored data. For a complete list of available privileges
  30. see <<security-privileges>>.
  31. _Permissions_::
  32. A set of one or more privileges against a secured resource. Permissions can
  33. easily be described in words, here are few examples:
  34. * `read` privilege on the `products` index
  35. * `manage` privilege on the cluster
  36. * `run_as` privilege on `john` user
  37. * `read` privilege on documents that match query X
  38. * `read` privilege on `credit_card` field
  39. _Role_::
  40. A named sets of permissions
  41. _User_::
  42. The authenticated user.
  43. A secure Elasticsearch cluster manages the privileges of users through _roles_.
  44. A role has a unique name and identifies a set of permissions that translate to
  45. privileges on resources. A user can be associated with an arbitrary number of
  46. roles. The total set of permissions that a user has is therefore defined by
  47. union of the permissions in all its roles.
  48. Roles can be assigned to users in a number of ways depending on the realms by
  49. which the users are authenticated.
  50. For more information on user authentication see <<authorization>>
  51. [float]
  52. === Node/client authentication and channel encryption
  53. {security} supports configuring SSL/TLS for securing the communication channels
  54. to, from and within the cluster. This support accounts for:
  55. * Encryption of data transmitted over the wires
  56. * Certificate based node authentication - preventing unauthorized nodes/clients
  57. from establishing a connection with the cluster.
  58. For more information, see <<encrypting-communications, Encrypting Communications>>.
  59. {security} also enables you to <<ip-filtering, configure IP Filters>> which can
  60. be seen as a light mechanism for node/client authentication. With IP Filtering
  61. you can restrict the nodes and clients that can connect to the cluster based
  62. on their IP addresses. The IP filters configuration provides whitelisting
  63. and blacklisting of IPs, subnets and DNS domains.
  64. [float]
  65. === Auditing
  66. When dealing with any secure system, it is critical to have a audit trail
  67. mechanism set in place. Audit trails log various activities/events that occur in
  68. the system, enabling you to analyze and back track past events when things go
  69. wrong (e.g. security breach).
  70. {security} provides such audit trail functionality for all nodes in the cluster.
  71. You can configure the audit level which accounts for the type of events that are
  72. logged. These events include failed authentication attempts, user access denied,
  73. node connection denied, and more.
  74. For more information on auditing see <<auditing>>.