Skip to content

Commit 4b26179

Browse files
authoredJan 30, 2020
Bring elasticsearch_and_kibana_auth back from the dead (chef#2253)
Signed-off-by: IanMadd <[email protected]>
1 parent b0d4e6d commit 4b26179

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
=====================================================
2+
Authentication for Elasticsearch and Kibana
3+
=====================================================
4+
`[edit on GitHub] <https://github.com/chef/chef-web-docs/blob/master/chef_master/source/elasticsearch_and_kibana_auth.rst>`__
5+
6+
.. meta::
7+
:robots: noindex
8+
9+
.. tag chef_automate_mark
10+
11+
.. image:: ../../images/a2_docs_banner.svg
12+
:target: https://automate.chef.io/docs
13+
14+
.. end_tag
15+
16+
.. tag EOL_a1
17+
18+
.. danger:: This documentation applies to a `deprecated product </versions.html#deprecated-products-and-versions>`__. Chef Automate includes newer out-of-the-box compliance profiles, an improved compliance scanner with total cloud scanning functionality, better visualizations, role-based access control and many other features. Chef Automate is included as part of the Workflow license agreement and is `available via subscription <https://www.chef.io/pricing/>`_.
19+
20+
.. end_tag
21+
22+
Node data in Chef Automate is stored in `Elasticsearch <https://www.elastic.co/products/elasticsearch>`__ and viewable in the Chef Automate UI as well as `Kibana <https://www.elastic.co/products/kibana>`__. Access to Chef Automate's Elasticsearch and Kibana is protected by the same authentication used by the Chef Automate user interface. Elasticsearch authentication is enabled by default.
23+
24+
.. tag kibana_note
25+
26+
.. note:: As of Chef Automate 1.6.87, Kibana is no longer enabled by default. To enable it, see the `Kibana setup documentation <https://www.elastic.co/guide/en/kibana/current/setup.html>`_. In prior versions of Chef Automate, Kibana and its authentication are enabled by default.
27+
28+
.. end_tag
29+
30+
How It Works
31+
============
32+
33+
* User logs into the Chef Automate UI normally.
34+
* Chef Automate stores information about the user's session in browser local storage as well as a browser cookie.
35+
* If authentication is enabled for Elasticsearch or Kibana, Chef Automate's web server will look for the session cookie and validate the session is valid and active.
36+
* If the session is valid and active, the request is permitted.
37+
* If the session is invalid, or if no session information is present, the server returns a ``401 Unauthorized`` message.
38+
39+
40+
Accessing Elasticsearch with Authentication - Node Visibility UI
41+
=================================================================
42+
43+
The Automate node visibility UI performs a number of queries to Elasticsearch in order to present the node visibility data. The Chef Automate server will validate each of the Elasticsearch requests with the session cookie information as described in the **How It Works** section above.
44+
45+
46+
Accessing Elasticsearch with Authentication - API/CLI
47+
=====================================================
48+
49+
If you wish to access Elasticsearch via your Chef Automate server via a CLI tool (such as ``curl``) or an API client (such as `elasticsearch-ruby <https://github.com/elastic/elasticsearch-ruby>`__), you must pass three additional HTTP headers in your requests for your request to be properly authenticated:
50+
51+
* ``chef-delivery-user``: the Chef Automate username for whom a token has been generated
52+
* ``chef-delivery-token``: a valid token generated for the user
53+
* ``chef-delivery-enterprise``: the Chef Automate enterprise name. This is the string after the ``/e/`` in your Chef Automate URLs.
54+
* Example: if your Workflow dashboard URL is ``https://my-automate-server.mycompany.biz/e/coolcompany/#/dashboard``, your enterprise is ``coolcompany``
55+
56+
To generate a token, use the ``delivery token`` command of the `Delivery CLI </delivery_cli.html>`__.
57+
58+
For example, to pass the required headers using curl:
59+
60+
.. code-block:: bash
61+
62+
curl https://my-automate-server.mycompany.biz/elasticsearch/_cat/indices -H "chef-delivery-user: myuser" -H "chef-delivery-enterprise: coolcompany" -H "chef-delivery-token: s00pers33krett0ken"
63+
64+
65+
Accessing Kibana with Authentication
66+
====================================
67+
68+
Your browser must have a valid cookie containing a valid token before access to Kibana will be permitted. If you encounter a "401 Unauthorized" error message, follow these steps:
69+
70+
* Log into the Chef Automate UI normally.
71+
* Change your browser URI to ``/kibana``.
72+
* Example: ``https://my-automate-server.mycompany.biz/kibana``
73+
74+
75+
Configuration
76+
=============
77+
78+
.. warning:: It is strongly recommended that authentication to Elasticsearch and Kibana remain enabled at all times. Without authentication, any user with network access to your Automate server will be able to view any available Visibility data.
79+
80+
If you wish to disable authentication for either Kibana or Elasticsearch, you may use the following configuration parameters in your ``/etc/delivery/delivery.rb`` configuration file:
81+
82+
* ``elasticsearch['enable_auth']``: If ``true``, a valid user/enterprise/token must be supplied in a cookie or in HTTP headers for the request to be accepted and passed to Elasticsearch. If ``false``, all Elasticsearch queries are permitted without authentication. Default: ``true``
83+
84+
* ``kibana['enable_auth']``: If ``true``, a valid user/enterprise/token must be supplied in a cookie or in HTTP headers for access to be granted to the Kibana UI. If ``false``, all Kibana access is permitted without authentication. Default: ``true``

‎chef_master/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ Addenda
556556
dsl_delivery
557557
dsl_handler
558558
dsl_recipe
559+
elasticsearch_and_kibana_auth
559560
environment_variables
560561
environments
561562
errors

0 commit comments

Comments
 (0)
Please sign in to comment.