页面树结构
转至元数据结尾
转至元数据起始

本页面罗列了常见的安全漏洞相关处理方案

漏洞详情解决方案
index.jsp登录爆破对于登录爆破,我们对外一直是提供登录验证码功能扩展包解决,https://history.wiki.smartbi.com.cn/pages/viewpage.action?pageId=52627212,用户可配置相关扩展包解决。

config.jsp登录爆破

通过smartbi.properties 文件新增配置项来限定ip访问,建议只对服务所在机器开放
配置方法:

1、进入到 tomcat\bin 目录找到 smartbi.properties 文件,在文件中新增如下配置项目


smartbi.allowedConfigIps=10.21.31.71,127.0.0.1


弱口令用户配置密码过于简单,可以通过配置正在表达式限制用户输入密码过于简单,具体可参考Wiki文档:https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=76679302
设置账号校验规则:^$|[a-zA-Z0-9]{6,32}
设置密码校验规则:^(?![^a-zA-Z]+$)(?!\D+$)[a-zA-Z0-9]{8,}$
查看smartbi版本信息版本信息开放主要是用于日常问题分析,因为我们前端js是存在会话缓存,若无法确认版本信息,会导致问题分析比较难。再者我们过于经过第三方安全机构检测,相关检测报告也未对此类做安全漏洞判断。用户可以删除相关的txt文件,对产品功能使用不影响。
目录遍历  于2020-10-14已发布相关安全补丁,该问题可通过安装安全补丁后,配置限制config页面文件访问路径解决:https://history.wiki.smartbi.com.cn/pages/viewpage.action?pageId=50692623
信息泄露为了监控用的页面,超级管理员才有的权限。建议用户配置IP限制,限制非允许IP访问,具体同2.3参考Wiki文档:https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=50692623
接口泄露(直接访问wsdl无需401)相关接口信息可参考Wiki文档进行屏蔽:https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=89033146 ,产品未直接限制主要是做成产品,很有项目需要调用相关接口进行二开,因此我们保留相关访问。
session劫持+重置用户密码(无需原密码)session劫持的前提是访问到,https://127.0.0.1/vision/monitor/listsessions.jsp。 通过2.3的解决方案,可限制IP访问,非白名单IP无法访问到相关页面,https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=50692623
heapdump缓存抓取密码如session劫持,另外于2022-06-17对于相关密码已采取asc加密。
Tomcat存在登陆页面删除webapps下的docs、examples、ROOT目录
会话超时配置会话超时扩展包,产品默认实现不超时功能,若项目安全性要求高,建议配置会话超时扩展包,当用户对系统长时间未操作自动超时,具体可参考Wiki文档:https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=76679004
不安全的http协议配置https可参考:https://history.wiki.smartbi.com.cn/pages/viewpage.action?pageId=58101324
缺少X-Frame-Options标头属性webSecurityExt.ext扩展包 https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=64783156
config.jsp页面内的密码项要勾选【加密保存】密码安全
同一个账号在不同的地方登录使用锁定账号扩展包LoginLock,不允许同一个账号在不同的地方登录使用,如果存在同时使用同一账号的情况,之前登录的账号在访问下一个请求的自动跳转到登录界面。https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=52627243
报错页面泄漏信息

V97 及以上版本的角色里有设置错误信息的操作权限。

V95 及以下版本的报错信息权限控制使用扩展包SuccinctErrorMessage,https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=62300080

会话固定用户登录前与登录后的JSESSIONID是一样的,需要用修复会话固定漏洞扩展包SessionFixationHandler,https://wiki.smartbi.com.cn/pages/viewpage.action?pageId=52627136
Cookie的HttpOnly、secure 安全属性未启用到Tomcat根目录下的conf/web.xml中添加如下配置
<session-config>
    <session-timeout>30</session-timeout>
 <cookie-config>
        <http-only>true</http-only>
        <secure>true</secure>
    </cookie-config>
</session-config>
注意:设置secure需要开启https
ip伪造、host头攻击、缺少X-Frame-Options响应头、cookie缺少httponly,secure,samesite问题配置nginx,如:
upstream smartbi_tomcat{
    ip_hash;
    server 10.253.88.111:8080 weight=1;
}
server {
    listen       80;
    server_name  10.253.88.111;
    if ($host !~* ^10.253.88.111|127.0.0.1$){
        return 403;
    }
   
    # 将http请求转发到https
    #if ($scheme = http) {
    #    return 301 https://$host$request_uri;
    #}
   
    # https 证书配置
    #ssl_certificate          <证书所在路径>/<证书名称>.crt;
    #ssl_certificate_key      <证书所在路径>/<证书名称>.key;
   
    location / {
        # 注意,这里不要使用集群,直接转发到 Tomcat 服务即可
        proxy_pass        http://10.253.88.111:8080;

        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header X-Frame-Options SAMEORIGIN;

        proxy_set_header Cookie $http_cookie;
        proxy_redirect off;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        # 需要https 的支持
        #proxy_cookie_path ~^/(.+)$ "/$1; HttpOnly; secure; SameSite=none";
       
        client_max_body_size 100m;
        client_body_buffer_size 1024k;
        proxy_connect_timeout 300;
        proxy_send_timeout 300;
        proxy_read_timeout 300;
        proxy_buffer_size 4k;
        proxy_buffers 4 32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size 64k;
   }
}
Tomcat服务器版本号泄露

 进入tomcat的配置目录下(%tomcatHome%\conf) 在 server.xml文件中的Host节点添加如下配置

<Valve className="org.apache.catalina.valves.ErrorReportValve" showReport="false" showServerInfo="false" />

安全检测-Tomcat默认页面泄露

HSTS开启

hsts开启的前提条件是开启了https,(准备好域名、https证书)
Nginx配置:
1、保证Nginx的配置已强制http转https
2、进入到nginx目录下的conf/nginx.conf文件中的server location 中加入以下配置

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;


Tomcat配置(需要 8.0.23 版本及之后的版本才支持):
1、保证Tomcat的配置已强制http转https,可参考 https://smartbi.feishu.cn/docx/A3vadSTbUo5NdgxPmUNcGsd7nzg#H0GCdu8Mgo46Kqx6W7PcL4kkn7g
2、进入tomcat的配置目录下(%tomcatHome%\conf)修改web.xml文件中添加以下配置。

<filter> <filter-name>httpHeaderSecurity</filter-name> <filter-class>org.apache.catalina.filters.HttpHeaderSecurityFilter</filter-class> <async-supported>true</async-supported> <init-param> <param-name>hstsEnabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>hstsMaxAgeSeconds</param-name> <!--这里设置的是有效期,生产环境测试时建议不要设置太大,测试没问题后再逐步提高这个值。如:1分钟、5分钟、10分钟、30分钟、60分钟、3个钟、6个钟、12个钟、18个钟、24个钟、半年、一年--> <!--单位是秒--> <!--一年是 31536000 --> <param-value>60</param-value> </init-param> <init-param> <param-name>hstsIncludeSubDomains</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>httpHeaderSecurity</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping>


IP伪造

需要到 系统运维/系统选项/高级设置 中新增如下配置

# 是否开启防止IP伪造,如果有前置代理的情况下不能开启。
HAS_ENABLED_IP_PORGERY=true

跨站脚本攻击、csrf跨站请求伪造

通过加载安全扩展包来配置相关配置项防止
单机配置方式:
1、下载安全扩展包 webSecurity.ext
2、找到安全扩展包中的 /META-INF/webSecurity.properties 文件,修改文件中的默认值。
将strictLimit的默认false修改为true
safeReferer默认为空(即 safeReferer= 表示当前机器放行)。如果有其它应用需要集成Smartbi的需要将其修改为对应机器的请求域名或ip。注意:这里只配置Host,可以是域名或ip,不用配置到具体地址的,如:http://10.11.27.46:8095/smartbi 只需要配置 http://10.11.27.46:8095 即可。


或者配置nginx:


valid_referers none blocked 172.16.20.216 localhost; if ($invalid_referer) { return 403; }


存在缓慢的HTTP拒绝服务攻击

通过配置中间件或nginx的连接超时时间
tomcat配置方式:
进入到Tomcat目录下的conf/server.xml文件中修改如下配置
将 connectionTimeout 值修改为 8000


connectionTimeout="8000"


2、

nginx配置方式:
1、进入到nginx目录下的conf/nginx.conf文件中的http新增如下相关配置


http {
#指定每一个 TCP 链接最多能够保持多长时间
keepalive_timeout 60;
server {
#服务端向客户端传输数据的超时时间
send_timeout 60s;
#请求头分配一个缓冲区
client_body_buffer_size 16k;
#指定客户端与服务端建立连接后发送 request body 的超时时间
client_body_timeout 50s;
#客户端向服务端发送一个完整的 request header 的超时时间
client_header_timeout 10s;
location / {

         }
     }
}



启用了没必要的 http 请求类型

通过配置中间件或代理来禁用相关http方法。
tomcat配置方式:
1、进入tomcat的配置目录下(%tomcatHome%\conf)修改web.xml文件中的 web-app 节点下 添加以下配置。


<security-constraint>
<web-resource-collection>
<web-resource-name>filter-http-method</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>PUT</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
<http-method>HEAD</http-method>
</web-resource-collection>
<auth-constraint></auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>



这里禁用了PUT、DELETE、OPTIONS、HEAD,如果还需要禁用其它的则新增一行 <http-method>其它</http-method> 即可


nginx配置方式:
1、进入到nginx目录下的conf/nginx.conf文件中的server 或 location 中加入以下配置。


if ($request_method ~ ^(PUT|DELETE|OPTIONS|HEAD)$) { return 403; }




  • 无标签