Set up minimal security for Elasticsearch

John Doe ·

1205 Views

* Please refer to this. 

IMPORTANT: No additional bug fixes or documentation updates will be released for this version. For the latest information, see the current release documentation. Elastic Docs› Elasticsearch Guide [7.16]› Secure the Elastic Stack› Configure security for th

 

* Django setup elasticsearch client with password auth

You can pass the elasticsearch URL as

from urllib.parse import quote_plus as urlquote

elk_base_url = 'elasticsearch://{user_name}:{password}@{host_ip}:{host_port}'
elastic_search_url = elk_base_url.format(user_name='my_username',
                                         password=urlquote('mysecret_password'),
                                         # password may contain special characters
                                         host_ip='my-elastic-host-ip',
                                         host_port=9200)
ELASTICSEARCH_DSL = {
    'default': {
        'hosts': [elastic_search_url]
    },
}

 

elasticsearch