ADC

系统用户和外部用户的双重身份验证

双重身份验证是一种安全机制,NetScaler 设备在两个身份验证器级别对系统用户进行身份验证。只有在通过两个级别的身份验证成功验证密码后,设备才向用户授予访问权限。如果用户已在本地进行身份验证,则必须在 NetScaler 数据库中创建用户配置文件。如果用户在外部进行身份验证,则用户名和密码必须与在外部身份验证服务器中注册的用户身份相匹配。

注意

双重身份验证功能仅适用于 NetScaler 12.1 版本 51.16 及更高版本。

双重身份验证的工作原理

以用户尝试登录 NetScaler 设备为例。请求的应用程序服务器将用户名和密码发送到第一个外部身份验证服务器(RADIUS、TACACS、LDAP 或 AD)。验证用户名和密码后,系统会提示用户进行第二级身份验证。用户现在可以提供第二个密码。只有两个密码都正确时,才允许用户访问 NetScaler 设备。下图说明了 NetScaler 设备双重身份验证的工作原理。

双重身份验证

以下是为外部和系统用户配置双重身份验证的不同用例。

您可以通过不同的方式在 NetScaler 设备上配置双重身份验证。以下是 NetScaler 设备上双重身份验证的不同配置方案。

  1. 通过 NetScaler、GUI、CLI、API 和 SSH 进行双重身份验证 (2FA)。
  2. 对系统用户启用外部身份验证并禁用本地身份验证。
  3. 使用基于策略的本地身份验证为系统用户启用外部身份验证。
  4. 对启用本地身份验证的系统用户禁用外部身份验证。
  5. 已为系统用户启用外部身份验证并启用本地身份验证。
  6. 已为选定的 LDAP 用户启用外部身份验证

用例 1:在 NetScaler、GUI、CLI、API 和 SSH 接口上进行双重身份验证 (2FA)

双重身份验证已启用,可在 GUI、API 和 SSH 的所有 NetScaler 管理访问中使用。

用例 2:外部身份验证服务器(例如 LDAP、RADIUS、Active Directory 和 TACACS)支持双重身份验证

您可以在以下外部身份验证服务器上为第一级和第二级用户身份验证配置双重身份验证。

  • RADIUS
  • LDAP
  • Active Directory
  • TACACS

用例 3:对系统用户启用外部身份验证并禁用本地身份验证

通过启用外部身份验证选项和禁用系统用户的本地身份验证来开始身份验证过程。

对系统用户启用外部身份验证并禁用本地身份验证

使用命令行界面完成以下步骤:

  1. 为 LDAP 策略添加身份验证操作
  2. 为 LDAP 策略添加身份验证策略
  3. 为 RADIUS 策略添加身份验证操作
  4. 为 RADIUS 策略添加身份验证策略
  5. 添加身份验证登录架构
  6. 添加身份验证策略标签并将其绑定到 RADIUS 服务器
  7. 为 LDAP 策略绑定系统全局身份验证
  8. 在系统参数中禁用本地身份验证

为 LDAP 服务器添加身份验证操作(第一级身份验证)

在命令提示符下,键入:

add authentication ldapaction <ldap action name> -serverip <IP> -ldapbase <> -ldapbinddn <binddn name> -ldapbinddnpassword <password>-ldaploginname <loginname> -groupattrname <grp attribute name> -subAttributename <string>-ssoNameAttribute <string>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name -ssoNameAttribute name

为 LDAP 服务器添加身份验证策略(第一级身份验证)

在命令提示符下,键入: add authentication policy <ldap policy name> -rule true -action <ldap action name>

示例: add authentication policy pol1 -rule true -action ldapact1

为 RADIUS 服务器添加身份验证操作(二级身份验证)

在命令提示符下,键入:

add authentication radiusaction <rad action name> -serverip <rad server ip> -radkey <key> -radVendorID <ID >-radattributetype <rad attribute type>

示例:

add authentication radiusaction radact1 -serverip 1.1.1.1 -radkey 123 -radVendorID 1234 -radAttributeType 2

为 RADIUS 服务器添加身份验证策略(二级身份验证)

在命令提示符下,键入:

add authentication policy <radius policy name> -rule true -action <rad action name>

示例:

add authentication policy radpol11 -rule true -action radact1

添加身份验证登录架构

您可以使用系统用户的“SingleAuth.xml”登录架构为 NetScaler 设备提供第二个密码。在命令提示符下,键入:

add authentication loginSchema <login schema name> -authenticationSchema LoginSchema/SingleAuth.xml

示例:

add authentication loginSchema radschema -authenticationSchema LoginSchema/SingleAuth.xml

添加身份验证策略标签并将其绑定到 RADIUS 服务器

在命令提示符下,键入:

add authentication policylabel <labelName> [-type ( AAATM_REQ | RBA_REQ )] [-comment <string>][-loginSchema <string>]

bind authentication policylabel <labelName> -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>][-nextFactor <string>]

示例:

add authentication policylabel label1 -type RBA_REQ -loginSchema radschema

bind authentication policylabel label1 -policyName radpol11 -priority 1

为 LDAP 策略绑定全局身份验证系统

在命令提示符下,键入:

bind system global ldappolicy -priority <priority> -nextFactor <policy label name>

示例:

bind system global pol11 -priority 1 -nextFactor label1

在系统参数中禁用本地身份验证

在命令提示符下,键入:

set system parameter -localauth disabled

用例 4:为附加本地身份验证策略的系统用户启用外部身份验证

在这种情况下,允许用户使用双重身份验证登录设备,并在用户识别的第二级进行本地身份验证策略评估。

已为附加本地身份验证策略的系统用户启用外部身份验证

使用命令行界面完成以下步骤。

  1. 为 LDAP 服务器添加身份验证操作
  2. 为 LDAP 策略添加身份验证策略
  3. 添加本地身份验证策略
  4. 添加身份验证策略标签
  5. 将 LDAP 策略绑定为系统全局
  6. 在系统参数中禁用本地身份验证

为 LDAP 服务器添加身份验证操作(第一级身份验证)

在命令提示符下,键入:

add authentication ldapaction <ldap action name> -serverip <IP> -ldapbase <> -ldapbinddn <binddn name> -ldapbinddnpassword <password>-ldaploginname <loginname> -groupattrname <grp attribute name> -subAttributename <string>-ssoNameAttribute <string>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name -ssoNameAttribute name –ssoNameAttribute name

为 LDAP 服务器添加身份验证策略(第一级身份验证)

在命令提示符下,键入:

add authentication policy <ldap policy name> -rule true -action <ldap action name>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name -ssoNameAttribute name

为系统用户添加本地身份验证策略(二级身份验证)

在命令提示符下,键入:

add authentication policy <policy> -rule <rule> -action <action name>

示例:

add authentication policy local_policy -rule true -action LOCAL

添加和绑定身份验证策略标签

在命令提示符下,键入:

add authentication policylabel <labelName> [-type ( AAATM_REQ | RBA_REQ )] [-comment <string>][-loginSchema <string>] bind authentication policylabel <labelName> -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>][-nextFactor <string>]

注意

要进行管理访问,策略类型必须为 RBA_REQ。

示例:

add authentication policylabel label1 -type RBA_REQ -loginSchema radschema bind authentication policylabel label1 -policyName radpol11 -priority 1 -gotoPriorityExpression NEXT

在系统参数中禁用本地身份验证

在命令提示符下,键入:

set system parameter -localauth disabled

用例 5:为系统用户禁用外部身份验证并启用本地身份验证

如果用户禁用“externalAuth”,则表明该用户在身份验证服务器上不存在。即使外部经过身份验证的服务器上存在具有相同用户名的用户,也不会通过外部身份验证服务器对用户进行身份验证。用户已在本地进行身份验证。

为系统用户禁用外部身份验证并启用本地身份验证

启用系统用户密码和禁用外部身份验证

在命令提示符处,键入以下内容:

add system user <name> <password> -externalAuth DISABLED

示例:

add system user user1 password1 –externalAuth DISABLED

用例 6:为系统用户启用外部身份验证和启用本地身份验证

将设备配置为使用本地密码对系统用户进行身份验证。如果身份验证失败,则在两个级别的外部身份验证服务器上使用外部身份验证密码对用户进行身份验证。

为系统用户启用外部身份验证并启用本地身份验证

使用 CLI 配置以下步骤。

  1. 为 LDAP 服务器添加身份验证操作
  2. 为 LDAP 策略添加身份验证策略
  3. 为 RADIUS 策略添加身份验证操作
  4. 为 RADIUS 策略添加身份验证策略
  5. 添加身份验证登录架构
  6. 添加身份验证策略标签
  7. 为登录架构绑定身份验证策略标签
  8. 为 RADIUS 策略绑定全局身份验证系统
  9. 为 LDAP 策略绑定全局身份验证系统

为 LDAP 服务器添加身份验证操作

在命令提示符下,键入:

add authentication ldapaction <ldap action name> -serverip <IP> -ldapbase <> -ldapbinddn <binddn name> -ldapbinddnpassword <password>-ldaploginname <loginname> -groupattrname <grp attribute name> -subAttributename <>-ssoNameAttribute <>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name -ssoNameAttribute name

为 LDAP 策略添加身份验证策略

在命令提示符下,键入:

add authentication policy <policy name> --rule true -action <ldap action name>

示例:

add authentication policy pol1 -rule true -action ldapact1

为 RADIUS 服务器添加身份验证操作

在命令提示符下,键入:

add authentication radiusaction <rad action name> -serverip <rad server ip> -radkey <key> -radVendorID <ID >-radattributetype <rad attribute type>

示例:

add authentication radiusaction radact1 -serverip 1.1.1.1 -radkey 123 -radVendorID 1234 -radAttributeType 2

为 RADIUS 服务器添加高级身份验证策略

在命令提示符下,键入:

add authentication policy <policy name> -rule true -action <rad action name>

示例:

add authentication policy radpol11 -rule true -action radact1

添加身份验证登录架构

您可以使用 SingleAuth.xml 登录架构显示登录页面,并在第二级身份验证时对系统用户进行身份验证。

在命令提示符下,键入:

add authentication loginSchema <name> -authenticationSchema <string>

示例:

add authentication loginSchema radschema -authenticationSchema LoginSchema/SingleAuth.xml

为用户登录添加身份验证策略标签并将其绑定到 RADIUS 身份验证策略

在命令提示符下,键入:

add authentication policylabel <labelName> [-type ( AAATM_REQ | RBA_REQ )] [-comment <string>][-loginSchema <string>]

示例:

add authentication policylabel label1 -type RBA_REQ -loginSchema radschema bind authentication policylabel <labelName> -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>][-nextFactor <string>]

示例:

bind authentication policylabel label1 -policyName rad pol11 -priority 1

全局绑定身份验证策略

在命令提示符下,键入:

bind system global [<policyName> [-priority <positive_integer>] [-nextFactor <string>] [-gotoPriorityExpression <expression>]]

示例:

bind system global radpol11 -priority 1 -nextFactor label11

用例 7:仅为选定的外部用户启用外部身份验证

按照 LDAP 操作中配置的搜索过滤器为选择性外部用户配置双重身份验证,而其他系统用户则使用单因素身份验证进行身份验证。

使用 CLI 配置以下步骤。

  1. 为 LDAP 服务器添加身份验证操作
  2. 为 LDAP 策略添加身份验证策略
  3. 为 RADIUS 策略添加身份验证操作
  4. 为 RADIUS 策略添加身份验证策略
  5. 添加身份验证登录架构
  6. 添加身份验证策略标签
  7. 为登录架构绑定身份验证策略标签
  8. 为 RADIUS 策略绑定全局身份验证系统

为 LDAP 服务器添加身份验证操作

在命令提示符下,键入:

add authentication ldapaction <ldap action name> -serverip <IP> -ldapbase <> -ldapbinddn <binddn name> -ldapbinddnpassword <password>-ldaploginname <loginname> -groupattrname <grp attribute name> -subAttributename <>-ssoNameAttribute <>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name -ssoNameAttribute name

为 LDAP 策略添加身份验证策略

在命令提示符下,键入:

add authentication policy <policy name> --rule true -action <ldap action name>

示例:

add authentication policy pol1 -rule true -action ldapact1

为 RADIUS 服务器添加身份验证操作

在命令提示符下,键入:

add authentication radiusaction <rad action name> -serverip <rad server ip> -radkey <key> -radVendorID <ID >-radattributetype <rad attribute type>

示例:

add authentication radiusaction radact1 -serverip 1.1.1.1 -radkey 123 -radVendorID 1234 -radAttributeType 2

为 RADIUS 服务器添加高级身份验证策略

在命令提示符下,键入:

add authentication policy <policy name> -rule true -action <rad action name>

示例:

add authentication policy radpol11 -rule true -action radact1

添加身份验证登录架构

您可以使用 SingleAuth.xml 登录架构为设备提供登录页面,以便在第二级身份验证中对系统用户进行身份验证。

在命令提示符下,键入:

add authentication loginSchema <name> -authenticationSchema <string>

示例:

add authentication loginSchema radschema -authenticationSchema LoginSchema/SingleAuth.xml

为用户登录添加身份验证策略标签并将其绑定到 RADIUS 身份验证策略

在命令提示符下,键入:

add authentication policylabel <labelName> [-type ( AAATM_REQ | RBA_REQ )] [-comment <string>][-loginSchema <string>]

示例:

add authentication policylabel label1 -type RBA_REQ -loginSchema radschema bind authentication policylabel <labelName> -policyName <string> -priority <positive_integer> [-gotoPriorityExpression <expression>][-nextFactor <string>]

示例:

bind authentication policylabel label1 -policyName radpol11 -priority

全局绑定身份验证策略

在命令提示符下,键入:

bind system global [<policyName> [-priority <positive_integer>] [-nextFactor <string>] [-gotoPriorityExpression <expression>]]

示例:

bind system global radpol11 -priority 1 -nextFactor label11

要使用搜索过滤器为组用户配置不进行双重身份验证,请执行以下操作:

  1. 为 LDAP 服务器添加身份验证操作
  2. 为 LDAP 服务器添加身份验证策略
  3. 为 LDAP 服务器全局绑定身份验证系统

为 LDAP 服务器添加身份验证操作

在命令提示符下,键入:

add authentication ldapaction <ldap action name> -serverip <IP> -ldapbase <> -ldapbinddn <binddn name> -ldapbinddnpassword <password>-ldaploginname <loginname> -groupattrname <grp attribute name> -subAttributename <>-searchFilter<>

示例:

add authentication ldapaction ldapact1 -serverip 1.1.1.1 -ldapbase base -ldapbindDn name -ldapbindDNpassword password -ldapLoginName name -groupAttrName name -subAttributeName name - searchFilter "memberOf=CN=grp4,CN=Users,DC=aaatm-test,DC=com"

为 LDAP 服务器添加身份验证策略

在命令提示符下,键入:

add authentication policy <policy name> --rule true -action <ldap action name>

示例:

add authentication policy pol1 -rule true -action ldapact1

为 LDAP 策略绑定全局身份验证系统

在命令提示符下,键入:

bind system global ldappolicy -priority <priority> -nextFactor <policy label name>

示例:

bind system global pol11 -priority 1 -nextFactor label11

显示双重身份验证的自定义提示消息

当您使用 /flash/nsconfig/loginschema/LoginSchema 下的 SingleAuth.xml 文件配置双重密码字段时

以下是 SingleAuth.xml 文件的片段,其中“SecondPassword:”是第二个密码字段名称,提示用户输入第二个密码。

<?xml version="1.0" encoding="UTF-8"?>
<AuthenticateResponse xmlns="http://citrix.com/authentication/response/1">
<Status>success</Status>
<Result>more-info</Result>
<StateContext/>
<AuthenticationRequirements>
<PostBack>/nf/auth/doAuthentication.do</PostBack>
<CancelPostBack>/nf/auth/doLogoff.do</CancelPostBack>
<CancelButtonText>Cancel</CancelButtonText>
<Requirements>
<Requirement><Credential><ID>login</ID><SaveID>ExplicitForms-Username</SaveID><Type>username</Type></Credential><Label><Text>singleauth_user_name</Text><Type>nsg-login-label</Type></Label><Input><AssistiveText>singleauth_please_supply_either_domain\username_or_user@fully.qualified.domain</AssistiveText><Text><Secret>false</Secret><ReadOnly>false</ReadOnly><InitialValue/><Constraint>.+</Constraint></Text></Input></Requirement>
<Requirement><Credential><ID>passwd</ID><SaveID>ExplicitForms-Password</SaveID><Type>password</Type></Credential><Label><Text>SecondPassword:</Text><Type>nsg-login-label</Type></Label><Input><Text><Secret>true</Secret><ReadOnly>false</ReadOnly><InitialValue/><Constraint>.+</Constraint></Text></Input></Requirement>
<Requirement><Credential><Type>none</Type></Credential><Label><Text>singleauth_first_factor</Text><Type>nsg_confirmation</Type></Label><Input/></Requirement>
<Requirement><Credential><ID>saveCredentials</ID><Type>savecredentials</Type></Credential><Label><Text>singleauth_remember_my_password</Text><Type>nsg-login-label</Type></Label><Input><CheckBox><InitialValue>false</InitialValue></CheckBox></Input></Requirement>
<Requirement><Credential><ID>loginBtn</ID><Type>none</Type></Credential><Label><Type>none</Type></Label><Input><Button>singleauth_log_on</Button></Input></Requirement>
</Requirements>
</AuthenticationRequirements>
</AuthenticateResponse>
<!--NeedCopy-->

使用 NetScaler GUI 配置双重身份验证

  1. 登录到 NetScaler 设备。
  2. 转到“系统”>“身份验证”>“高级策略”>“策略”。
  3. 单击“添加”创建第一级身份验证策略。
  4. 在“创建身份验证策略”页面中,设置以下参数。
    1. 名称。策略的名称
    2. 操作类型。选择操作类型为 LDAP、Active Directory、RADIUS、TACACS 等
    3. 操作。与策略关联的身份验证操作(配置文件)。可以选择现有的身份验证操作,也可以单击加号并创建正确类型的操作。
    4. 表达式。提供高级策略表达式。
  5. 单击 创建 ,然后 关闭 。
    1. 表达式。提供高级策略表达式。
  6. 单击 Create(创建)。
  7. 单击“添加”创建第二级身份验证策略。
  8. 在“创建身份验证策略”页面中,设置以下参数:
    1. 名称。策略的名称
    2. 操作类型。选择操作类型为 LDAP、Active Directory、RADIUS、TACACS 等
    3. 操作。与策略关联的身份验证操作(配置文件)。您可以选择现有的身份验证操作,也可以单击 + 图标创建正确类型的操作。
    4. 表达式。提供高级策略表达式
  9. 单击 创建 ,然后 关闭 。
    1. 表达式。提供高级策略表达式。
  10. 单击 Create(创建)。
  11. 在“身份验证策略”页面中,单击“全局绑定”。
  12. 在“创建全局身份验证策略绑定”页面中,选择第一级身份验证策略,然后单击“添加绑定”。
  13. 在 策略绑定 页面中,选择身份验证策略并设置以下策略绑定参数。
    1. 下一个因素。选择第二级身份验证策略标签。
  14. 单击绑定和关闭。

    系统用户双重身份验证的 GUI 配置

  15. 单击 Done(完成)。
  16. 登录 NetScaler 设备进行二级身份验证。用户现在可以提供第二个密码。只有两个密码都正确时,才允许用户访问 NetScaler 设备。

注意

配置为第二因素身份验证的 TACACS 不支持授权和记账,即使您在“tacacsAction”命令中启用了授权和记账。第二个因素仅用于身份验证目的。

另外,请参阅 NetScaler nFactor 身份验证主题中的双重身份验证 。