Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5665dcf
Fix wrong HTML tags, indention and space between paragraph and tables…
yoonjs2 Jan 17, 2016
5b091e4
Fix wrong HTML tags, indention and space between paragraph and tables…
yoonjs2 Jan 17, 2016
4d1503a
Merge remote-tracking branch 'origin/master'
yoonjs2 Jan 17, 2016
5f0a6e0
Merge remote-tracking branch 'origin/master'
yoonjs2 Jan 17, 2016
079480f
Merge remote-tracking branch 'origin/master'
yoonjs2 Jan 17, 2016
af55811
Merge remote-tracking branch 'origin/master'
yoonjs2 Jan 17, 2016
781954b
Interpreter documentation merge with commit #578
yoonjs2 Jan 17, 2016
db8b4da
Merge remote-tracking branch 'upstream/master'
yoonjs2 Jan 17, 2016
eba0315
Merge remote-tracking branch 'upstream/master'
yoonjs2 Jan 19, 2016
3d9e5b3
Merge remote-tracking branch 'upstream/master'
yoonjs2 Mar 14, 2016
aac4cd4
Add documentation for explaining enable HTTP basic authentication ser…
yoonjs2 Mar 14, 2016
4b2223a
Make path to cert and key for HTTPS Ambigious
yoonjs2 Mar 14, 2016
35a6679
Merge branch 'master' of https://github.com/apache/incubator-zeppelin
yoonjs2 Mar 15, 2016
90219f7
Merge branch 'master' of https://github.com/apache/incubator-zeppelin
yoonjs2 Mar 21, 2016
6d04fa7
Merge branch 'master' of https://github.com/apache/incubator-zeppelin
yoonjs2 Apr 9, 2016
6a5a3c8
Merge branch 'master' of https://github.com/apache/incubator-zeppelin
yoonjs2 Apr 18, 2016
7525167
Merge branch 'master' of https://github.com/apache/incubator-zeppelin
yoonjs2 May 8, 2016
3d48de4
Fix documentation to supply more information for help to setup basic …
yoonjs2 May 8, 2016
5c97838
Remove unused image files
yoonjs2 May 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
32 changes: 15 additions & 17 deletions docs/security/authentication.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,42 +34,43 @@ This instruction based on Ubuntu 14.04 LTS but may work with other OS with few c

1. Install NGINX server on your server instance

You can install NGINX server with same machine where zeppelin installed or separate machine where it is dedicated to serve as proxy server.
You can install NGINX server with same box where zeppelin installed or separate box where it is dedicated to serve as proxy server.

```
$ apt-get install nginx
```
*Important: On pre 1.3.13 version of NGINX, Proxy for Websocket may not fully works. Please use latest version of NGINX. See: [NGINX documentation](https://www.nginx.com/blog/websocket-nginx/)*

1. Setup init script in NGINX

In most cases, NGINX configuration located under `/etc/nginx/sites-available`. Create your own configuration or add your existing configuration at `/etc/nginx/sites-available`.

```
$ cd /etc/nginx/sites-available
$ touch my-basic-auth
$ touch my-zeppelin-auth-setting
```

Now add this script into `my-basic-auth` file. You can comment out `optional` lines If you want serve Zeppelin under regular HTTP 80 Port.
Now add this script into `my-zeppelin-auth-setting` file. You can comment out `optional` lines If you want serve Zeppelin under regular HTTP 80 Port.

```
upstream zeppelin {
server [YOUR-ZEPPELIN-SERVER-IP]:8080;
server [YOUR-ZEPPELIN-SERVER-IP]:[YOUR-ZEPPELIN-SERVER-PORT]; # For security, It is highly recommended to make this address/port as non-public accessible
}

# Zeppelin Website
server {
listen [YOUR-ZEPPELIN-WEB-SERVER-PORT];
listen 443 ssl; # optional, to serve HTTPS connection
server_name [YOUR-ZEPPELIN-SERVER-HOST]; # for example: zeppelin.mycompany.com
listen 443 ssl; # optional, to serve HTTPS connection
server_name [YOUR-ZEPPELIN-SERVER-HOST]; # for example: zeppelin.mycompany.com

ssl_certificate [PATH-TO-YOUR-CERT-FILE]; # optional, to serve HTTPS connection
ssl_certificate_key [PATH-TO-YOUR-CERT-KEY-FILE]; # optional, to serve HTTPS connection

if ($ssl_protocol = "") {
rewrite ^ https://$host$request_uri? permanent; # optional, force to use HTTPS
rewrite ^ https://$host$request_uri? permanent; # optional, to force use of HTTPS
}

location / {
location / { # For regular websever support
proxy_pass http://zeppelin;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All@@ -80,7 +81,7 @@ This instruction based on Ubuntu 14.04 LTS but may work with other OS with few c
auth_basic_user_file /etc/nginx/.htpasswd;
}

location /ws {
location /ws { # For websocket support
proxy_pass http://zeppelin;
proxy_http_version 1.1;
proxy_set_header Upgrade websocket;
Expand All@@ -93,7 +94,7 @@ This instruction based on Ubuntu 14.04 LTS but may work with other OS with few c
Then make a symbolic link to this file from `/etc/nginx/sites-enabled/` to enable configuration above when NGINX reloads.

```
$ ln -s /etc/nginx/sites-enabled/my-basic-auth /etc/nginx/sites-available/my-basic-auth
$ ln -s /etc/nginx/sites-enabled/my-zeppelin-auth-setting /etc/nginx/sites-available/my-zeppelin-auth-setting
```

1. Setup user credential into `.htpasswd` file and restart server
Expand All@@ -102,11 +103,11 @@ This instruction based on Ubuntu 14.04 LTS but may work with other OS with few c

```
$ cd /etc/nginx
$ htpasswd -c htpasswd [YOUR_ID]
$ NEW passwd: [YOUR_PASSWORD]
$ RE-type new passwd: [YOUR_PASSWORD_AGAIN]
$ htpasswd -c htpasswd [YOUR-ID]
$ NEW passwd: [YOUR-PASSWORD]
$ RE-type new passwd: [YOUR-PASSWORD-AGAIN]
```
Or you can use your own apache `.htpasswd` files in other location by setup property `auth_basic_user_file`
Or you can use your own apache `.htpasswd` files in other location for setting up property: `auth_basic_user_file`

Restart NGINX server.

Expand All@@ -115,9 +116,6 @@ This instruction based on Ubuntu 14.04 LTS but may work with other OS with few c
```
Then check HTTP Basic Authentication works in browser. If you can see regular basic auth popup and then able to login with credential you entered into `.htpasswd` you are good to go.

<img src="/assets/themes/zeppelin/img/screenshots/authentication-basic-auth-nginx-request.png" />
<img src="/assets/themes/zeppelin/img/screenshots/authentication-basic-auth-nginx-https.png" />

1. More security consideration

@LeemoonsooLeemoonsooMay 16, 2016

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you also remove image files

"docs/assets/themes/zeppelin/img/screenshots/authentication-basic-auth-nginx-request.png" and "docs/assets/themes/zeppelin/img/screenshots/authentication-basic-auth-nginx-https.png" ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Leemoonsoo No problem. I'd remove png files you pointed out :)
Thank you for your review.


* Using HTTPS connection with Basic Authentication is highly recommended since basic auth without encryption may expose your important credential information over the network.
Expand Down