Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flavienbwk/secure-docker-elastic-cluster
An end-to-end fully secure Elasticsearch cluster with Kibana and run with Docker. Using official images.
https://github.com/flavienbwk/secure-docker-elastic-cluster
docker docker-compose elasticsearch elasticsearch-cluster enterprise-search kibana
Last synced: 2 months ago
JSON representation
An end-to-end fully secure Elasticsearch cluster with Kibana and run with Docker. Using official images.
- Host: GitHub
- URL: https://github.com/flavienbwk/secure-docker-elastic-cluster
- Owner: flavienbwk
- License: mit
- Created: 2020-06-12T10:49:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-06T17:02:42.000Z (about 1 year ago)
- Last Synced: 2024-05-01T19:07:38.684Z (10 months ago)
- Topics: docker, docker-compose, elasticsearch, elasticsearch-cluster, enterprise-search, kibana
- Homepage:
- Size: 114 KB
- Stars: 5
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Secure Docker Elastic cluster
An end-to-end fully secure Elasticsearch cluster (of 3 Elasticsearch instances) with Kibana and run by Docker. Using official images. Ever dreamed of the following ?
![Kibana Elasticsearch cluster](./images/kibana_elasticsearch_cluster.png)
First, you will need to raise your host's ulimits for Elasticsearch to be able to handle high I/O :
```console
sudo sysctl -w vm.max_map_count=500000
```Now, we will generate the certificates for your cluster :
```console
docker-compose -f create-certs.yml run --rm create_certs
```That's it ! Start the cluster with :
```console
docker-compose up -d
```Access Kibana through [https://localhost:5601](https://localhost:5601)
> Default username is `elastic` and password is `changeme`
## User management
User management can be performed both through the UI and from API calls. This chapter focuses on API call examples.
To create a new user `ingest` with password `changeme` :
```bash
curl -k -X POST "https://localhost:9200/_security/user/ingest" -H "Content-Type: application/json" -u elastic:changeme -d '{
"password" : "changeme",
"full_name" : "Ingest User",
"roles": [],
"email" : "[email protected]",
"metadata" : {
"intelligence" : 7
}
}'
```To update a password :
```bash
docker exec -it secure-docker-elastic-cluster-es01-1 bin/elasticsearch-users passwd admin
```Make it so `ingest` can write data in `*metric*` or `*logs*` indices :
```bash
curl -k -X PUT "https://localhost:9200/_security/role/ingest-role" -H "Content-Type: application/json" -u elastic:changeme -d'
{
"cluster": ["manage_index_templates", "monitor", "manage_ilm"],
"indices": [
{
"names": [ "*metric*", "*logs*" ],
"privileges": ["read","write"]
}
]
}'
curl -k -X PUT "https://localhost:9200/_security/user/ingest" -H "Content-Type: application/json" -u elastic:changeme -d '{
"roles" : ["ingest-role"],
"full_name" : "Ingest User",
"email" : "[email protected]",
"metadata" : {
"intelligence" : 7
}
}'
```Test authentication :
```bash
curl -k -u ingest:changeme https://localhost:9200/_cluster/health
```