1) 인증 방식
- native : elasticsearch index내 저장된 사용자 정보를 사용하여 사용자 인증
- ldap : 외부 ldap를 사용한 사용자 인증
- active directory : 외부 ad를 사용한 사용자 인증
- pki : pki를 사용한 사용자 인증
- file : 각 노드에 저장된 file 기반 사용자 인증
internal realms : native, file
external realms : ldap, active directory, pki
* annoymous access 설정 (elsticsearch.yml)
xpack.security.authc:
anonymous:
username: anonymous_user
roles: role1, role2
authz_exception: true
2) active directory 인증
사용자 인증을 ms ad를 사용하여 수행
- ad 게증
ou(organizational uni), o(organization), dc(domain controller), dn (distinguished name),
cn(common name), uid(unique id)
- ad 설정 (elasticsearch.yml)
xpack:
security:
authc:
realms:
active_directory:
type: active_directory
order: 0
domain_name: ad.example.com
url: ldaps://ad.example.com:636
unmapped_groups_as_roles: true
3) native 인증
기본적으로 제공하는 기능으로 별도 설정이 필요하지는 않음
- add user
curl -XPOST 'localhost:9200/_xpack/security/user/jacknich?pretty' -H 'Content-Type: application/json' -d'
{
"password" : "j@rV1s",
"roles" : [ "admin", "other_role1" ],
"full_name" : "Jack Nicholson",
"email" : "jacknich@example.com",
"metadata" : {
"intelligence" : 7
},
"enabled": true
}
'
- get user info
curl -XGET 'localhost:9200/_xpack/security/user?pretty'
curl -XGET 'localhost:9200/_xpack/security/user/jacknich,rdeniro?pretty' (2명 정보 확인)
- delete user
curl -XGET 'localhost:9200/_xpack/security/user/jacknich,rdeniro?pretty'
4) file 인증
elasticsearch 각 노드에 있는 file내 사용자 정보를 기반으로 한 인증
(resource.reload.interval.high는 리소스 읽는 시간을 조정)
- file 설정 (elasticsearch.yml)
xpack:
security:
authc:
realms:
file1:
type: file
order: 0
- 사용자 관리 (ES_HOME/bin/x-pack/users)
users, user_roles 파일을 변경된 정보가 저장됨
사용자 추가
bin/x-pack/users useradd <username> -p <password>
role과 함께 사용자 정보 추가
bin/x-pack/users useradd <username> -r <comma-separated list of role names>
사용자 패스워드 변경
bin/x-pack/users passwd <username> -p <password>
사용자에게 role 할당 (-a 할당, -r 제거)
bin/x-pack/users roles <username> -a <commma-separate list of roles> -r <comma-separated list of roles>
사용자 정보 리스트
bin/x-pack/users list jacknich
사용자 삭제
bin/x-pack/users userdel <username>
'NoSQL > Elasticsearch' 카테고리의 다른 글
x-pack role (0) | 2017.03.22 |
---|---|
x-pack native built-in 계정 패스워드 변경 (0) | 2017.03.22 |
x-pack uninstall (0) | 2017.03.22 |
x-pack install (0) | 2017.03.22 |
x-pack 란 (0) | 2017.03.22 |