Kerberos的詳細記錄我有一個基於Java的Web應用程序,它接受一個包含用戶名和密碼登錄網絡形式的內容,並使用Kerberos到基於Windows的域進行身份驗證。啓用在Java
KDC地址顯然被配置爲在每次查找時映射到不同的IP地址,這可以通過使用命令行中的ping命令來確認。
該調用立即響應大多數請求,但響應間歇性地緩慢(5-10秒甚至更長)。我認爲這可能是由於使用了哪個域控制器。
我試圖打開kerberos日誌記錄,但沒有顯示域控制器的IP地址。我該如何開啓更詳細的日誌記錄來嘗試識別惡意域控制器?
代碼摘錄從文件系統中獲取kerb.conf和kerb_context.conf。
的kerb.conf是:
[libdefaults]
default_realm = EXAMPLE.COM
[realms]
CYMRU.NHS.UK = {
kdc = example.com:88
admin_server = example.com
kpasswd_server = example.com
}
的kerb_context.conf是:
primaryLoginContext {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=false
refreshKrb5Config=true
debug=true;
};
示例源是:
static NadexUser executePerformLogin(String username, String password) throws LoginException {
char[] passwd = password.toCharArray();
String kerbConf = ERXFileUtilities.pathForResourceNamed("nadex/kerb.conf", "RSCorp", null);
String kerbContextConf = ERXFileUtilities.pathURLForResourceNamed("nadex/kerb_context.conf", "RSCorp", null).toExternalForm();
System.setProperty("java.security.krb5.conf", kerbConf);
System.setProperty("java.security.auth.login.config", kerbContextConf);
try {
LoginContext lc = new LoginContext("primaryLoginContext", new UserNamePasswordCallbackHandler(username, password));
lc.login();
return new _NadexUser(lc.getSubject());
}
catch (javax.security.auth.login.LoginException le) {
throw new LoginException("Failed to login : " + le.getLocalizedMessage(), le);
}
}
'-Dsun.security.krb5.debug = TRUE;我複製並粘貼足夠的時間,所以我想我會做它一個班輪。 – 2017-10-12 15:23:02