fix: improve safe mode error messages to be more descriptive#908
fix: improve safe mode error messages to be more descriptive#908Pcmhacker-piro wants to merge 2 commits into
Conversation
utksh1
left a comment
There was a problem hiding this comment.
This PR needs to be narrowed before it can be reviewed.
The title says safe-mode error message improvements, but the diff includes unrelated ZAP scanner/plugin work, CORS/middleware changes, frontend package/package-lock changes, and settings UI/test churn. That is too broad for a safe-mode copy/validation fix.
Please rebase or split this so the PR only contains the safe-mode error-message behavior and its direct tests.
6a2ad9b to
8a8bcd2
Compare
|
heyy @utksh1 |
utksh1
left a comment
There was a problem hiding this comment.
Rechecking after the latest audit-exception commit: this is still blocked.
The safe-mode error-message PR needs to stay focused on safe-mode validation behavior and its direct tests. Please remove unrelated audit-policy, plugin/ZAP, CORS, frontend dependency, and settings UI churn from this PR.
✦ Description
Improved the safe mode rejection messages to be more descriptive and helpful. Previously, messages like 'Target not within allowed networks' were too generic. The new messages specify the exact reason for the security block and provide guidance on how to resolve it (e.g., disabling safe mode in the policy or contacting an administrator).
Fixes #724
⟡ Type of Change
✦ Checklist
Description
Root Cause
The safe mode validation logic in
backend/secuscan/validation.pyused generic error messages that didn't help users understand why their scans were being blocked or how to proceed.Changes Made
_validate_resolved_ips_safe_modeandvalidate_targetinbackend/secuscan/validation.pywith descriptive, actionable error messages.testing/backend/unit/test_validation.pyto match the new message format.Testing Performed
Result
PASS - Descriptive error messages are now returned during safe mode validation failures.