官网,标准版应该是免费的,下载了标准版,没提示激活啥的,最近处理客户的漏洞扫描问题,主要就是修改nginx配置,各种查资料,不停的扫描验证,简单记录下吧。
APP简单使用
-
app快速下载地址
-
选择web应用程序(其他的没试)
-
输入web应用扫描起始地址(从哪一级开始扫描)
-
选是,相当于保存配置,后面可以直接拿来用
-
保存或者忽略都会自动扫描,扫描的就是路径下面的根目录和静态资源
-
也可以手动扫描,我都是直接手动扫描,登录系统,扫描哪些菜单,就添加对应的菜单
nginx配置,修复漏洞
- 隐藏nginx版本号:
server_tokens off;
- 检测到隐藏目录:将403状态转成404状态,防止暴露目录结构,
error_page 403 =404 /404.html;
- 修复下面漏洞的时候,网上资料也挺多的,但是不管怎么配置,每次扫描漏洞都在,不过最终不断尝试,总算解决了,直接分享我的配置供大家参考
配置Content-Security-Policy
太头疼了,扫描漏洞修复了,前端图片不显示了,图片正常显示,又会扫描出漏洞…
后来Script-Src
一直报策略不安全,后来发现是地址的原因,不能带*号,否则不安全
SameSite
配置后还是会被扫描出来,还需要配置一个地方,就是location
(这些配置不区分大小写)
- 隐藏掉server,这个改动就大了,要重新安装nginx,先修改nginx源码,然后编译安装,参考
nginx.conf
具体配置如下:
user dolphinscheduler;
worker_processes 1;#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;#pid logs/nginx.pid;events {worker_connections 1024;
}http {include mime.types;default_type application/octet-stream;log_format main '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';#access_log logs/access.log main;sendfile on;add_header Content-Security-Policy "Object-Src 'none';";#add_header Content-Security-Policy "Script-Src 'self' http://* 'unsafe-inline' 'unsafe-eval' blob: data:;";add_header Content-Security-Policy "Script-Src 'self' http://192.168.38.10/ ;";add_header Content-Security-Policy "frame-ancestors 'none' ;";add_header Content-Security-Policy "img-src 'self' data:;";add_header X-Content-Type-Options nosniff;add_header X-XSS-Protection "1;mode=block";add_header Set-Cookie "HttpOnly;SameSite=Strict";server_tokens off;server {listen 10000;server_name localhost;client_max_body_size 20m;access_log logs/access.log main;location /dolphinscheduler/api/ {proxy_pass http://localhost:12345/dolphinscheduler/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header x_real_ipP $remote_addr;proxy_set_header remote_addr $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_http_version 1.1;proxy_connect_timeout 4s;proxy_read_timeout 200s;proxy_send_timeout 12s;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";proxy_cookie_path / "/; httponly;SameSite=Strict;"; client_max_body_size 1000m;}location /dolphinscheduler {alias /home/dolphinscheduler/application/dolphinscheduler-ui/;index index.html index.htm;try_files $uri $uri/ /dolphinscheduler/index.html; #4.重定向,内部文件的指向}location / {root /home/dolphinscheduler/application/dolphinscheduler-ui/;index index.html index.html;try_files $uri $uri/ /index.html;}#error_page 404 /404.html;error_page 403 =404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html {root html;}}
}