我有一个问题,在gitlab的dast扫描和认证的管道内置。试图被扫描的应用程序是一个使用aspnetzero框架的角度应用程序。在gitlab中,cicd文件使用dast UI配置来设置作业,而在cicd yml文件中,作业规范如下所示:
# Include the DAST template
include:
- template: DAST.gitlab-ci.yml
# Your selected site and scanner profiles:
dast:
stage: dast
dast_configuration:
site_profile: "auth"
scanner_profile: "default"在站点配置文件中,为身份验证设置了适当的数据,然后运行dast扫描作业,我在日志中得到一个错误,如
2022-07-12T22:00:16.000 INF NAVDB Load URL added to crawl graph
2022-07-12T22:00:16.000 INF AUTH Attempting to authenticate
2022-07-12T22:00:16.000 INF AUTH Loading login page LoginURL=https://example.com/account
2022-07-12T22:00:23.000 WRN BROWS response body exceeds allowed size allowed_size_bytes=10000000 request_id=interception-job-4.0 response_size_bytes=11100508 url=https://example.com/main.f3808aecbe8d4efb.js
2022-07-12T22:00:38.000 WRN CONTA request failed, attempting to continue scan error=net::ERR_BLOCKED_BY_RESPONSE index=0 requestID=176.5 url=https://example.com/main.f3808aecbe8d4efb.js
2022-07-12T22:00:39.000 INF AUTH Writing authentication report path=/zap/wrk/gl-dast-debug-auth-report.html
2022-07-12T22:00:39.000 INF AUTH skipping writing of JSON cookie report as there are no cookies to write
2022-07-12T22:00:40.000 FTL MAIN Authentication failed: failed to load login page: expected to find a single element for selector css:#manual_login to follow path to login form, found 0
2022-07-12 22:00:40,059 Browserker completed with exit code 1
2022-07-12 22:00:40,060 BrowserkerError: Failure while running Browserker 1.Exiting scan
sion.ExtensionLoader - Initializing Provides the foundation for concrete message types (for example, HTTP, WebSockets) expose fuzzer implementations.
[zap_server] 13499 [ZAP-daemon] INFO org.parosproxy.paros.extension.ExtensionLoader - Initializing Allows to fuzz HTTP messages.似乎正在进行dast扫描的容器无法正确加载角形javascript文件,因为它超过了允许的响应大小,并且实际的登录表单不加载。是否有一种方法可以增加请求的允许大小,以便我们可以正确地加载登录表单。
我尝试过各种选项,比如设置稳定性超时变量,甚至增加ZAP进程(DAST_ZAP_CLI_OPTIONS: '-Xmx3072m' )的内存。但是仍然得到相同的结果,因为登录表单没有加载,很可能是因为javascript没有正确加载。
发布于 2022-07-14 16:39:24
修复看起来像是一个gitlab/dast变量问题,在我可以找到的任何当前文档中都没有。
为了查看所有可用的选项或参数,我使用以下内容更新cicd文件:
include:
template: DAST.gitlab-ci.yml
dast:
script:
- /analyze --help这样我就能看到可用的选择了。由此我找到了要使用的DAST_BROWSER_MAX_RESPONSE_SIZE_MB变量。设置那个变量解决了我的问题
https://stackoverflow.com/questions/72972548
复制相似问题