Samba4 で
Active Directory を組んだ際、パスワードポリシー
(どんなパスワードに変更できるかの制限) は
samba-tool domain passwordsettings で変更しますが、
--complexity=on (デフォルト値) での「複雑なパスワード」
の具体的な内容について調べている人はいなかったようなので、調べてみました。
Samba4 の AD機上で、 以下のコマンドで現在値の設定がダンプできます。下記例はデフォルト値。
# samba-tool domain passwordsettings show Password informations for domain 'DC=samdom,DC=example,DC=or,DC=jp' Password complexity: on Store plaintext passwords: off Password history length: 24 Minimum password length: 7 Minimum password age (days): 1 Maximum password age (days): 42 Account lockout duration (mins): 30 Account lockout threshold (attempts): 0 Reset account lockout after (mins): 30
| 項目 | デフォルト値 | 内容 |
|---|---|---|
| Password complexity | on | パスワード変更時に、「複雑なパスワード」を必要とします。 |
| Password history length | 24(回) | 過去に使ったパスワードには変更できないようにします。 何回分まで覚えているかの設定。0で無効。 |
| Minimum password length | 7(文字) | パスワードの最低の長さ。Unicodeのコードポイント数で数えます。 |
| Minimum password age (days) | 1(日) | パスワードを変更したら、しばらくは再度パスワードを変更できないようにします。 0 で無効 (即パスワード再変更できる) |
| Maximum password age (days) | 42(日) | パスワードの有効期限。この日数を過ぎると強制的にパスワード変更させられます。 0 で無期限。 |
| Account lockout duration (mins) | 30(分) | パスワード間違いすぎでアカウントがロックする際、 どのくらいの時間ロックをかけるか。 |
| Account lockout threshold (attempts) | 0(回) | パスワードを何回間違えたらロックをかけるか、の回数。 デフォルトで0回(ロックしない)。 |
| Reset account lockout after (mins) | 30(分) | パスワード間違いすぎでアカウントがロックされた際、 自動的に解除するまでの時間。 |
特にMinimum password age, Maximum password age はデフォルトから 変更しておきたいサイトは多いかと思います。 Password history length も 24回分では多すぎるかと。
--complexity=on) ではどんな制約が
かかるか、というのはろくすっぽドキュメントが無いので、
Samba4のソースコードを当たってみます。
lib/util/genrand_util.c の check_password_quality()
が、具体的な判定を行っています。
で、コードの冒頭にはコメントで以下のように述べられています。
/**
Microsoft composed the following rules (among others) for quality
checks. This is an abridgment from
http://msdn.microsoft.com/en-us/subscriptions/cc786468%28v=ws.10%29.aspx:
Passwords must contain characters from three of the following five
categories:
- Uppercase characters of European languages (A through Z, with
diacritic marks, Greek and Cyrillic characters)
- Lowercase characters of European languages (a through z, sharp-s,
with diacritic marks, Greek and Cyrillic characters)
- Base 10 digits (0 through 9)
- Nonalphanumeric characters: ~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/
- Any Unicode character that is categorized as an alphabetic character
but is not uppercase or lowercase. This includes Unicode characters
from Asian languages.
Note: for now do not check if the unicode category is
alphabetic character
**/
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
何をもって「大文字」「小文字」とするか
は、1バイトに収まる文字(0-127)については
libc の isupper(3), islower(3) を使いますが、
その他のUnicode文字については Samba は自分で
変換表を抱えていて
判定しています。
1文字は Unicode codepoint 単位で数えるので、漢字も1文字です。 2文字相当にはなりません。 漢字を入れてもパスワードとしてのエントロピーはローマ字と比べても低そうなので、 そんなものかもしれません。