Skip to content

GSPM Phase 1#7542

Open
psiinon wants to merge 1 commit into
zaproxy:mainfrom
psiinon:gspm/phase1
Open

GSPM Phase 1#7542
psiinon wants to merge 1 commit into
zaproxy:mainfrom
psiinon:gspm/phase1

Conversation

@psiinon

@psiinon psiinon commented Jul 13, 2026

Copy link
Copy Markdown
Member

This phase does NOT provide a fully working feature 😁
It does provide:

  • A new Global Scan Policy Dialog (but only in dev mode)
  • Integration with the HTTP passive scan rules
  • Integration with the HTTP active scan rules (with related core PR)
  • Policy migration

Lots more to do ...

@psiinon

psiinon commented Jul 13, 2026

Copy link
Copy Markdown
Member Author

Logo
Checkmarx One – Scan Summary & Details322ced18-c18f-418d-8803-cf79441edd21


New Issues (1) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 HIGH Improper_Restriction_of_Stored_XXE_Ref addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/internal/GspmPolicyManagerDialog.java: 322
detailsThe loads and parses XML using parse, at line 62 of /addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/internal/GspmLegacyImporter....
Attack Vector

Fixed Issues (4) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
HIGH CVE-2026-3505 Maven-org.bouncycastle:bcpg-jdk18on-1.80
MEDIUM CVE-2025-4949 Maven-org.eclipse.jgit:org.eclipse.jgit-6.7.0.202309050840-r
MEDIUM CVE-2026-0636 Maven-org.bouncycastle:bcprov-jdk18on-1.80.2
MEDIUM CVE-2026-5588 Maven-org.bouncycastle:bcpkix-jdk18on-1.80

Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces Phase 1 of the Global Scan Policy Manager (GSPM) across the extensions codebase by adding a new commonlib GSPM registry/policy model and UI (dev-mode), and wiring passive scan rules into the registry, including legacy policy migration and unit tests.

Changes:

  • Added a new GSPM framework in commonlib (registry, policy model, legacy importer, Swing dialogs/table model) plus i18n strings.
  • Registered passive scan rules with the GSPM registry during pscan post-init and unregistered on unload.
  • Added unit tests covering policy/ruleset matching, registry behavior, and legacy .policy migration to .policy2.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
addOns/pscan/src/main/resources/org/zaproxy/addon/pscan/resources/Messages.properties Adds i18n strings for GSPM tool/category labels in passive scan.
addOns/pscan/src/main/java/org/zaproxy/addon/pscan/GspmPassiveScanRegistrar.java New registrar that adapts passive scan rules to GspmRule and registers them in commonlib.
addOns/pscan/src/main/java/org/zaproxy/addon/pscan/ExtensionPassiveScan2.java Hooks registrar into pscan lifecycle (postInit/unload).
addOns/commonlib/src/test/java/org/zaproxy/addon/commonlib/gspm/GspmRuleSetUnitTest.java New unit tests for rule set matching and category key behavior.
addOns/commonlib/src/test/java/org/zaproxy/addon/commonlib/gspm/GspmRegistryUnitTest.java New unit tests for registry registration, policy views, and migration behavior.
addOns/commonlib/src/test/java/org/zaproxy/addon/commonlib/gspm/GspmPolicyUnitTest.java New unit tests for policy defaults, overrides, ordering, and YAML round-trip.
addOns/commonlib/src/main/resources/org/zaproxy/addon/commonlib/resources/Messages.properties Adds i18n strings for GSPM dialogs/menus/status labels.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmRuleTableModel.java New table model for displaying/editing per-rule threshold/strength/status in the UI.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmRuleSet.java New rule-set model with matching logic and stable category key derivation.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmRuleRef.java New lightweight per-rule reference used in rule sets.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmRule.java New interface representing a scan rule managed by GSPM.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmRegistry.java New registry providing rule registration, policy views, tool display names, and persistence loading/migration.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmPolicyManagerDialog.java New UI dialog to manage policies (add/edit/delete/import/export).
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmPolicy.java New YAML-backed policy model with defaults, category overrides, and per-rule overrides.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmLegacyImporter.java New importer that migrates legacy XML .policy files into .policy2 YAML.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/gspm/GspmDialog.java New main GSPM editor dialog with tree/category panels and per-rule editing.
addOns/commonlib/src/main/java/org/zaproxy/addon/commonlib/ExtensionCommonlib.java Exposes GspmRegistry, loads policies in dev build, and adds dev-mode menu/toolbar entry points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread addOns/pscan/src/main/java/org/zaproxy/addon/pscan/GspmPassiveScanRegistrar.java Outdated
@psiinon
psiinon force-pushed the gspm/phase1 branch 2 times, most recently from c8b2c5c to 34783bf Compare July 14, 2026 12:52
@thc202
thc202 requested a review from Copilot July 14, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 8 comments.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Signed-off-by: Simon Bennetts <psiinon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants