Configure security in Kibanaedit

Kibana users have to log in when Elastic Stack security features are enabled on your cluster. You configure roles for your Kibana users to control what data those users can access.

Most requests made through Kibana to Elasticsearch are authenticated by using the credentials of the logged-in user. There are, however, a few internal requests that the Kibana server needs to make to the Elasticsearch cluster. For this reason, you must configure credentials for the Kibana server to use for those requests.

With security features enabled, if you load a Kibana dashboard that accesses data in an index that you are not authorized to view, you get an error that indicates the index does not exist. The security features do not currently provide a way to control which users can load which dashboards.

To use Kibana with security features:

  1. Configure security in Elasticsearch.
  2. Configure Kibana to use the appropriate built-in user.

    Update the following settings in the kibana.yml configuration file:

    elasticsearch.username: "kibana_system"
    elasticsearch.password: "kibanapassword"

    The Kibana server submits requests as this user to access the cluster monitoring APIs and the .kibana index. The server does not need access to user indices.

    The password for the built-in kibana_system user is typically set as part of the security configuration process on Elasticsearch. For more information, see Built-in users.

  3. Set the property in the kibana.yml configuration file. You can use any text string that is 32 characters or longer as the encryption key. "something_at_least_32_characters"

    For more information, see Security settings in Kibana.

  4. Configure Kibana’s session expiration settings. Set both the idle timeout and lifespan settings: "1h" "30d"

    For more information, see Session management in Kibana.

  5. Optional: Configure Kibana to encrypt communications.
  6. Optional: Configure Kibana to authenticate to Elasticsearch with a client certificate.
  7. Restart Kibana.
  8. Choose an authentication mechanism and grant users the privileges they need to use Kibana.

    For more information on Basic Authentication and additional methods of authenticating Kibana users, see Authentication.

    To manage privileges, open the main menu, then click Stack Management > Roles.

    If you’re using the native realm with Basic Authentication, open then main menu, then click Stack Management > Users to assign roles, or use the user management APIs. For example, the following creates a user named jacknich and assigns it the kibana_admin role:

    POST /_security/user/jacknich
      "password" : "t0pS3cr3t",
      "roles" : [ "kibana_admin" ]
  9. Grant users access to the indices that they will be working with in Kibana.

    You can define as many different roles for your Kibana users as you need.

    For example, create roles that have read and view_index_metadata privileges on specific index patterns. For more information, see User authorization.

  10. Verify that you can log in as a user. If you are running Kibana locally, go to https://localhost:5601 and enter the credentials for a user you’ve assigned a Kibana user role. For example, you could log in as the user jacknich.

    This must be a user who has been assigned Kibana privileges. Kibana server credentials should only be used internally by the Kibana server.