Test/zap no placeholder output 1419#1718
Open
karrisanthoshigayatri wants to merge 3 commits into
Open
Conversation
…tksh1#1419) Closes utksh1#1419 Extends testing/backend/unit/test_zap_scanner_plugin.py with three new test classes that guard against the ZAP plugin silently returning placeholder or stub content as real scan findings: TestZAPParserRejectsPlaceholderOutput - test_placeholder_outputs_produce_no_findings: iterates over 17 placeholder/stub strings (connector stubs, Docker-unavailable messages, PASS:/INFO: lines, generic status text) and asserts each produces zero findings and zero items. - test_plain_pass_line_is_not_a_finding: PASS: lines appear in real ZAP output but must not become security findings. - test_info_line_is_not_a_finding: INFO: diagnostic lines must be ignored. - test_mixed_placeholder_and_real_alerts_counts_only_real: verifies that placeholder noise does not inflate the count when mixed with genuine WARN-NEW: / FAIL-NEW: lines. - test_fixture_contains_no_placeholder_lines: the canonical fixture must only contain real ZAP alert lines. - test_parser_findings_have_real_alert_in_description: each finding description must trace back to a WARN-NEW: or FAIL-NEW: line. TestZAPPluginImplementationStatus - Asserts zap_scanner is registered in _PLACEHOLDER_PLUGIN_IDS. - Asserts list_plugins() surfaces implementation_status='placeholder'. - Asserts get_plugin_schema() surfaces implementation_status='placeholder'. TestZAPCommandPathIsReal - Asserts the built command uses ghcr.io/zaproxy/zaproxy:stable, not a no-op stub (echo/true/placeholder). - Asserts zap-baseline.py is the entrypoint. - Asserts the target URL is forwarded after the -t flag. All five existing tests from issue utksh1#521 are preserved unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issues
Type of Change
How Has This Been Tested?
Checklist