This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic Authentication to the stack in Lieu of XPACK Auth (#42)
* add automated CogStack container build on cloud.docker.com * modify CogStack Docker CMD script * add multi-node ELK Stack and CogStack docker-compose file * correct typo when copying elasticsearch.yml * add docs for multi-node ELK stack cogstack compose add to main README.md the docker-compose docs for docker-cogstack/compose-ymls/cogstack-clust/ * add basic auth nginx proxy to stack * proxy/auth both kibana and elasticsearch as default (drop elastic search proxy for prod)
- Loading branch information
Showing
4 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ nbproject/* | |
.idea/* | ||
cogstack*log | ||
logs/* | ||
|
||
.htpasswd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
docker-cogstack/compose-ymls/cogstack-clust/nginx/auth/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Basic Auth with nginx | ||
===================== | ||
https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ | ||
|
||
Password file creation utility such as apache2-utils | ||
|
||
```sh | ||
$ sudo htpasswd -c ./auth/.htpasswd user1 | ||
``` | ||
|
||
Press Enter and type the password for user1 at the prompts. | ||
|
||
Create additional user-password pairs. Omit the -c flag because the file already exists: | ||
|
||
```sh | ||
$ sudo htpasswd -c ./auth/.htpasswd user1 | ||
``` | ||
|
||
You can confirm that the file contains paired usernames and encrypted passwords: | ||
|
||
```sh | ||
$ cat ./auth/.htpasswd | ||
|
||
user1:$apr1$/woC1jnP$KAh0SsVn5qeSMjTtn0E9Q0 | ||
user2:$apr1$QdR8fNLT$vbCEEzDj7LyqCMyNpSoBh/ | ||
user3:$apr1$Mr5A0e.U$0j39Hp5FfxRkneklXaMrr/ | ||
``` | ||
|
||
|
34 changes: 34 additions & 0 deletions
34
docker-cogstack/compose-ymls/cogstack-clust/nginx/config/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
worker_processes 1; | ||
|
||
events { worker_connections 1024; } | ||
|
||
|
||
http { | ||
|
||
server { | ||
listen 5601; | ||
# access_log /var/log/nginx/access.log compression; | ||
|
||
location / { | ||
proxy_pass http://kibana:5601; | ||
proxy_set_header Host $host; | ||
auth_basic "Cogstack Login"; | ||
auth_basic_user_file /etc/apache2/.htpasswd; | ||
} | ||
} | ||
|
||
|
||
server { | ||
listen 9200; | ||
# access_log /var/log/nginx/access.log compression; | ||
|
||
location / { | ||
proxy_pass http://elasticsearch:9200; | ||
proxy_set_header Host $host; | ||
auth_basic "Elasticsearch Login"; | ||
auth_basic_user_file /etc/apache2/.htpasswd; | ||
} | ||
} | ||
} | ||
|
||
|