Last active
August 29, 2015 13:56
-
-
Save kylekrall/8946831 to your computer and use it in GitHub Desktop.
Logstash + Kibana + Nginx + Google_Auth_Proxy - Authentication w/ Google OAuth2 using bit.ly's google_auth_proxy - Restrict dashboard editing to specific users
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
location ~ ^/kibana-int/dashboard/.*$ { | |
set $privs NA; # by default, no privs needed | |
proxy_read_timeout 90; | |
if ( $request_method ~ (PUT|DELETE) ) { | |
set $privs M; # M for modify | |
} | |
if ( $remote_user ~ (admin1|admin2|admin3|admin4) ) { | |
set $privs "${privs}Y"; # Y for admin | |
} | |
if ( $privs = MY ) { | |
proxy_pass http://127.0.0.1:9200; # if modify w/ admin proxy it over | |
} | |
if ( $privs = M ) { | |
return 401; # if modify w/o admin return 401 Unauthorized | |
} | |
if ( $request_method !~ (PUT|DELETE) ) { | |
proxy_pass http://127.0.0.1:9200; # acts as an else statement | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relies on the following:
https://github.com/logstash/logstash
https://github.com/elasticsearch/kibana
https://github.com/nginx/nginx
https://github.com/bitly/google_auth_proxy