Skip to content

Latest commit

 

History

History
94 lines (78 loc) · 3.81 KB

07.认证.md

File metadata and controls

94 lines (78 loc) · 3.81 KB

认证

1. Authentication

Atlas 支持以下的认证方式:

  • File
  • Kerberos
  • LDAP

atlas-application.properties文件中启用该类型的身份验证,以下属性设置为true:

atlas.authentication.method.kerberos=true|false
atlas.authentication.method.ldap=true|false
atlas.authentication.method.file=true|false

如果两个或多个身份验证方法设置为true,则如果之前的身份验证失败,则身份验证将回退到后一种方法。例如,如果Kerberos身份验证设置为true并且ldap身份验证也设置为true,那么,如果对于没有kerberos principal和keytab的请求,LDAP身份验证将用作回退方案。

(1)FILE认证方式

文件身份验证要求用户凭据文件中的用户登录详细信息采用下面指定的格式,文件路径应设置为atlas-application.properties中的属性atlas.authentication.method.file.filename

atlas.authentication.method.file=true
atlas.authentication.method.file.filename=${sys:atlas.home}/conf/users-credentials.properties

用户凭证文件应具有以下格式:

username=group::sha256-password

例如:

admin=ADMIN::e7cf3ef4f17c3999a94f2c6f612e8a888e5b1026878e4e19398b23bd38ec221a

用户组可以是ADMINDATA_STEWARDDATA_SCIENTIST 注意:-password 使用sha256编码方法编码,可以使用unix工具生成。

例如:

echo -n "Password" | sha256sum
e7cf3ef4f17c3999a94f2c6f612e8a888e5b1026878e4e19398b23bd38ec221a  -

(2)Kerberos 认证方式

要在Atlas中以Kerberos模式启用身份验证,请在atlas-application.properties中将属性atlas.authentication.method.kerberos设置为true

atlas.authentication.method.kerberos = true

还需要设置以下属性:

atlas.authentication.method.kerberos.principal=<principal>/<fqdn>@EXAMPLE.COM
atlas.authentication.method.kerberos.keytab = /<key tab filepath>.keytab
atlas.authentication.method.kerberos.name.rules = RULE:[2:$1@$0](atlas@EXAMPLE.COM)s/.*/atlas/
atlas.authentication.method.kerberos.token.validity = 3600 [ in Seconds (optional)]

(3)LDAP 认证方式

要在Atlas中以LDAP模式启用身份验证,请将属性atlas.authentication.method.ldap设置为true,并将属性atlas.authentication.method.ldap.type的Ldap类型设置为atlas-application.properties中的LDAP或AD。如果连接到Active Directory,请使用AD。

atlas.authentication.method.ldap=true
atlas.authentication.method.ldap.type=ldap|ad

对于LDAP或AD,需要在atlas应用程序属性中设置以下配置。

Active Directory

atlas.authentication.method.ldap.ad.domain= example.com
atlas.authentication.method.ldap.ad.url=ldap://<AD server ip>:389
atlas.authentication.method.ldap.ad.base.dn=DC=example,DC=com
atlas.authentication.method.ldap.ad.bind.dn=CN=Administrator,CN=Users,DC=example,DC=com
atlas.authentication.method.ldap.ad.bind.password=<password>
atlas.authentication.method.ldap.ad.referral=ignore
atlas.authentication.method.ldap.ad.user.searchfilter=(sAMAccountName={0})
atlas.authentication.method.ldap.ad.default.role=ROLE_USER

LDAP Directroy

atlas.authentication.method.ldap.url=ldap://<Ldap server ip>:389
atlas.authentication.method.ldap.userDNpattern=uid={0],ou=users,dc=example,dc=com
atlas.authentication.method.ldap.groupSearchBase=dc=example,dc=com
atlas.authentication.method.ldap.groupSearchFilter=(member=cn={0},ou=users,dc=example,dc=com
atlas.authentication.method.ldap.groupRoleAttribute=cn
atlas.authentication.method.ldap.base.dn=dc=example,dc=com
atlas.authentication.method.ldap.bind.dn=cn=Manager,dc=example,dc=com
atlas.authentication.method.ldap.bind.password=<password>
atlas.authentication.method.ldap.referral=ignore
atlas.authentication.method.ldap.user.searchfilter=(uid={0})
atlas.authentication.method.ldap.default.role=ROLE_USER