Skip to content

Phase 1+2: offline pytest suites for 5 pure-logic tools + bcrypt fix (89 tests) - #5

Merged
Santhosh595 merged 2 commits into
mainfrom
upgrade/phase1-credibility
Nov 6, 2026
Merged

Santhosh595 merged 2 commits into
mainfrom
upgrade/phase1-credibility

Conversation

@Santhosh595

Copy link
Copy Markdown
Owner

Phase 1 (audit/verify) + Phase 2 (offline tests) for SecureNET-Toolkit.

Phase 1 — verified, no behavior change

  • Zero tracked artifacts (*.db, .venv, __pycache__, logs): clean.
  • CI green: SHA-pinned Actions, Py 3.10/3.11/3.12.
  • Mutation probe on the 26 pre-existing CI tests: breaking detector thresholds fails 3 tests → tests bite.
  • No root pyproject.toml / requirements.txt by design (monorepo of standalone tools, 17 per-tool requirements.txt with >= floors are correct). Nothing forced.

Phase 2 — five new offline pytest suites (no network, no display)

Suite Covers Tests
HeaderScan/test_analyzer.py 10 pure header checkers, HEADER_WEIGHTS=100, _compute_grade A≥90/B≥75/C≥50/F, URL normalization 21
JWTInspect/tests/test_parser.py parse_jwt( plus related (valid/expired/alg:none/malformed/Bearer) 14
HashDetect/test_detector.py detect_hash, regex HASH_TYPES (MD5/SHA-1/SHA-256/SHA-512/bcrypt) 9
PortMap/test_scanner.py get_service_name, get_risk, is_private_ip 10
DNSAudit/test_scorer.py score_audit, caps (Zone Transfer→F, no SPF+DKIM+DMARC→D, takeover→C) 10

Real bug fixed by the new suite: HashDetect/detector.py detect_hash() matched bcrypt/argon2 against the lowercased value and gated on hex/base64, so $2b$12$... always returned "Input is not valid hex or base64" — bcrypt could never be identified. Now matches raw input before the gate.

CI (.github/workflows/ci.yml): header updated (was "Two of them have real pytest suites" — stale), and the Run step now executes all 7 suites (89 tests: 65 + 24, 89 passed locally). HeaderScan/test.yml is a manual workflow, not a test; APIGuard/tests/ are OWASP definitions, not pytest — both still excluded, as before.

Next (Phase 3, follow-up PR): cross-tool correlation verdict module (one explainable risk verdict per target across tools).

…WTInspect, HashDetect, PortMap, DNSAudit) + bcrypt/argon2 fix; CI now runs 89 tests (was 26)

HashDetect: detect_hash matched bcrypt/argon2 against lowercased value and gated on hex/base64, so $2b$12$... always returned 'not valid hex or base64'. Now matches raw input before the gate.

CI header updated (was 'Two of them have real pytest suites'). No root pyproject/requirements by design (monorepo of standalone tools, per-tool requirements.txt are the design).
@Santhosh595
Santhosh595 merged commit d329e35 into main Nov 6, 2026
3 checks passed
@Santhosh595
Santhosh595 deleted the upgrade/phase1-credibility branch November 6, 2026 21:26
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