Skip to content

Test/zap no placeholder output 1419#1718

Open
karrisanthoshigayatri wants to merge 3 commits into
utksh1:mainfrom
karrisanthoshigayatri:test/zap-no-placeholder-output-1419
Open

Test/zap no placeholder output 1419#1718
karrisanthoshigayatri wants to merge 3 commits into
utksh1:mainfrom
karrisanthoshigayatri:test/zap-no-placeholder-output-1419

Conversation

@karrisanthoshigayatri

Copy link
Copy Markdown
Contributor

Description

Related Issues

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant