ADC
感谢您提供反馈

这篇文章已经过机器翻译.放弃

配置 Web 身份验证的 SMS OTP

Citrix ADC 现在可以与第三方 SMS 提供商集成,以提供额外的身份验证层。

可以将 Citrix ADC 设备配置为在用户的移动设备上发送 OTP,作为第二个身份验证因素。设备向用户提供登录表格,以便在成功登录 AD 后进入 OTP。只有在成功验证 SMS OTP 身份验证后,才会向用户显示所请求的资源。

要实现 SMS OTP 身份验证,Citrix ADC 设备依赖于后端中的以下因素。

  1. 使用 LDAP 身份验证对用户进行身份验证并提取用户的手机号码。
  2. 创建 OTP 并将其存储在 NS 变量中。配置和使用变量
  3. 通过 WebAuth 身份验证方法将 OTP 发送到从 LDAP 提取的手机号码。
  4. 验证 OTP。

必备条件

配置 OTP 存储

管理员使用以下 CLI 命令设置数据库/存储以保存用于 SMS 身份验证的 OTP。

add ns variable otp_store -type "map(text(65),text(6),100000)" -ifValueTooBig undef -ifNoValue undef -expires 5

为每个用户会话生成随机 OTP

使用以下命令为每个用户会话生成一个 6 位随机 OTP,并将其保存在 OTP 存储中。

add ns assignment generate_otp -variable "$otp_store[AAA.USER.SESSIONID]" -set ("000000" + SYS.RANDOM.MUL(1000000).TYPECAST_UNSIGNED_LONG_AT.TYPECAST_TEXT_T).SUFFIX(6)

使用Citrix ADC 配置短信 OTP 身份验证

  • 在配置 SMS 双重身份验证功能之前,必须在 Citrix ADC 设备上配置 LDAP 身份验证,作为启用身份验证的第一要素。有关配置 LDAP 身份验证的说明,请参阅 使用配置实用程序配置 LDAP 身份验证

  • 配置 LDAP 并提取用于 SMS OTP 身份验证的手机号码。

示例第一因素配置

add authentication ldapAction ldap_action -serverIP 1.1.1.1 -serverPort 3268 -authTimeout 30 -ldapBase "dc=nsi-test,dc=com" -ldapBindDn Administrator@nsi-test.com -ldapBindDnPassword freebsd -ldapLoginName samaccountname -groupAttrName memberOf -ssoNameAttribute samaccountname -Attribute1 mobile -email mail add authentication Policy ldap_policy -rule true -action ldap_action

注意

手机号码可以使用 AAA.USER.ATTRIBUTE(1) 提取,并且可以在将其发送到后端服务器时包含在内。

示例第二因素配置

使用以下示例配置,生成要发送给最终用户的 OTP。

add authentication policylabel set_otp -loginSchema LSCHEMA_INT add authentication Policy set_otp -rule true -action test add authentication policy cascade_noauth -rule true -action NO_AUTHN add authentication Policy check_otp -rule "$test.valueExists(AAA.USER.SESSIONID)" -action NO_AUTHN add authentication policylabel check_otp -loginSchema LSCHEMA_INTbind authentication policylabel set_otp -policyName set_otp -priority 1 -gotoPriorityExpression NEXT bind authentication policylabel set_otp -policyName cascade_noauth -priority 2 -gotoPriorityExpression NEXT -nextFactor check_otpbind authentication policylabel check_otp -policyName wpp -priority 1 -gotoPriorityExpression NEXT bind authentication policylabel check_otp -policyName wpp_cascade_noauth -priority 2 -gotoPriorityExpression NEXT -nextFactor otp_verifyadd authentication Policy wpp -rule true -action webAuth_POST add authentication Policy wpp_cascade_noauth -rule true -action NO_AUTHNadd authentication Policy otp_verify -rule "AAA.LOGIN.PASSWORD.EQ($test[AAA.USER.SESSIONID])" -action NO_AUTHN add authentication policylabel otp_verify -loginSchema onlyPassword bind authentication policylabel otp_verify -policyName otp_verify -priority 1 -gotoPriorityExpression NEXTadd authentication vserver avs SSL 10.106.40.121 443 bind authentication vserver avs -policy ldap_policy -priority 1 -nextFactor set_otp -gotoPriorityExpression NEXT

第三因素配置示例

使用以下示例配置,第二因素配置中生成的 OTP 将使用 Web 身份验证方法发送给最终用户。有关 Web 身份验证的详细信息,请参阅 Web 身份验证

  • SMS 服务器通过 GET 方法公开 API 时的示例 Web 身份验证配置。

    add policy expression otp_exp_get ""method=sendMessage&send_to=" + AAA.USER.ATTRIBUTE(1) + "&msg=OTP is " + $otp_store[AAA.USER.SESSIONID] + "for login into secure access gateway. Valid till EXPIRE_TIME. Do not share the OTP with anyone for security reasons.&userid=#####&password=###=1.0"" add authentication webAuthAction webAuth_Get -serverIP 10.106.168.210 -serverPort 8080 -fullReqExpr q{"GET /GatewayAPI/rest?" + otp_exp_get + "HTTP/" + http.req.version.major + "." + http.req.version.minor.sub(1) + "\r\nAccept:\*/\*\r\nHost: <FQDN>\r\n"} -successRule "http.res.status.eq(200)" -scheme http
  • SMS 服务器通过 GET 方法公开 API 时的示例 Web 身份验证配置。

    add policy expression otp_exp_post ""Message: OTP is " + $otp_store[AAA.USER.SESSIONID] + "for login into secure access gateway. Valid till EXPIRE_TIME. Do not share the OTP with anyone for security reasons&Mobile:" + AAA.USER.ATTRIBUTE(1)" add authentication webAuthAction webAuth_POST -serverIP 10.106.168.210 -serverPort 8080 -fullReqExpr q{"POST /MyPHP/auth.php HTTP/" + http.req.version.major + "." + http.req.version.major + "\r\nAccept:\*/\*\r\nHost: 10.106.168.210 \r\nContent-Length: 10\r\n\r\n" + otp_exp_post} -scheme http -successRule true
    add authentication webAuthAction webAuth_Get -serverIP 10.106.168.210 -serverPort 8080 -fullReqExpr q{"GET /GatewayAPI/rest?" + otp_exp_get + "HTTP/" + http.req.version.major + "." + http.req.version.minor.sub(1) + "\r\nAccept:/\r\nHost: <FQDN>\r\n"} -successRule "http.res.status.eq(200)" -scheme http add policy expression otp_exp_post "$otp_store[AAA.USER.SESSIONID]"
  • 最后,发送 OTP。

    add authentication Policy wpp -rule true -action webAuth_POST add authentication policylabel send_otp -loginSchema LSCHEMA_INT bind authentication policylabel send_otp -policyName wpp -priority 1 -gotoPriorityExpression NEXT

第四因素配置示例

使用以下示例配置,验证发送给最终用户的 OTP。

在此配置中,策略规则用于根据发送给最终用户的 OTP 验证 OTP。

add authentication Policy otp_verify -rule "AAA.LOGIN.PASSWORD.EQ($otp_store[AAA.USER.SESSIONID])" -action NO_AUTHN add authentication policylabel otp_verify -loginSchema onlyPassword bind authentication policylabel otp_verify -policyName otp_verify -priority 1 -gotoPriorityExpression NEXT

使用以下命令添加 OnlyPassword 登录架构:

add authentication loginSchema onlypassword -authenticationschema /nsconfig/loginschema/LoginSchema/OnlyPassword.xml"

连接成功进行 SMS OTP 身份验证的所有因素

使用以下 CLI 命令将所有因素链接在一起。

bind authentication policylabel send_otp -policyName wpp -priority 1 -gotoPriorityExpression NEXT -nextFactor otp_verify

注意:

添加了层叠身份验证策略,以便为最终用户启用可靠且持续的身份验证。如果当前因素失效,则评估下一个因素,以免对用户体验产生影响。

本内容的正式版本为英文版。部分 Cloud Software Group 文档内容采用了机器翻译,仅供您参考。Cloud Software Group 无法控制机器翻译的内容,这些内容可能包含错误、不准确或不合适的语言。对于从英文原文翻译成任何其他语言的内容的准确性、可靠性、适用性或正确性,或者您的 Cloud Software Group 产品或服务沿用了任何机器翻译的内容,我们均不作任何明示或暗示的保证,并且适用的最终用户许可协议或服务条款或者与 Cloud Software Group 签订的任何其他协议(产品或服务与已进行机器翻译的任何文档保持一致)下的任何保证均不适用。对于因使用机器翻译的内容而引起的任何损害或问题,Cloud Software Group 不承担任何责任。
配置 Web 身份验证的 SMS OTP