Tomcat Grails3和SpringSecurity LDAP未加密流量

Tomcat Grails3和SpringSecurity LDAP未加密流量,tomcat,grails,ssl,ldap,spring-security-ldap,Tomcat,Grails,Ssl,Ldap,Spring Security Ldap,我正在Tomcat8上运行Grails3应用程序。我开发的应用程序通过HTTPS,并使用GrailsSpringSecurityLDAP插件进行身份验证。(插件提供的默认登录页面,没有自定义内容)Tomcat被启用为仅使用HTTPS,HTTP被禁用 My application.groovy文件还包含以下spring安全代码: grails.plugin.springsecurity.ldap.context.server = 'ldap://192.168.3.4:389/DC=MY_DOMA

我正在Tomcat8上运行Grails3应用程序。我开发的应用程序通过HTTPS,并使用GrailsSpringSecurityLDAP插件进行身份验证。(插件提供的默认登录页面,没有自定义内容)Tomcat被启用为仅使用HTTPS,HTTP被禁用

My application.groovy文件还包含以下spring安全代码:

grails.plugin.springsecurity.ldap.context.server = 'ldap://192.168.3.4:389/DC=MY_DOMAIN,DC=Net'
grails.plugin.springsecurity.password.algorithm = 'SHA-256'
(其他详细信息只是要查询的内容等的配置参数)

以下是我的测试场景:

我有一台Windows机器,运行在Ubuntu机器上的应用程序。ubuntu机器向AD(Active Directory)机器发出LDAP请求。 作为参考,以下是IP:

Windows Machine: 192.168.1.1
Tomcat Ubuntu Machine: 192.168.1.10
AD Machine: 192.168.3.4
监控来自.1(windows计算机)的TCP流量后,所有内容都被篡改,无法读取。当嗅探从.10到.4(Tomcat到AD)的数据包时,LDAP数据包是明文的。当然,我不认为这应该是这样的。我是否需要在tomcat中执行一些额外的步骤来确保ldap通信被加密


您需要使用安全的LDAP,它使用端口636和/或前缀ldaps://。

我一直在读,它让我们相信可以通过ssl运行LDAP本身。因此,我们的连接字符串将来自:

'ldap://192.168.3.4:389/DC=MY_DOMAIN,DC=Net'

注意,除此之外,您还需要确保在Java中将根证书添加到信任列表中。对我来说,以下命令似乎起到了作用:

keytool -import -noprompt -trustcacerts -alias myAdCert -file /location_of_cert/adcert.cer -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit

我认为你是对的。我只是在一些随机的博客上看到了一个类似的例子。我会好好玩玩,看看能不能让它发挥作用。
keytool -import -noprompt -trustcacerts -alias myAdCert -file /location_of_cert/adcert.cer -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit