You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/security/authentication.md
+116Lines changed: 116 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,122 @@ Authentication is company-specific.
23
23
24
24
One option is to use [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)
25
25
26
+
### HTTP Basic Authentication using NGINX
27
+
28
+
> **Quote from Wikipedia:** NGINX is a web server. It can act as a reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer and an HTTP cache.
29
+
30
+
So you can use NGINX server as proxy server to serve HTTP Basic Authentication as a separate process along with Zeppelin server.
31
+
Here are instructions how to accomplish the setup NGINX as a front-end authentication server and connect Zeppelin at behind.
32
+
33
+
This instruction based on Ubuntu 14.04 LTS but may work with other OS with few configuration changes.
34
+
35
+
1. Install NGINX server on your server instance
36
+
37
+
You can install NGINX server with same machine where zeppelin installed or separate machine where it is dedicated to serve as proxy server.
38
+
39
+
```
40
+
$ apt-get install nginx
41
+
```
42
+
43
+
1. Setup init script in NGINX
44
+
45
+
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`.
46
+
47
+
```
48
+
$ cd /etc/nginx/sites-available
49
+
$ touch my-basic-auth
50
+
```
51
+
52
+
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.
53
+
54
+
```
55
+
upstream zeppelin {
56
+
server [YOUR-ZEPPELIN-SERVER-IP]:8090;
57
+
}
58
+
59
+
upstream zeppelin-wss {
60
+
server [YOUR-ZEPPELIN-SERVER-IP]:8091;
61
+
}
62
+
63
+
# Zeppelin Website
64
+
server {
65
+
listen 80;
66
+
listen 443 ssl; # optional, to serve HTTPS connection
67
+
server_name [YOUR-ZEPPELIN-SERVER-HOST]; # for example: zeppelin.mycompany.com
68
+
69
+
ssl_certificate /etc/nginx/conf.d/yimocall.chained.crt; # optional, to serve HTTPS connection
70
+
ssl_certificate_key /etc/nginx/conf.d/yimocall.key; # optional, to serve HTTPS connection
71
+
72
+
if ($ssl_protocol = "") {
73
+
rewrite ^ https://$host$request_uri? permanent; # optional, force to use HTTPS
1. Setup user credential into `.htpasswd` file and restart server
113
+
114
+
Now you need to setup `.htpasswd` file to serve list of authenticated user credentials for NGINX server.
115
+
116
+
```
117
+
$ cd /etc/nginx
118
+
$ htpasswd -c htpasswd [YOUR_ID]
119
+
$ NEW passwd: [YOUR_PASSWORD]
120
+
$ RE-type new passwd: [YOUR_PASSWORD_AGAIN]
121
+
```
122
+
Or you can use your own apache `.htpasswd` files in other location by setup property `auth_basic_user_file`
123
+
124
+
Restart NGINX server.
125
+
126
+
```
127
+
$ service nginx restart
128
+
```
129
+
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.
* Using HTTPS connection with Basic Authentication is highly recommended since basic auth without encryption may expose your important credential information over the network.
137
+
* Using [Shiro Security feature built-into Zeppelin](https://github.com/apache/incubator-zeppelin/pull/53) is recommended if you prefer all-in-one solution for authentication but NGINX may provides ad-hoc solution for re-use authentication served by your system's NGINX server or in case of you need to separate authentication from zeppelin server.
138
+
* It is recommended to isolate direct connection to Zeppelin server from public internet or external services to secure your zeppelin instance from unexpected attack or problems caused by public zone.
139
+
140
+
### Another option
141
+
26
142
Another option is to have an authentication server that can verify user credentials in an LDAP server.
27
143
If an incoming request to the Zeppelin server does not have a cookie with user information encrypted with the authentication server public key, the user
28
144
is redirected to the authentication server. Once the user is verified, the authentication server redirects the browser to a specific
0 commit comments