{"id":22018410,"url":"https://github.com/flavienbwk/secure-docker-elastic-cluster","last_synced_at":"2025-05-07T03:27:25.081Z","repository":{"id":124243383,"uuid":"271775241","full_name":"flavienbwk/Secure-Docker-Elastic-Cluster","owner":"flavienbwk","description":"An end-to-end fully secure Elasticsearch cluster with Kibana and run with Docker. Using official images.","archived":false,"fork":false,"pushed_at":"2023-12-06T17:02:42.000Z","size":117,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T19:07:38.684Z","etag":null,"topics":["docker","docker-compose","elasticsearch","elasticsearch-cluster","enterprise-search","kibana"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flavienbwk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-12T10:49:57.000Z","updated_at":"2024-01-26T21:53:12.000Z","dependencies_parsed_at":"2023-12-06T18:25:40.104Z","dependency_job_id":"285dec9d-7df7-49c4-8c01-a63bceb9af0c","html_url":"https://github.com/flavienbwk/Secure-Docker-Elastic-Cluster","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavienbwk%2FSecure-Docker-Elastic-Cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavienbwk%2FSecure-Docker-Elastic-Cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavienbwk%2FSecure-Docker-Elastic-Cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavienbwk%2FSecure-Docker-Elastic-Cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flavienbwk","download_url":"https://codeload.github.com/flavienbwk/Secure-Docker-Elastic-Cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227276026,"owners_count":17757146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","elasticsearch","elasticsearch-cluster","enterprise-search","kibana"],"created_at":"2024-11-30T05:12:08.246Z","updated_at":"2024-11-30T05:12:08.726Z","avatar_url":"https://github.com/flavienbwk.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure Docker Elastic cluster\n\nAn 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 ?\n\n![Kibana Elasticsearch cluster](./images/kibana_elasticsearch_cluster.png)\n\nFirst, you will need to raise your host's ulimits for Elasticsearch to be able to handle high I/O :\n\n```console\nsudo sysctl -w vm.max_map_count=500000\n```\n\nNow, we will generate the certificates for your cluster :\n\n```console\ndocker-compose -f create-certs.yml run --rm create_certs\n```\n\nThat's it ! Start the cluster with :\n\n```console\ndocker-compose up -d\n```\n\nAccess Kibana through [https://localhost:5601](https://localhost:5601)\n\n\u003e Default username is `elastic` and password is `changeme`\n\n## User management\n\nUser management can be performed both through the UI and from API calls. This chapter focuses on API call examples.\n\nTo create a new user `ingest` with password `changeme` :\n\n```bash\ncurl -k -X POST \"https://localhost:9200/_security/user/ingest\" -H \"Content-Type: application/json\" -u elastic:changeme -d '{\n  \"password\" : \"changeme\",\n  \"full_name\" : \"Ingest User\",\n  \"roles\": [],\n  \"email\" : \"ingest@example.com\",\n  \"metadata\" : {\n    \"intelligence\" : 7\n  }\n}'\n```\n\nTo update a password :\n\n```bash\ndocker exec -it secure-docker-elastic-cluster-es01-1 bin/elasticsearch-users passwd admin\n```\n\nMake it so `ingest` can write data in `*metric*` or `*logs*` indices :\n\n```bash\ncurl -k -X PUT \"https://localhost:9200/_security/role/ingest-role\" -H \"Content-Type: application/json\" -u elastic:changeme -d'\n{\n  \"cluster\": [\"manage_index_templates\", \"monitor\", \"manage_ilm\"],\n  \"indices\": [\n    {\n      \"names\": [ \"*metric*\", \"*logs*\" ],\n      \"privileges\": [\"read\",\"write\"]\n    }\n  ]\n}'\ncurl -k -X PUT \"https://localhost:9200/_security/user/ingest\" -H \"Content-Type: application/json\" -u elastic:changeme -d '{\n  \"roles\" : [\"ingest-role\"],\n  \"full_name\" : \"Ingest User\",\n  \"email\" : \"ingest@example.com\",\n  \"metadata\" : {\n    \"intelligence\" : 7\n  }\n}'\n```\n\nTest authentication :\n\n```bash\ncurl -k -u ingest:changeme https://localhost:9200/_cluster/health\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflavienbwk%2Fsecure-docker-elastic-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflavienbwk%2Fsecure-docker-elastic-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflavienbwk%2Fsecure-docker-elastic-cluster/lists"}