Harbor Swagger接口泄露漏洞处理
一、Swagger接口泄露漏洞详情
未授权访问漏洞(中危)
漏洞链接地址:
http://1.1.1.1/devcenter-api-2.0
修复方式:
vim harbor/common/config/nginx/nginx.conf
if ($request_uri ~* "/devcenter-api-2\.0") { return 404; }
if ($request_uri ~* ^/(swagger1|swagger2)\.(html|json)$) {
return 404;
}

http://1.1.1.1/swagger.yaml
#删除该镜像容器中的swagger.json文件
[root@localhost ~]# docker exec -ti -u root harbor-portal rm /usr/share/nginx/html/swagger.json
[root@localhost ~]# docker exec -ti -u root harbor-portal rm /usr/share/nginx/html/swagger2.json
[root@localhost ~]# docker exec -ti -u root harbor-portal rm /usr/share/nginx/html/swagger.yaml
http://10.1.1.1/api/v2.0/projects
关闭所有 公用的项目
浙公网安备 33010602011771号