首页 文章

如何使用nginx阻止选定的Kibana子页面?

提问于
浏览
0

我有一个与nginx相关的问题 . 我使用elasticsearch和Kibana来存储和可视化数据 . 我想使用nginx阻止访问Kibana中选定的子页面 . Kibana中有几个子页面(应用程序):

  • 发现(localhost:5601 / app / kibana#/ discover)

  • Visualize(localhost:5601 / app / kibana#/ visualize)

  • 仪表板(localhost:5601 / app / kibana#/ dashboard)

  • Timelion(localhost:5601 / app / timelion)

  • 开发工具(localhost:5601 / app / kibana#/ dev_tools)

  • 管理(localhost:5601 / app / kibana#/ management)

我想向拥有Visualize,Dashboard和Timelion子页面密码的所有用户授予权限 . 但我想阻止(使用不同的密码)Discover,Dev Tools和Management子页面 . 我创建了三个文件 .

  • kibana.htpasswd - 用户'elastic'应具有Visualize,Dashboard和Timelion子页面的权限,并且不应具有Discover,Dev Tools和Management子页面的权限

  • kibana-admin.htpasswd - 用户'admin'应该拥有所有子页面的权限

  • kibana.conf - 配置文件

kibana.conf:

server {
listen *:5611;
server_name localhost;
access_log /var/log/nginx/kibana-access.log;
error_log /var/log/nginx/kibana-error.log;

location / {
auth_basic "Access denied";
auth_basic_user_file /etc/nginx/conf.d/kibana.htpasswd;
proxy_pass localhost:5601;
}

location /app/kibana#/management {
auth_basic "Access denied";
auth_basic_user_file /etc/nginx/conf.d/kibana-admin.htpasswd;
proxy_pass localhost:5601;
}

location /app/kibana#/dev_tools {
auth_basic "Access denied";
auth_basic_user_file /etc/nginx/conf.d/kibana-admin.htpasswd;
proxy_pass localhost:5601;
}

location /app/kibana#/discover {
auth_basic "Access denied";
auth_basic_user_file /etc/nginx/conf.d/kibana-admin.htpasswd;
proxy_pass localhost:5601;
}
}

问题是,当我在浏览器中打开localhost:5611并以用户'弹性'登录时,我对所有子页面都有权限 . 我应该在配置文件中更改什么来阻止用户'弹性'的管理子页面? nginx有可能吗?

1 回答

  • 1

    我认为这不可能与nginx有关,你可能想要研究保护kibana的替代品 .

    Searchguard是保护kibana的一种很好的开源方法 . 还有X-Pack,它为ELK堆栈提供了一些有用的功能(不是那么开源......)

相关问题