跳转到主内容

ONTAP 是否支持使用 SHA2 哈希的 LDAP 身份验证?

Views:
24
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

适用于

  • ONTAP 9

回答

当为管理员用户使用基于 LDAP 的身份验证时,ONTAP 将从 LDAP 服务器检索用户哈希密码。


ONTAP 目前支持以下格式呈现的哈希:

  • SHA1 哈希,例如 {SHA}Ib0S3Bg/dA7nbye3jrOcitlyp1c=
  • SHA1 哈希加盐,例如 {SSHA}6kjRsXW28j3tI9QgAyqQZqMk5JF9baJA
  • Unix /etc/shadow 格式,例如 {CRYPT}337wv58eeI9vU

在后一个示例中,该值具有"{CRYPT}"前缀,字符串的剩余部分("337wv58eeI9vU")是在 Linux 系统的 /etc/shadow 中找到的内容。
 

ONTAP 支持存储在 linux /etc/shadow 文件中的 SHA2 密码,例如

  • SHA256(不含盐):{CRYPT}$5$$6G6fqh7JbmWoA0UDAV4a9AWvIITTJX3z13yUnMs2/S9
  • SHA256(含盐):{CRYPT}$5$D8I8YSb5qp1JuR/M$WU3tC8sJEplhzjPdAGomBIEnWNIEAMlvWhx1UhbIXw
  • SHA512(不含盐): {CRYPT}$6$$VCSoGjn22d.ifTNEaijGbMMSqajTedh/HYPnOkuj0ky3sAiCCIx.rMZj8d20v2qil5zCOZF21zmm959VQVcEl0
  • SHA512(含盐):{CRYPT}$6$rJx0V8y2xj6CsMiL$gu.wruOPQV/Dw0PI4CQv1gCwRbN/.2cKszer2mPX3td5x9qf.l9s.i6MVEmhOLdi/JmRVMMQ0

美元符号之间的 5 或 6 分别表示 SHA256 和 SHA512,盐包括在第二个和第三个美元符号之间。

哈希可以由任何能够为 /etc/shadow 输出适当值的程序生成。
以下示例使用 Python 3,在 Linux 系统上运行,以与本地 crypt(3) 函数进行交互:

% python3
Python 3.6.8 (default, Apr 25 2019, 21:02:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import crypt, getpass
>>> passwd = getpass.getpass("Please enter password: ")
Please enter password:
>>> salt = crypt.mksalt(crypt.METHOD_SHA512)
>>> salted_hash = "{CRYPT}" + crypt.crypt(passwd, salt)
>>> print(salted_hash)
{CRYPT}$6$up5Ai00M1VGaFK6q$4yFNK.YUszogLFS.7IDiAW70RLC7BufwYhLEhPxTSSMRTJa2gFkWjhWBLvsdUGniYkTMmPmBu5SX4Y7tF7lys0
>>> unsalted_hash = "{CRYPT}" + crypt.crypt(passwd, "$6$")
>>> print(unsalted_hash)
{CRYPT}$6$$VCSoGjn22d.ifTNEaijGbMMSqajTedh/HYPnOkuj0ky3sAiCCIx.rMZj8d20v2qil5zCOZF21zmm959VQVcEl0


注意:从 ONTAP 9.7P9 开始,ONTAP 支持前缀为(例如 {SHA512}  或 {SSHA512})的 LDAP 哈希值。

追加信息

安全强化:ONTAP 技术报告 (第 12 页)

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.