按照CIS-Tomcat7最新基线标准进行中间件层面基线检测
- 检查项:开启用户登录失败锁定
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值:
加固建议:<Realm className="org.apache.catalina.realm.LockOutRealm" failureCount="3" lockOutTime="600" cacheSize="1000" cacheRemovalWarningTime="3600">
- 检查项:限制远程管理IP
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值:
加固建议:增加<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="允许远程管理IP"/>
- 检查项:禁止显示异常调试信息
路径:/var/sites/tomcat/ipxcore/conf/web.xml
当前值:
加固建议:在当前web.xml里面的web-app添加子节点:<error-page><exception-type>java.lang.Throwable</exception-type><location>/error.jsp</location></error-page>
,在webapps目录下创建error.jsp,定义自定义错误信息 - 检查项:开启传输层安全属性
路径:/var/sites/tomcat/ipxcore/webapps/manager/WEB-INF/web.xml
当前值:
加固建议:在当前
路径的web.xml里面的web-app添加子节点:<security-constraint> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee></user-data-constraint> </security-constraint>
- 检查项:开启安全周期生命监听器
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值:
加固建议:取消<Listener className="org.apache.catalina.security.SecurityListener" />
注释 - 检查项:示例文件检测
路径:/var/sites/tomcat/ipxcore/
当前值: /var/sites/tomcat/ipxcore/webapps/examples
加固建议:请删除检测出的示例文件或目录 - 检查项:关闭shutdown端口
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值: port=18005
加固建议:将port值置为-1 - 检查项:禁止自动部署
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值: Host:autoDeploy=true
加固建议:将autoDeploy=”false” - 检查项:禁止应用运行在提权模式
路径:/var/sites/tomcat/ipxcore/webapps/manager/META-INF/context.xml
当前值: Context:privileged=true
加固建议:将privileged=”false” - 检查项:禁止应用运行在提权模式
路径:/var/sites/tomcat/ipxcore/webapps/host-manager/META-INF/context.xml
当前值: Context:privileged=true
加固建议:将privileged=”false” - 检查项:设置http大小
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值: maxHttpHeaderSize
加固建议:对检测出的Connector增加属性:maxHttpHeaderSize=”8192” - 检查项:监听端口业务协议配置检测
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值: 18080
加固建议:为该监听端口配置scheme=”http”或”https”属性 - 检查项:使用UserDatabaseRealm检测
路径:/var/sites/tomcat/ipxcore/conf/server.xml
当前值: org.apache.catalina.realm.UserDatabaseRealm
加固建议:建议关闭UserDatabaseRealm使用