Automation plan with failOnWarning: true still ends with exit code 0 if scan produces warnings
See original GitHub issueDescribe the bug
I expected the automation framework parameter failOnWarning
with value true
to cause the execution of a plan containing it to fail, if the scan results in any warnings. That does not seem to be the case. Upon running the plan below against a target that produces warnings, the exit code remains 0.
Please excuse me, if I misunderstood the meaning of failOnWarning
in the first place!
To Reproduce Run the following plan against a target that produces warnings:
env:
contexts:
- excludePaths: []
name: baseline
urls:
- http://ci-demo-master
parameters:
failOnError: true
failOnWarning: true
progressToStdout: false
jobs:
- install:
- pscanrulesBeta
type: addOns
uninstall: []
- parameters:
enableTags: false
maxAlertsPerRule: 10
type: passiveScan-config
- parameters:
maxDuration: 1
url: http://ci-demo-master
type: spider
- parameters:
maxDuration: 0
type: passiveScan-wait
- parameters:
format: Long
summaryFile: /tmp/zap_out.json
rules: []
type: outputSummary
- type: report
parameters:
reportDir: /tmp/testing/artifacts
template: traditional-html
- type: report
parameters:
reportDir: /tmp/testing/artifacts
template: traditional-json
Expected behavior The execution of the automation plan ends with an exit code != 0
Screenshots
Software versions
- ZAP: 2.11.0
- Add-on: None except the defaults and the ones required by the plan above
- OS: Official zap2docker-stable container
- Java: 11.0.11 according to ZAP output (
Found Java version 11.0.11
) - Browser: -
Errors from the zap.log file No errors, only INFO output in zap.log
Additional context
Would you like to help fix this issue? Gladly 👍
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
Warnings result in a non-0 exit code · Issue #652 - GitHub
Warnings result in a successful (0) exit code, unless otherwise specified with --fail-on-warning in passthru options.
Read more >userguide.pdf - Gradle User Manual
Runs the tasks selected at the end of the configuration phase. ... Executing a Gradle build without a settings file is now an...
Read more >Troubleshooting CI/CD - GitLab Docs
If a pipeline does not seem to run at all, with no error message, it may also be due to rules or only/except...
Read more >PVS-Studio Documentation (single page)
The plugin allows you to handle analyzer reports: view warnings, filter them, etc. You can't run code analysis yet — we plan to...
Read more >The definitive guide to install4j - ej-technologies
The actual installation of these files is handled by the "Install files" action which ... Within a single file set, it causes an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I get this too 😦 Will investigate further…
Thanks a lot! Since there’s an easy workaround with the summaryFile this is probably not the highest priority so no worries 😃
A little follow-up: The zap2docker image doesn’t contain
jq
so here is a one-liner to achieve the same as outlined above withoutjq
.