websec-validator 0.19.0__tar.gz → 0.19.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {websec_validator-0.19.0/src/websec_validator.egg-info → websec_validator-0.19.1}/PKG-INFO +8 -1
- {websec_validator-0.19.0 → websec_validator-0.19.1}/README.md +7 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/pyproject.toml +1 -1
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/agenthook.py +4 -6
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/cli.py +4 -4
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/coverage.py +10 -4
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/base.py +6 -1
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/crypto_usage.py +6 -2
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/upload_security.py +24 -2
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/gate.py +130 -7
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/graph_enrich.py +2 -1
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/hooks.py +15 -4
- {websec_validator-0.19.0 → websec_validator-0.19.1/src/websec_validator.egg-info}/PKG-INFO +8 -1
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator.egg-info/SOURCES.txt +1 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_coverage.py +66 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_detector_fp_followups.py +59 -0
- websec_validator-0.19.1/tests/test_gate_policy_and_scope.py +335 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_hooks.py +59 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/LICENSE +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/setup.cfg +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/__init__.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/attest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/attribution.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/baseline.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/briefing.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/calibration.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/calibration.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/clusters.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/constitution.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/corpus.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/dast_ingest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/dast_predict.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/demo.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/diffscope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/dynamic.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/enrichment.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/explain.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/__init__.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/agent_config.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/auth.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/authz.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/authz_dataflow.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/client_exposure.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/client_integrity.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/dependencies.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/django_urls.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/graphql.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/iac_ci.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/integrations.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/llm_security.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/pii_exposure.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/policy_consistency.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/profiles.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/routes.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/schemas.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/sql_flow.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/stack.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/surface.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/syntax.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/tenant.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/transport_security.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/webext.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/feedback.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/findings.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/fixprompt.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/formats.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/fpfilter.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/init_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/install.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/intel.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/inventory.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/mcp_server.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/openapi.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/pairs.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/probes.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/proof.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/provenance.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/recon.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/registry.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/repairs.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/report.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/research/control-scope-cases.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/research/example.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/research/profile-cases.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/research.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/rules/error-stack-disclosure.yml +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/rules/insecure-default-secret.yml +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/sarif_ingest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/scanners.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/schemas/coverage.schema.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/schemas/facts.schema.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/schemas/ledger.schema.json +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/synthetic.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/demo/app.py.txt +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/demo/requirements.txt.txt +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/_lib.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/appsync-cswsh.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/appsync-introspection.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/appsync-subscription-bola.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/bola-cross-tenant.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/bola-write-verbs.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/client-integrity-checklist.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/compare-roles.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/dlp-bypass-offline.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/entitlement-abuse.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/error-disclosure-probe.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/forged-token.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/hs256-brute-force.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/jwt-attacks.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/mass-assignment.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/password-reuse.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/pii-output-diff.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/race-conditions.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/rate-limit-burst.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/s3-assess.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/ssrf-probes.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/unauth-baseline.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/upload-matrix.sh +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/probes/webhook-forgery.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/reports/FINDINGS-SUMMARY.md.template +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/reports/access-control-matrix.md.template +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/reports/findings-triage.md.template +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/reports/pentest-handover-brief.md.template +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/templates/reports/per-tool-FINDINGS.md.template +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/testplan.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator.egg-info/dependency_links.txt +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator.egg-info/entry_points.txt +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator.egg-info/top_level.txt +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_action_contracts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_adoption_contracts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_agent_hook.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_agent_hosts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_agent_launch_specs.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_analysis_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_assurance_regressions.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_attest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_attribution.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_auth_control_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_calibration_claimspec.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_calibration_review.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_calibration_scoring.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_constitution.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_control_scope_research.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_crypto_comparisons.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_dast_ingest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_dast_predict.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_demo.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_detector_precision.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_diffscope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_django_routes.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_dynamic_login_shape.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_enrichment.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_entitlement_webext.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_evidence_verdicts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_explain.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_explained_brief.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_extension_controls.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_feedback.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_feedback_calibration_loop.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_field_report_2026_09.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_fixprompt_fpfilter.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_formats.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_fp_sources.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_gate_and_bypass_record.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_gate_command.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_gitleaks_worktree.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_graph_enrich.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_hardening.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_hooks_contracts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_ignore_claimspec.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_install.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_install_contracts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_intel.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_inventory.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_issue_147_sarif_locations.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_lifecycle.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_mcp.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_mcp_security.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_openapi.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_output_boundaries.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_pentest_regressions.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_pii_projection_fp.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_profiles.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_proof_revisions.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_provenance.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_public_precision.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_read_boundary.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_read_performance.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_recon.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_registry_existence.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_remaining_control_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_research.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_research_cli.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_sarif_ingest.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_sarif_workbench.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_scanner_contracts.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_source_budget.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_sql_flow.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_stack_metadata.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_synthetic_pairs.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_testplan.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_transport_pii_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_transport_stack_scope.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_triage.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_unanalyzed_cli.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_unanalyzed_coverage.py +0 -0
- {websec_validator-0.19.0 → websec_validator-0.19.1}/tests/test_workbench_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: websec-validator
|
|
3
|
-
Version: 0.19.
|
|
3
|
+
Version: 0.19.1
|
|
4
4
|
Summary: Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app.
|
|
5
5
|
Author: Ricardo Accioly
|
|
6
6
|
License: MIT
|
|
@@ -491,6 +491,13 @@ tracked modifications plus untracked files — because agent edits are uncommitt
|
|
|
491
491
|
`base...HEAD` diff would see nothing. It writes no artifacts, publishes no run directory and never
|
|
492
492
|
advances an accepted baseline.
|
|
493
493
|
|
|
494
|
+
`gate` applies `.websec-ignore` exactly as `run` does: an active `fingerprint:` acknowledgement is
|
|
495
|
+
reported under `acknowledged` and does not block; an expired or reasonless one excuses nothing. A
|
|
496
|
+
finding blocks only when it names a file you asked about. One attributed to a *different*
|
|
497
|
+
repository file — some extractors read CI workflows or config manifests such as `wrangler.jsonc`
|
|
498
|
+
whatever `--only` names — is reported under `outside_scope` instead; one that names no file at all still
|
|
499
|
+
blocks, because it cannot be shown to be outside the scope.
|
|
500
|
+
|
|
494
501
|
The default threshold is **medium, not high**: command injection and SSRF on agent-written code are
|
|
495
502
|
frequently rated MEDIUM, so a HIGH default would miss the main case. `--min-confidence` filters
|
|
496
503
|
low-confidence leads for teams that measure them as noisy; there is no confidence floor by default,
|
|
@@ -462,6 +462,13 @@ tracked modifications plus untracked files — because agent edits are uncommitt
|
|
|
462
462
|
`base...HEAD` diff would see nothing. It writes no artifacts, publishes no run directory and never
|
|
463
463
|
advances an accepted baseline.
|
|
464
464
|
|
|
465
|
+
`gate` applies `.websec-ignore` exactly as `run` does: an active `fingerprint:` acknowledgement is
|
|
466
|
+
reported under `acknowledged` and does not block; an expired or reasonless one excuses nothing. A
|
|
467
|
+
finding blocks only when it names a file you asked about. One attributed to a *different*
|
|
468
|
+
repository file — some extractors read CI workflows or config manifests such as `wrangler.jsonc`
|
|
469
|
+
whatever `--only` names — is reported under `outside_scope` instead; one that names no file at all still
|
|
470
|
+
blocks, because it cannot be shown to be outside the scope.
|
|
471
|
+
|
|
465
472
|
The default threshold is **medium, not high**: command injection and SSRF on agent-written code are
|
|
466
473
|
frequently rated MEDIUM, so a HIGH default would miss the main case. `--min-confidence` filters
|
|
467
474
|
low-confidence leads for teams that measure them as noisy; there is no confidence floor by default,
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "websec-validator"
|
|
7
|
-
version = "0.19.
|
|
7
|
+
version = "0.19.1"
|
|
8
8
|
description = "Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -115,13 +115,11 @@ def run(event: dict | None = None, *, env: dict | None = None) -> int:
|
|
|
115
115
|
# * it avoids a second interpreter start (~0.2s) on every edit.
|
|
116
116
|
# The harness's own hook timeout is the outer guard.
|
|
117
117
|
try:
|
|
118
|
-
from . import
|
|
118
|
+
from . import gate as _gate
|
|
119
119
|
from . import __version__ as _version
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
scope_source="agent-hook",
|
|
124
|
-
min_confidence=env.get("WEBSEC_GATE_MIN_CONFIDENCE", "low"))
|
|
120
|
+
result = _gate.evaluate(Path(root), relative, env.get("WEBSEC_GATE_FAIL_ON", "medium"),
|
|
121
|
+
version=_version, scope_source="agent-hook",
|
|
122
|
+
min_confidence=env.get("WEBSEC_GATE_MIN_CONFIDENCE", "low"))
|
|
125
123
|
except Exception as error:
|
|
126
124
|
# FAIL OPEN, LOUDLY. A security check that blocks every edit when it is broken gets
|
|
127
125
|
# uninstalled within the hour, and then there is no check at all.
|
|
@@ -960,10 +960,10 @@ def cmd_gate(args) -> int:
|
|
|
960
960
|
"reason": "no changed files to analyze"}))
|
|
961
961
|
return 0
|
|
962
962
|
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
963
|
+
result = _gate.evaluate(target, paths, args.fail_on, version=__version__,
|
|
964
|
+
scope_source=scope_source,
|
|
965
|
+
min_confidence=getattr(args, "min_confidence", "low"),
|
|
966
|
+
excludes=getattr(args, "exclude", None))
|
|
967
967
|
|
|
968
968
|
# --fail-on-missed is applied HERE, not inside verdict(): `verdict` answers "are there blocking
|
|
969
969
|
# findings in what was analysed", and a path that was never analysed produced no finding to
|
|
@@ -21,8 +21,8 @@ def detector_revision() -> str:
|
|
|
21
21
|
return "sha256:" + digest.hexdigest()
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
def include_reads(cov: dict, ctx, *, input_prefix: str = "") -> None:
|
|
25
|
-
"""Merge
|
|
24
|
+
def include_reads(cov: dict, ctx, *, input_prefix: str = "", execution: bool = True) -> None:
|
|
25
|
+
"""Merge auxiliary reads; optional enrichment losses are scope gaps, not source losses."""
|
|
26
26
|
cov.setdefault("inputs", {}).update({input_prefix + key: value for key, value in ctx.input_hashes.items()})
|
|
27
27
|
cov["analyzed_input_digest"] = _digest(cov["inputs"])
|
|
28
28
|
files = cov.setdefault("files", {})
|
|
@@ -30,9 +30,15 @@ def include_reads(cov: dict, ctx, *, input_prefix: str = "") -> None:
|
|
|
30
30
|
files.setdefault("auxiliary_read_policies", {})[input_prefix] = source_read_policy(ctx)
|
|
31
31
|
files.setdefault("auxiliary_source_bytes", {})[input_prefix] = ctx.cached_source_bytes
|
|
32
32
|
for key in ("unreadable", "oversized", "byte_budget_exceeded"):
|
|
33
|
-
|
|
33
|
+
paths = {input_prefix + path for path in getattr(ctx, key)}
|
|
34
|
+
# The source-loss lists are independently checked by repair/proof consumers.
|
|
35
|
+
# Optional enrichment must not contaminate that required-execution evidence.
|
|
36
|
+
if execution:
|
|
37
|
+
files[key] = sorted(set(files.get(key, [])) | paths)
|
|
34
38
|
if getattr(ctx, key):
|
|
35
|
-
add_gap({"coverage": cov}, key,
|
|
39
|
+
add_gap({"coverage": cov}, key,
|
|
40
|
+
"auxiliary input could not be read completely: " + ", ".join(sorted(paths)),
|
|
41
|
+
execution=execution)
|
|
36
42
|
|
|
37
43
|
|
|
38
44
|
def source_read_policy(ctx) -> dict:
|
|
@@ -301,7 +301,12 @@ class RepoContext:
|
|
|
301
301
|
self.all_code_files: list[Path] = []
|
|
302
302
|
self.scope: set[str] | None = None
|
|
303
303
|
if only:
|
|
304
|
-
|
|
304
|
+
# Path() already drops a leading "./". `.lstrip("./")` used to follow it, and lstrip
|
|
305
|
+
# removes CHARACTERS, not a prefix: `.github/scripts/triage.py` became
|
|
306
|
+
# `github/scripts/triage.py`, matched nothing, and every code file under a
|
|
307
|
+
# dot-directory or named as a dotfile (.husky/*.js, .eslintrc.js) was reported missed
|
|
308
|
+
# — never analyzed by the gate. It also turned `../app.py` into `app.py`.
|
|
309
|
+
self.scope = {Path(str(p)).as_posix() for p in only if str(p).strip()}
|
|
305
310
|
self.scope_requested: list[str] = sorted(self.scope) if self.scope else []
|
|
306
311
|
self.scope_matched: list[str] = []
|
|
307
312
|
self.scope_missed: list[str] = []
|
{websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator/extractors/crypto_usage.py
RENAMED
|
@@ -23,7 +23,10 @@ import re
|
|
|
23
23
|
from .base import Extractor, RepoContext, is_test_file
|
|
24
24
|
from .syntax import expression_end, in_literal, js_functions, without_comments
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
# Exact metadata suffixes are not password bytes. Hashes/tokens in general remain
|
|
27
|
+
# credential-shaped; a broad suffix exemption would hide double-hashed passwords.
|
|
28
|
+
_PW_METADATA = r"_?(?:reset_?(?:token|url)|attempt_?count|file_?path|salt)"
|
|
29
|
+
_PW = r"(?:password|passwd|passphrase|\bpwd\b|userPassword|plainPassword)(?!" + _PW_METADATA + r"\b)"
|
|
27
30
|
# a fast digest fed a password-shaped value (either arg order, within a small window)
|
|
28
31
|
WEAK_PW_HASH = re.compile(
|
|
29
32
|
r"createHash\s*\(\s*['\"](?:md5|sha1|sha256|sha224)['\"]\s*\)[\s\S]{0,160}?\.update\s*\([^)]*" + _PW
|
|
@@ -100,7 +103,8 @@ def _unparenthesized(value: str) -> str:
|
|
|
100
103
|
|
|
101
104
|
|
|
102
105
|
# Identifier-shaped arguments: not credentials, so hashing them weakly is not a password-hash bug.
|
|
103
|
-
_NON_CREDENTIAL_ARGUMENT = re.compile(
|
|
106
|
+
_NON_CREDENTIAL_ARGUMENT = re.compile(
|
|
107
|
+
r"(?:^|\.)(?:id|email|userId|user_id|tenantId|tenant_id|password" + _PW_METADATA + r")$", re.I)
|
|
104
108
|
|
|
105
109
|
|
|
106
110
|
def _credential_operand(value: str) -> bool:
|
|
@@ -27,8 +27,7 @@ ALLOW_LIST = re.compile(r"isAllowedMediaType|allowedMimeTypes|allow[_-]?list|whi
|
|
|
27
27
|
r"|ACCEPTED_(?:MIME|TYPES?|EXT)|accepted(?:Mime|File|Content)?(?:Types?|Extensions?)"
|
|
28
28
|
r"|\bfile-type\b|fileTypeFrom|magic[_-]?byte|detectContentType|\.fromBuffer\b|sniff", re.I)
|
|
29
29
|
KEY_FROM_NAME = re.compile(r"(?:Key|key|path|filename|filepath|destination|filename\s*\()\s*[:=(][^;\n]{0,90}"
|
|
30
|
-
r"\b(?:originalname|originalName|file\.name)\b"
|
|
31
|
-
r"|`[^`]*\$\{[^}]*\boriginalname\b[^}]*\}[^`]*`", re.I)
|
|
30
|
+
r"\b(?:originalname|originalName|file\.name)\b", re.I)
|
|
32
31
|
TRUST_CLIENT_MIME = re.compile(r"(?:\b(?:req|request)\.files?(?:\.[\w$]+)*|\bfile)\.mimetype\b|headers\[['\"]content-type['\"]\]", re.I)
|
|
33
32
|
ACCEPT_SVG = re.compile(r"image/svg\+xml|['\"]svg['\"]", re.I)
|
|
34
33
|
# file-serving: streaming a STORED/PROXIED object back to the client. Tightened to genuine
|
|
@@ -162,7 +161,30 @@ def _byte_allowlist(scope: dict | None, file_object: str, source: str) -> bool:
|
|
|
162
161
|
return True
|
|
163
162
|
|
|
164
163
|
|
|
164
|
+
def _logged_mime_only(source: str, match) -> bool:
|
|
165
|
+
"""Exclude simple logging arguments, never nested calls or decisions."""
|
|
166
|
+
literal = r'''"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*' '''
|
|
167
|
+
value = re.escape(match[0])
|
|
168
|
+
simple = re.compile(r"(?:" + literal + "|" + value + r")(?:\s*\+\s*(?:" + literal + "|" + value + r"))*", re.X)
|
|
169
|
+
for log in re.finditer(r"\b(?:console|logger|logging)\.(?:log|info|debug|warn|warning|error)\s*\(", source):
|
|
170
|
+
if log.start() >= match.start():
|
|
171
|
+
break
|
|
172
|
+
if in_literal(source, log.start()):
|
|
173
|
+
continue
|
|
174
|
+
expression = call_expression(source, log.start())
|
|
175
|
+
if log.start() + len(expression) <= match.end() or not expression.endswith(")"):
|
|
176
|
+
continue
|
|
177
|
+
# Every argument must be inert literals or this MIME property. Unknown
|
|
178
|
+
# expressions (including nested validation calls) contribute no exemption.
|
|
179
|
+
args = split_arguments(expression[expression.find("(") + 1:-1])
|
|
180
|
+
if args and all(simple.fullmatch(arg) for arg in args):
|
|
181
|
+
return True
|
|
182
|
+
return False
|
|
183
|
+
|
|
184
|
+
|
|
165
185
|
def _mime_unsafe(source: str, match, scopes: list[dict]) -> bool:
|
|
186
|
+
if _logged_mime_only(source, match):
|
|
187
|
+
return False
|
|
166
188
|
containing = [scope for scope in scopes if scope["body_start"] <= match.start() < scope["end"]]
|
|
167
189
|
scope = min(containing, key=lambda item: item["end"]-item["start"]) if containing else None
|
|
168
190
|
file_match = re.search(r"([\w$]+(?:\.[\w$]+)*)\.mimetype", match[0])
|
|
@@ -29,16 +29,26 @@ HONEST LIMITS, surfaced in the verdict rather than buried in docs:
|
|
|
29
29
|
* Cross-file evidence outside the scope is not consulted. Measured on this project, scoping never
|
|
30
30
|
INVENTED a finding (0 new across 17 files), which is the property that matters for a gate.
|
|
31
31
|
* `missed` paths were never analyzed. Their absence from the findings is not a clean result.
|
|
32
|
+
* Some extractors read manifests directly (CI workflows; with OWASP Noir, a `wrangler.jsonc`
|
|
33
|
+
route table) no matter what `--only` names, so a scoped pass can still produce a finding ATTRIBUTED to a file
|
|
34
|
+
outside the scope. That finding was not caused by this edit; it is reported under
|
|
35
|
+
`outside_scope` and does not gate. A finding that names no repository file cannot be shown to
|
|
36
|
+
be outside the scope, so it still gates — the safe direction for an unattributable result.
|
|
37
|
+
* `.websec-ignore` applies exactly as it does in `run`: path/category suppressions drop, active
|
|
38
|
+
`fingerprint:` acknowledgements move a finding to `acknowledged`, and an expired, malformed or
|
|
39
|
+
reasonless acknowledgement excuses nothing (the finding gates with its `reopened_reason`).
|
|
32
40
|
"""
|
|
33
41
|
from __future__ import annotations
|
|
34
42
|
|
|
35
43
|
import json
|
|
44
|
+
import re
|
|
36
45
|
import subprocess
|
|
37
46
|
from pathlib import Path
|
|
38
47
|
|
|
39
48
|
SEV_ORDER = ["low", "medium", "high", "critical"]
|
|
40
49
|
_TIMEOUT = 20
|
|
41
50
|
_MAX_FILES = 200
|
|
51
|
+
_LIST_CAP = 20
|
|
42
52
|
|
|
43
53
|
# Analyzing a file is pointless if no detector reads that suffix; this only trims the scope, it
|
|
44
54
|
# never suppresses a finding (an unlisted suffix would produce none anyway).
|
|
@@ -101,6 +111,79 @@ def working_tree_paths(repo: Path) -> dict:
|
|
|
101
111
|
CONF_ORDER = ["low", "medium", "high"]
|
|
102
112
|
|
|
103
113
|
|
|
114
|
+
def evaluate(root: Path, paths: list, threshold: str, *, version: str, scope_source: str,
|
|
115
|
+
min_confidence: str = "low", excludes: list | None = None) -> dict:
|
|
116
|
+
"""The one gate path, shared by `websec gate` and the PostToolUse hook.
|
|
117
|
+
|
|
118
|
+
Both used to build the ledger themselves with no ignore policy, and drifted from `run`
|
|
119
|
+
identically: a finding reviewed and acknowledged in `.websec-ignore` blocked every agent edit.
|
|
120
|
+
One function means the policy cannot be dropped from one entry point and kept in the other.
|
|
121
|
+
"""
|
|
122
|
+
from . import findings, recon
|
|
123
|
+
from .extractors.base import RepoContext
|
|
124
|
+
root = Path(root)
|
|
125
|
+
facts = recon.build_facts(root, version, excludes, only=paths)
|
|
126
|
+
# One non-walking context serves both reads: `load_*` would otherwise walk the whole tree
|
|
127
|
+
# twice more, tripling the cost of a check that runs on every edit.
|
|
128
|
+
policy = RepoContext(root, walk=False)
|
|
129
|
+
ledger = findings.build_ledger(facts, None, None,
|
|
130
|
+
findings.load_suppressions(root, context=policy),
|
|
131
|
+
findings.load_acknowledgements(root, context=policy))
|
|
132
|
+
return verdict(ledger, facts, threshold, scope_source=scope_source,
|
|
133
|
+
min_confidence=min_confidence)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _scope_key(path: str) -> str:
|
|
137
|
+
# The exact normalization RepoContext applies to `only`, so both sides compare alike.
|
|
138
|
+
return Path(path).as_posix()
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _named_paths(finding: dict, root: Path | None) -> list[str]:
|
|
142
|
+
"""Repository-relative paths a finding names: its `file` and its `location` minus :line."""
|
|
143
|
+
out = []
|
|
144
|
+
for value in (finding.get("file"), finding.get("location")):
|
|
145
|
+
value = re.sub(r":L?\d+(?::\d+)?$", "", str(value or "").replace("\\", "/"))
|
|
146
|
+
if not value:
|
|
147
|
+
continue
|
|
148
|
+
if Path(value).is_absolute():
|
|
149
|
+
# A route location (/api/users) is absolute-looking too; only a path under the root
|
|
150
|
+
# can name a repository file.
|
|
151
|
+
try:
|
|
152
|
+
value = Path(value).relative_to(root).as_posix() if root else ""
|
|
153
|
+
except ValueError:
|
|
154
|
+
value = ""
|
|
155
|
+
if value and value not in out:
|
|
156
|
+
out.append(value)
|
|
157
|
+
return out
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def _is_repo_file(root: Path, rel: str) -> bool:
|
|
161
|
+
try:
|
|
162
|
+
resolved = (root / rel).resolve()
|
|
163
|
+
resolved.relative_to(root.resolve())
|
|
164
|
+
return resolved.is_file()
|
|
165
|
+
except (OSError, ValueError, RuntimeError):
|
|
166
|
+
return False
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def scope_state(finding: dict, requested: list, root: Path | None) -> str:
|
|
170
|
+
"""'in-scope' | 'outside-scope' | 'unattributed' for one finding against the requested paths.
|
|
171
|
+
|
|
172
|
+
Outside-scope needs POSITIVE evidence: the finding names a file that exists in the repository
|
|
173
|
+
and is not one of the requested paths. A route-only location or a missing file proves nothing
|
|
174
|
+
about where the finding came from, so it stays gating ('unattributed').
|
|
175
|
+
"""
|
|
176
|
+
if not requested:
|
|
177
|
+
return "in-scope"
|
|
178
|
+
wanted = {_scope_key(p) for p in requested}
|
|
179
|
+
named = _named_paths(finding, root)
|
|
180
|
+
if any(_scope_key(p) in wanted for p in named):
|
|
181
|
+
return "in-scope"
|
|
182
|
+
if root is not None and any(_is_repo_file(root, p) for p in named):
|
|
183
|
+
return "outside-scope"
|
|
184
|
+
return "unattributed"
|
|
185
|
+
|
|
186
|
+
|
|
104
187
|
def verdict(ledger: dict, facts: dict, threshold: str, *, scope_source: str = "explicit",
|
|
105
188
|
min_confidence: str = "low") -> dict:
|
|
106
189
|
"""Pass/fail plus everything a harness needs to explain the decision to a model.
|
|
@@ -129,8 +212,14 @@ def verdict(ledger: dict, facts: dict, threshold: str, *, scope_source: str = "e
|
|
|
129
212
|
# dropping a finding because its confidence could not be graded is the wrong direction.
|
|
130
213
|
return conf not in CONF_ORDER or CONF_ORDER.index(conf) >= conf_floor
|
|
131
214
|
|
|
132
|
-
blocking = [f for f in ledger.get("findings", []) or [] if _blocks(f)]
|
|
133
215
|
scope = facts.get("analysis_scope") or {}
|
|
216
|
+
root = Path(facts["target"]) if facts.get("target") else None
|
|
217
|
+
in_scope, outside = [], []
|
|
218
|
+
for f in ledger.get("findings", []) or []:
|
|
219
|
+
state = scope_state(f, scope.get("requested") or [], root)
|
|
220
|
+
(outside if state == "outside-scope" else in_scope).append((f, state))
|
|
221
|
+
blocking = [(f, state) for f, state in in_scope if _blocks(f)]
|
|
222
|
+
acknowledged = ledger.get("acknowledged", []) or []
|
|
134
223
|
out = {
|
|
135
224
|
"tool": "websec-validator",
|
|
136
225
|
"command": "gate",
|
|
@@ -145,12 +234,35 @@ def verdict(ledger: dict, facts: dict, threshold: str, *, scope_source: str = "e
|
|
|
145
234
|
"findings": [{"severity": f.get("severity"), "confidence": f.get("confidence"),
|
|
146
235
|
"title": f.get("title"), "file": f.get("file"), "line": f.get("line"),
|
|
147
236
|
"attack_class": f.get("attack_class"), "rule_id": f.get("rule_id"),
|
|
148
|
-
"remediation": f.get("remediation")
|
|
149
|
-
|
|
237
|
+
"remediation": f.get("remediation"), "fingerprint": f.get("fingerprint"),
|
|
238
|
+
"scope": state,
|
|
239
|
+
**({"reopened_reason": f["reopened_reason"]}
|
|
240
|
+
if f.get("reopened_reason") else {})}
|
|
241
|
+
for f, state in blocking],
|
|
242
|
+
"outside_scope_count": len(outside),
|
|
243
|
+
"outside_scope": [{"severity": f.get("severity"), "title": f.get("title"),
|
|
244
|
+
"file": f.get("file") or f.get("location"),
|
|
245
|
+
"fingerprint": f.get("fingerprint")}
|
|
246
|
+
for f, _ in outside[:_LIST_CAP]],
|
|
247
|
+
"acknowledged_count": len(acknowledged),
|
|
248
|
+
"acknowledged": [{"severity": f.get("severity"), "title": f.get("title"),
|
|
249
|
+
"file": f.get("file") or f.get("location"),
|
|
250
|
+
"fingerprint": f.get("fingerprint"),
|
|
251
|
+
"expires": (f.get("acknowledgement") or {}).get("expires"),
|
|
252
|
+
"reason": f.get("ack_reason")}
|
|
253
|
+
for f in acknowledged[:_LIST_CAP]],
|
|
150
254
|
"scope_note": ("a scoped pass over the files just changed. This is a fast retry signal, not "
|
|
151
255
|
"a review: cross-file evidence outside the scope was not consulted, and a "
|
|
152
256
|
"clean result here does not mean the repository is clean."),
|
|
153
257
|
}
|
|
258
|
+
if outside:
|
|
259
|
+
out["outside_scope_note"] = ("findings attributed to repository files OUTSIDE the requested "
|
|
260
|
+
"scope (typically read directly from a config manifest). This "
|
|
261
|
+
"edit did not cause them and they do not gate here; `websec "
|
|
262
|
+
"run` still reports and gates them")
|
|
263
|
+
if acknowledged:
|
|
264
|
+
out["acknowledged_note"] = ("findings matched by an active `fingerprint:` acknowledgement in "
|
|
265
|
+
".websec-ignore; shown, not gating, exactly as in `websec run`")
|
|
154
266
|
if out["missed"]:
|
|
155
267
|
out["missed_note"] = ("these requested paths were never analyzed (excluded, generated, "
|
|
156
268
|
"unsupported suffix or absent); their absence from the findings is "
|
|
@@ -163,6 +275,12 @@ def render_text(result: dict) -> str:
|
|
|
163
275
|
if result["passed"]:
|
|
164
276
|
n = len(result["analyzed"])
|
|
165
277
|
missed = len(result.get("missed") or [])
|
|
278
|
+
# Say what was set aside, so a pass never reads as "nothing was there at all".
|
|
279
|
+
aside = [f"{c} {label}" for c, label in
|
|
280
|
+
((result.get("acknowledged_count", 0), "acknowledged in .websec-ignore"),
|
|
281
|
+
(result.get("outside_scope_count", 0), "outside the changed files"))
|
|
282
|
+
if c]
|
|
283
|
+
tail = f"; not gating: {', '.join(aside)}" if aside else ""
|
|
166
284
|
# A pass over zero analysed files is the reading that must never look clean. The verdict
|
|
167
285
|
# itself is unchanged (see `verdict`'s contract and test_gate_command); only the sentence
|
|
168
286
|
# the model reads is, because a bare "pass (0 file(s) analyzed)" is indistinguishable from
|
|
@@ -170,20 +288,25 @@ def render_text(result: dict) -> str:
|
|
|
170
288
|
if missed and not n:
|
|
171
289
|
return (f"websec gate: pass — but 0 file(s) were analyzed and {missed} requested path(s) "
|
|
172
290
|
f"were never looked at (threshold {result['threshold']}). "
|
|
173
|
-
"This is NOT a clean result: " + result.get("missed_note", ""))
|
|
291
|
+
"This is NOT a clean result: " + result.get("missed_note", "") + tail)
|
|
174
292
|
if missed:
|
|
175
293
|
return (f"websec gate: pass ({n} file(s) analyzed, threshold {result['threshold']}) — "
|
|
176
|
-
f"{missed} requested path(s) never analyzed; not a clean result for those")
|
|
177
|
-
return f"websec gate: pass ({n} file(s) analyzed, threshold {result['threshold']})"
|
|
294
|
+
f"{missed} requested path(s) never analyzed; not a clean result for those{tail}")
|
|
295
|
+
return f"websec gate: pass ({n} file(s) analyzed, threshold {result['threshold']}){tail}"
|
|
178
296
|
lines = [f"websec gate: FAILED — {result['blocking_count']} finding(s) at or above "
|
|
179
|
-
f"{result['threshold']} in
|
|
297
|
+
f"{result['threshold']} in this scoped analysis.", ""]
|
|
180
298
|
for f in result["findings"][:10]:
|
|
181
299
|
where = f.get("file") or "(no file)"
|
|
182
300
|
if f.get("line"):
|
|
183
301
|
where += f":{f['line']}"
|
|
184
302
|
lines.append(f" [{f.get('severity')}] {where} — {f.get('title')}")
|
|
303
|
+
if f.get("scope") == "unattributed":
|
|
304
|
+
lines.append(" scope: unattributed — not proven to originate in the changed files; "
|
|
305
|
+
"kept gating because outside-scope attribution is unverified.")
|
|
185
306
|
if f.get("remediation"):
|
|
186
307
|
lines.append(f" fix: {f['remediation']}")
|
|
308
|
+
if f.get("reopened_reason"):
|
|
309
|
+
lines.append(f" note: {f['reopened_reason']} (fingerprint {f.get('fingerprint')})")
|
|
187
310
|
if result["blocking_count"] > 10:
|
|
188
311
|
lines.append(f" … and {result['blocking_count'] - 10} more")
|
|
189
312
|
lines += ["", "Fix these, then the check will re-run on the next edit.",
|
|
@@ -150,7 +150,8 @@ def enrich_ledger(ledger: dict, target: Path, graph_path: Path | None = None, *,
|
|
|
150
150
|
if ledger.get("coverage") is not None:
|
|
151
151
|
from . import coverage
|
|
152
152
|
prefix = f"external-graph:{gp.parent}:" if graph_path is not None else ""
|
|
153
|
-
coverage.include_reads(ledger["coverage"], ctx, input_prefix=prefix
|
|
153
|
+
coverage.include_reads(ledger["coverage"], ctx, input_prefix=prefix,
|
|
154
|
+
execution=graph_path is not None)
|
|
154
155
|
if graph is None:
|
|
155
156
|
ledger["graph_enrichment"] = {"available": False, "input": str(gp),
|
|
156
157
|
"explicit_input": graph_path is not None,
|
|
@@ -54,6 +54,10 @@ def _hooks_dir(root: Path) -> Path:
|
|
|
54
54
|
raw = res.stdout.strip()
|
|
55
55
|
if res.returncode == 0 and raw and not any(c in raw for c in ("\n", "\r", "\x00")):
|
|
56
56
|
d = (root / raw).resolve()
|
|
57
|
+
# Husky v9 points Git at generated dispatchers in .husky/_. The
|
|
58
|
+
# durable user scripts live one level up and survive `husky install`.
|
|
59
|
+
if d.name == "_" and d.parent.name == ".husky":
|
|
60
|
+
d = d.parent
|
|
57
61
|
d.mkdir(parents=True, exist_ok=True)
|
|
58
62
|
return d
|
|
59
63
|
except (OSError, FileNotFoundError):
|
|
@@ -372,17 +376,24 @@ def run_guardrail(*, pre_push: bool = False) -> int:
|
|
|
372
376
|
return failure
|
|
373
377
|
|
|
374
378
|
|
|
375
|
-
def _write_hook(hooks_dir: Path, name: str, script: str) -> str:
|
|
379
|
+
def _write_hook(hooks_dir: Path, name: str, script: str, *, shell_fragment: bool = False) -> str:
|
|
376
380
|
hook_path = hooks_dir / name
|
|
377
381
|
if hook_path.exists():
|
|
378
382
|
content = hook_path.read_text(encoding="utf-8")
|
|
379
383
|
first = content.splitlines()[0] if content else ""
|
|
380
|
-
|
|
384
|
+
shell = re.fullmatch(r"#!\s*(?:/bin/(?:ba)?sh|/usr/bin/(?:ba)?sh|/usr/bin/env (?:ba)?sh)", first)
|
|
385
|
+
# Husky invokes its user script with sh; these files commonly omit a
|
|
386
|
+
# shebang. An explicit non-shell interpreter must still be refused.
|
|
387
|
+
fragment = shell_fragment and not first.startswith("#!")
|
|
388
|
+
if content.strip() and not shell and not fragment:
|
|
381
389
|
raise RuntimeError(f"refusing to modify non-shell hook {hook_path}; chain websec explicitly")
|
|
382
390
|
if MARKER_START in content: # replace our section in place (idempotent)
|
|
383
391
|
content = _strip_section(content)
|
|
384
392
|
lines = content.splitlines(keepends=True)
|
|
385
|
-
|
|
393
|
+
if fragment:
|
|
394
|
+
merged = "#!/bin/sh\n" + script + content
|
|
395
|
+
else:
|
|
396
|
+
merged = lines[0].rstrip("\r\n") + "\n" + script + "".join(lines[1:]) if lines else "#!/bin/sh\n" + script
|
|
386
397
|
hook_path.write_text(merged, encoding="utf-8", newline="\n")
|
|
387
398
|
hook_path.chmod(0o755)
|
|
388
399
|
return f"updated {name} hook at {hook_path}"
|
|
@@ -417,7 +428,7 @@ def install(path: Path | None = None, *, pre_push: bool = False) -> str:
|
|
|
417
428
|
raise RuntimeError(f"no git repository at or above {(path or Path('.')).resolve()}")
|
|
418
429
|
hooks_dir = _hooks_dir(root)
|
|
419
430
|
name = "pre-push" if pre_push else "post-commit"
|
|
420
|
-
return _write_hook(hooks_dir, name, _script(pre_push))
|
|
431
|
+
return _write_hook(hooks_dir, name, _script(pre_push), shell_fragment=hooks_dir.name == ".husky")
|
|
421
432
|
|
|
422
433
|
|
|
423
434
|
def uninstall(path: Path | None = None) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: websec-validator
|
|
3
|
-
Version: 0.19.
|
|
3
|
+
Version: 0.19.1
|
|
4
4
|
Summary: Defensive, local-first security recon that briefs your AI coding agent on your own codebase — read-only by default (code in, artifacts out): facts + tailored probe scripts, no LLM, no server, no running app.
|
|
5
5
|
Author: Ricardo Accioly
|
|
6
6
|
License: MIT
|
|
@@ -491,6 +491,13 @@ tracked modifications plus untracked files — because agent edits are uncommitt
|
|
|
491
491
|
`base...HEAD` diff would see nothing. It writes no artifacts, publishes no run directory and never
|
|
492
492
|
advances an accepted baseline.
|
|
493
493
|
|
|
494
|
+
`gate` applies `.websec-ignore` exactly as `run` does: an active `fingerprint:` acknowledgement is
|
|
495
|
+
reported under `acknowledged` and does not block; an expired or reasonless one excuses nothing. A
|
|
496
|
+
finding blocks only when it names a file you asked about. One attributed to a *different*
|
|
497
|
+
repository file — some extractors read CI workflows or config manifests such as `wrangler.jsonc`
|
|
498
|
+
whatever `--only` names — is reported under `outside_scope` instead; one that names no file at all still
|
|
499
|
+
blocks, because it cannot be shown to be outside the scope.
|
|
500
|
+
|
|
494
501
|
The default threshold is **medium, not high**: command injection and SSRF on agent-written code are
|
|
495
502
|
frequently rated MEDIUM, so a HIGH default would miss the main case. `--min-confidence` filters
|
|
496
503
|
low-confidence leads for teams that measure them as noisy; there is no confidence floor by default,
|
{websec_validator-0.19.0 → websec_validator-0.19.1}/src/websec_validator.egg-info/SOURCES.txt
RENAMED
|
@@ -159,6 +159,7 @@ tests/test_formats.py
|
|
|
159
159
|
tests/test_fp_sources.py
|
|
160
160
|
tests/test_gate_and_bypass_record.py
|
|
161
161
|
tests/test_gate_command.py
|
|
162
|
+
tests/test_gate_policy_and_scope.py
|
|
162
163
|
tests/test_gitleaks_worktree.py
|
|
163
164
|
tests/test_graph_enrich.py
|
|
164
165
|
tests/test_hardening.py
|
|
@@ -142,6 +142,72 @@ class CoverageTests(unittest.TestCase):
|
|
|
142
142
|
self.assertEqual(len(external), 1)
|
|
143
143
|
self.assertNotEqual(inputs[external[0]], expected)
|
|
144
144
|
|
|
145
|
+
def test_oversized_implicit_graph_is_disclosed_without_failing_execution(self):
|
|
146
|
+
graph = self.repo / 'graphify-out' / 'graph.json'
|
|
147
|
+
graph.parent.mkdir()
|
|
148
|
+
graph.write_text(json.dumps({'nodes': [], 'padding': 'x' * 2_000_001}))
|
|
149
|
+
self.assertEqual(self.run_cli('--require-complete', '--fail-on', 'low'), 0)
|
|
150
|
+
cov = self.latest('coverage.json')
|
|
151
|
+
self.assertTrue(cov['execution_complete'])
|
|
152
|
+
self.assertEqual(coverage.execution_errors(cov), [])
|
|
153
|
+
self.assertEqual(cov['files']['oversized'], [])
|
|
154
|
+
self.assertTrue(any(g['kind'] == 'oversized' and not g['execution']
|
|
155
|
+
and 'graphify-out/graph.json' in g['detail'] for g in cov['gaps']))
|
|
156
|
+
self.assertFalse(self.latest('findings-ledger.json')['graph_enrichment']['available'])
|
|
157
|
+
self.assertTrue((self.out / 'latest').exists())
|
|
158
|
+
|
|
159
|
+
def test_oversized_explicit_graph_still_fails_requested_execution(self):
|
|
160
|
+
graph = self.base / 'graph.json'
|
|
161
|
+
graph.write_text(json.dumps({'nodes': [], 'padding': 'x' * 2_000_001}))
|
|
162
|
+
self.assertEqual(self.run_cli('--graph', str(graph), '--require-complete'), 3)
|
|
163
|
+
cov = self.latest('coverage.json')
|
|
164
|
+
self.assertFalse(cov['execution_complete'])
|
|
165
|
+
self.assertTrue(coverage.execution_errors(cov))
|
|
166
|
+
self.assertTrue(cov['files']['oversized'])
|
|
167
|
+
self.assertFalse((self.out / 'latest').exists())
|
|
168
|
+
|
|
169
|
+
def test_invalid_graph_is_optional_only_when_implicitly_selected(self):
|
|
170
|
+
graph = self.repo / 'graphify-out' / 'graph.json'
|
|
171
|
+
graph.parent.mkdir()
|
|
172
|
+
graph.write_text('{invalid')
|
|
173
|
+
self.assertEqual(self.run_cli('--require-complete'), 0)
|
|
174
|
+
self.assertEqual(coverage.execution_errors(self.latest('coverage.json')), [])
|
|
175
|
+
self.assertEqual(self.run_cli('--graph', str(graph), '--require-complete'), 3)
|
|
176
|
+
|
|
177
|
+
def test_unreadable_implicit_graph_does_not_mask_source_read_loss(self):
|
|
178
|
+
graph = self.repo / 'graphify-out' / 'graph.json'
|
|
179
|
+
graph.parent.mkdir()
|
|
180
|
+
graph.write_text('{"nodes": []}')
|
|
181
|
+
original = RepoContext.text
|
|
182
|
+
|
|
183
|
+
def unreadable(ctx, path, *args, **kwargs):
|
|
184
|
+
if Path(path).name == 'graph.json':
|
|
185
|
+
ctx.unreadable.append('graphify-out/graph.json')
|
|
186
|
+
return ''
|
|
187
|
+
return original(ctx, path, *args, **kwargs)
|
|
188
|
+
|
|
189
|
+
with patch.object(RepoContext, 'text', unreadable):
|
|
190
|
+
self.assertEqual(self.run_cli('--require-complete'), 0)
|
|
191
|
+
self.assertEqual(coverage.execution_errors(self.latest('coverage.json')), [])
|
|
192
|
+
(self.repo / 'app.py').write_text('x' * 2_000_001)
|
|
193
|
+
self.assertEqual(self.run_cli('--require-complete'), 3)
|
|
194
|
+
self.assertIn('app.py', self.latest('coverage.json')['files']['oversized'])
|
|
195
|
+
|
|
196
|
+
def test_oversized_implicit_graph_with_empty_git_diff_passes(self):
|
|
197
|
+
import os
|
|
198
|
+
import subprocess
|
|
199
|
+
with patch.dict(os.environ, {'GIT_CONFIG_GLOBAL': os.devnull, 'GIT_CONFIG_SYSTEM': os.devnull}):
|
|
200
|
+
for args in (['init', '-q'], ['config', 'user.name', 'synthetic'],
|
|
201
|
+
['config', 'user.email', 'test@example.invalid'],
|
|
202
|
+
['config', 'core.hooksPath', '.git/hooks'],
|
|
203
|
+
['add', 'app.py'], ['commit', '-qm', 'fixture']):
|
|
204
|
+
subprocess.run(['git', '-C', str(self.repo), *args], check=True, capture_output=True)
|
|
205
|
+
graph = self.repo / 'graphify-out' / 'graph.json'
|
|
206
|
+
graph.parent.mkdir()
|
|
207
|
+
graph.write_text(json.dumps({'nodes': [], 'padding': 'x' * 2_000_001}))
|
|
208
|
+
self.assertEqual(self.run_cli('--diff', 'HEAD', '--fail-on', 'low'), 0)
|
|
209
|
+
self.assertEqual(coverage.execution_errors(self.latest('coverage.json')), [])
|
|
210
|
+
|
|
145
211
|
def test_scanner_semantic_identity_fields_survive_summary(self):
|
|
146
212
|
path = self.base / 'semgrep.json'
|
|
147
213
|
path.write_text(json.dumps({'results':[{'check_id':'rules.ssrf','path':'app.py',
|