• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

elasticfence/elasticsearch-http-user-auth: HTTP Basic Authentication and IP ACL ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

elasticfence/elasticsearch-http-user-auth

开源软件地址:

https://github.com/elasticfence/elasticsearch-http-user-auth

开源编程语言:

Java 86.8%

开源软件介绍:

Build Status

Elasticfence - Elasticsearch HTTP Basic User Auth plugin

Elasticsearch user authentication plugin with http basic auth and IP ACL

This plugin provides user authentication APIs and a User management web console.

Installation

bin/plugin install https://raw.githubusercontent.com/elasticfence/elasticsearch-http-user-auth/5.1.2/jar/elasticfence-5.1.2-SNAPSHOT.zip

Build with Maven

mvn package clean
bin/plugin install file:///path/to/repo/jar/elasticfence-5.1.2-SNAPSHOT.zip

Configuration

Enabling/Disabling Elasticfence

elasticfence.disabled: false

To disable the plugin set elasticfence.disabled to true

Root Access

elasticfence.root.password: rootpassword

To set the root password on each start use elasticfence.root.password

Only the root user can access ES's root APIs (like /_cat, /_cluster) and all indices. Other users can access URLs under their own indices that are specified with this plugin's API.

Sharding Scheme

elasticfence.number_of_shards: 1
elasticfence.number_of_replicas: 3

Omit these config options to use the Elasticsearch defaults (currently 5 and 1 respectively), otherwise set them according to desired level of redundancy and cluster scheme.

Basic IP ACL

IPs contained in whitelist array will bypass authentication, blacklisted IPs will be blocked. All other IPs will show an authentication window.

elasticfence.whitelist: ["127.0.0.1", "10.0.0.1"]
elasticfence.blacklist: ["127.0.0.2", "10.0.0.99"]

To block all IPs that are not in the whitelist, use the following option for elasticfence.blacklist

elasticfence.blacklist: ["*"]

Kibana 4

Add index filter "/.kibana" to a your_custom_username which you created on Elasticfence and set it in kibana.yml:

elasticsearch.username: your_custom_username
elasticsearch.password: your_custom_password

Add permissions to your kibana users using regex filters:

/index.*,/_.*,/.kibana,/

Kibana 4.x Auth Plugin

To facilitate users and improve security, the optional Kibana Auth plugin can be deployed alongside Elastifence:

bin/kibana plugin --install kibana-auth-plugin -u https://github.com/elasticfence/kibana-auth-elasticfence/releases/download/snapshot/kauth-latest.tar.gz


Add username and password on HTTP requests

The authentication method of this plugin is Basic Authentication. Therefore, you should add your username and password on URL string. For example:

http://root:[email protected]:9200/
CURL
curl -u root:rootpassword http://your.elasticsearch.hostname:9200/
{
  "status" : 200,
  "name" : "Piranha",
  "cluster_name" : "elastic1",
  "version" : {
    "number" : "1.7.3",
    "build_hash" : "05d4530971ef0ea46d0f4fa6ee64dbc8df659682",
    "build_timestamp" : "2015-10-15T09:14:17Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

Plugins using ES's REST API also have to be set root password in their configurations.

The ways of configuring Marvel and Kibana 4 are below:

Marvel

elasticsearch.yml:

marvel.agent.exporter.es.hosts: ["root:[email protected]:9200"]

User Management Console

User Management API

This plugin provides a web API to manage users and permissions.

Add User:
http://your.elasticsearch.hostname:9200/_httpuserauth?mode=adduser&username=admin&password=somepass
Add Index Permissions:
http://your.elasticsearch.hostname:9200/_httpuserauth?mode=addindex&username=admin&index=index*
Update Index Permissions:
http://your.elasticsearch.hostname:9200/_httpuserauth?mode=updateindex&username=admin&index=index-*
Delete User:
http://your.elasticsearch.hostname:9200/_httpuserauth?mode=deleteuser&username=admin
List User(s):
http://your.elasticsearch.hostname:9200/_httpuserauth?mode=list
[{ 
  "username":"admin",
  "password":"7080bfe27990021c562398e79823h920e9a38aa5d3b10c5ff5d8c498305",
  "indices":["/_*"],
  "created":"2015-11-06T21:57:21+0100"
}]



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap