haris 0.8.0__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.
- haris-0.8.0/LICENSE +21 -0
- haris-0.8.0/PKG-INFO +204 -0
- haris-0.8.0/README.md +163 -0
- haris-0.8.0/pyproject.toml +142 -0
- haris-0.8.0/setup.cfg +4 -0
- haris-0.8.0/src/haris/__init__.py +6 -0
- haris-0.8.0/src/haris/__main__.py +5 -0
- haris-0.8.0/src/haris/agent/__init__.py +21 -0
- haris-0.8.0/src/haris/agent/audit.py +67 -0
- haris-0.8.0/src/haris/agent/budget.py +52 -0
- haris-0.8.0/src/haris/agent/coordinator.py +253 -0
- haris-0.8.0/src/haris/agent/docker_runtime.py +403 -0
- haris-0.8.0/src/haris/agent/guardrails.py +176 -0
- haris-0.8.0/src/haris/agent/models.py +43 -0
- haris-0.8.0/src/haris/agent/policy.py +127 -0
- haris-0.8.0/src/haris/agent/prompts.py +17 -0
- haris-0.8.0/src/haris/agent/proxy.py +309 -0
- haris-0.8.0/src/haris/agent/proxy_auth.py +26 -0
- haris-0.8.0/src/haris/agent/runtime.py +133 -0
- haris-0.8.0/src/haris/agent/settings.py +45 -0
- haris-0.8.0/src/haris/agent/stages.py +5 -0
- haris-0.8.0/src/haris/agent/turn.py +118 -0
- haris-0.8.0/src/haris/agent/validator.py +138 -0
- haris-0.8.0/src/haris/ai_security/__init__.py +3 -0
- haris-0.8.0/src/haris/ai_security/active.py +294 -0
- haris-0.8.0/src/haris/ai_security/adapters.py +151 -0
- haris-0.8.0/src/haris/ai_security/body_validators.py +174 -0
- haris-0.8.0/src/haris/ai_security/bundles.py +47 -0
- haris-0.8.0/src/haris/ai_security/discovery.py +94 -0
- haris-0.8.0/src/haris/ai_security/findings.py +81 -0
- haris-0.8.0/src/haris/ai_security/mcp_probe.py +133 -0
- haris-0.8.0/src/haris/ai_security/mcp_static.py +169 -0
- haris-0.8.0/src/haris/ai_security/options.py +37 -0
- haris-0.8.0/src/haris/ai_security/owasp_ai.py +86 -0
- haris-0.8.0/src/haris/ai_security/passive.py +275 -0
- haris-0.8.0/src/haris/ai_security/probes.py +82 -0
- haris-0.8.0/src/haris/ai_security/rpc.py +64 -0
- haris-0.8.0/src/haris/ai_security/scanner.py +68 -0
- haris-0.8.0/src/haris/ai_security/signatures.py +67 -0
- haris-0.8.0/src/haris/auth/__init__.py +0 -0
- haris-0.8.0/src/haris/auth/api_tokens.py +63 -0
- haris-0.8.0/src/haris/auth/audit.py +54 -0
- haris-0.8.0/src/haris/auth/bearer.py +57 -0
- haris-0.8.0/src/haris/auth/bootstrap.py +37 -0
- haris-0.8.0/src/haris/auth/config.py +87 -0
- haris-0.8.0/src/haris/auth/cookies.py +47 -0
- haris-0.8.0/src/haris/auth/csrf.py +65 -0
- haris-0.8.0/src/haris/auth/database.py +49 -0
- haris-0.8.0/src/haris/auth/email.py +100 -0
- haris-0.8.0/src/haris/auth/middleware.py +75 -0
- haris-0.8.0/src/haris/auth/models.py +104 -0
- haris-0.8.0/src/haris/auth/oidc.py +115 -0
- haris-0.8.0/src/haris/auth/public.py +16 -0
- haris-0.8.0/src/haris/auth/redirects.py +38 -0
- haris-0.8.0/src/haris/auth/security_headers.py +72 -0
- haris-0.8.0/src/haris/auth/service.py +276 -0
- haris-0.8.0/src/haris/auth/tokens.py +5 -0
- haris-0.8.0/src/haris/auth/users.py +167 -0
- haris-0.8.0/src/haris/auth/verification.py +94 -0
- haris-0.8.0/src/haris/bench/__init__.py +0 -0
- haris-0.8.0/src/haris/bench/__main__.py +49 -0
- haris-0.8.0/src/haris/bench/render.py +34 -0
- haris-0.8.0/src/haris/bench/score.py +205 -0
- haris-0.8.0/src/haris/bench/truth.py +87 -0
- haris-0.8.0/src/haris/checks/__init__.py +53 -0
- haris-0.8.0/src/haris/checks/baseline.py +268 -0
- haris-0.8.0/src/haris/checks/cache_checks.py +65 -0
- haris-0.8.0/src/haris/checks/cookie_checks.py +257 -0
- haris-0.8.0/src/haris/checks/cookie_policy.py +79 -0
- haris-0.8.0/src/haris/checks/dns_checks.py +162 -0
- haris-0.8.0/src/haris/checks/dns_wire.py +123 -0
- haris-0.8.0/src/haris/checks/findings.py +30 -0
- haris-0.8.0/src/haris/checks/graphql_checks.py +80 -0
- haris-0.8.0/src/haris/checks/header_checks.py +229 -0
- haris-0.8.0/src/haris/checks/header_policy.py +175 -0
- haris-0.8.0/src/haris/checks/info_disclosure.py +227 -0
- haris-0.8.0/src/haris/checks/info_patterns.py +142 -0
- haris-0.8.0/src/haris/checks/listing_checks.py +73 -0
- haris-0.8.0/src/haris/checks/method_checks.py +74 -0
- haris-0.8.0/src/haris/checks/misc_checks.py +237 -0
- haris-0.8.0/src/haris/checks/openapi_checks.py +65 -0
- haris-0.8.0/src/haris/checks/path_probe.py +50 -0
- haris-0.8.0/src/haris/checks/probe_scanner.py +26 -0
- haris-0.8.0/src/haris/checks/redirect_checks.py +78 -0
- haris-0.8.0/src/haris/checks/requesting.py +69 -0
- haris-0.8.0/src/haris/checks/sri_checks.py +85 -0
- haris-0.8.0/src/haris/checks/tls_checks.py +216 -0
- haris-0.8.0/src/haris/checks/tls_probe.py +150 -0
- haris-0.8.0/src/haris/checks/validators.py +173 -0
- haris-0.8.0/src/haris/cli.py +27 -0
- haris-0.8.0/src/haris/cli_handlers.py +212 -0
- haris-0.8.0/src/haris/cli_parser.py +283 -0
- haris-0.8.0/src/haris/cli_scan.py +158 -0
- haris-0.8.0/src/haris/config/__init__.py +6 -0
- haris-0.8.0/src/haris/config/loader.py +205 -0
- haris-0.8.0/src/haris/config/paths.py +14 -0
- haris-0.8.0/src/haris/core/__init__.py +64 -0
- haris-0.8.0/src/haris/core/confidence.py +76 -0
- haris-0.8.0/src/haris/core/context_extract.py +106 -0
- haris-0.8.0/src/haris/core/correlator.py +64 -0
- haris-0.8.0/src/haris/core/decorators.py +83 -0
- haris-0.8.0/src/haris/core/engine.py +398 -0
- haris-0.8.0/src/haris/core/exit_codes.py +24 -0
- haris-0.8.0/src/haris/core/identity.py +93 -0
- haris-0.8.0/src/haris/core/llm_enrichment.py +83 -0
- haris-0.8.0/src/haris/core/owasp.py +335 -0
- haris-0.8.0/src/haris/core/profiles.py +193 -0
- haris-0.8.0/src/haris/core/remediation.py +119 -0
- haris-0.8.0/src/haris/core/risk.py +221 -0
- haris-0.8.0/src/haris/core/runner.py +219 -0
- haris-0.8.0/src/haris/core/scanner.py +141 -0
- haris-0.8.0/src/haris/core/tool_vet.py +54 -0
- haris-0.8.0/src/haris/core/vuln_class.py +66 -0
- haris-0.8.0/src/haris/data/__init__.py +1 -0
- haris-0.8.0/src/haris/data/scanner_config.py +352 -0
- haris-0.8.0/src/haris/db/__init__.py +5 -0
- haris-0.8.0/src/haris/db/api_tokens.py +86 -0
- haris-0.8.0/src/haris/db/baseline.py +236 -0
- haris-0.8.0/src/haris/db/connection.py +22 -0
- haris-0.8.0/src/haris/db/findings.py +48 -0
- haris-0.8.0/src/haris/db/jobs.py +175 -0
- haris-0.8.0/src/haris/db/llm_data.py +119 -0
- haris-0.8.0/src/haris/db/migrate.py +70 -0
- haris-0.8.0/src/haris/db/migrations/0001_baseline.py +5 -0
- haris-0.8.0/src/haris/db/migrations/0002_hash_tokens.py +21 -0
- haris-0.8.0/src/haris/db/migrations/0003_finding_identity.py +77 -0
- haris-0.8.0/src/haris/db/migrations/0004_scan_owner_state.py +33 -0
- haris-0.8.0/src/haris/db/migrations/0005_api_tokens.py +30 -0
- haris-0.8.0/src/haris/db/migrations/0006_authorized_targets.py +26 -0
- haris-0.8.0/src/haris/db/migrations/0007_job_queue.py +29 -0
- haris-0.8.0/src/haris/db/migrations/0008_agent_fields.py +20 -0
- haris-0.8.0/src/haris/db/migrations/0009_llm_backend_names.py +20 -0
- haris-0.8.0/src/haris/db/scans.py +162 -0
- haris-0.8.0/src/haris/db/session_read.py +180 -0
- haris-0.8.0/src/haris/db/session_write.py +163 -0
- haris-0.8.0/src/haris/db/store.py +149 -0
- haris-0.8.0/src/haris/db/targets.py +73 -0
- haris-0.8.0/src/haris/db/template_defaults.py +144 -0
- haris-0.8.0/src/haris/db/templates.py +157 -0
- haris-0.8.0/src/haris/db/websites.py +194 -0
- haris-0.8.0/src/haris/diff.py +154 -0
- haris-0.8.0/src/haris/ignore.py +111 -0
- haris-0.8.0/src/haris/llm/__init__.py +28 -0
- haris-0.8.0/src/haris/llm/backend.py +239 -0
- haris-0.8.0/src/haris/llm/base.py +75 -0
- haris-0.8.0/src/haris/llm/budget.py +119 -0
- haris-0.8.0/src/haris/llm/correlation.py +77 -0
- haris-0.8.0/src/haris/llm/enrichment.py +117 -0
- haris-0.8.0/src/haris/llm/enrichment_prompts.py +86 -0
- haris-0.8.0/src/haris/llm/litellm_backend.py +154 -0
- haris-0.8.0/src/haris/llm/parsing.py +85 -0
- haris-0.8.0/src/haris/llm/prompts.py +253 -0
- haris-0.8.0/src/haris/llm/qa.py +249 -0
- haris-0.8.0/src/haris/llm/redaction.py +75 -0
- haris-0.8.0/src/haris/llm/retriever.py +113 -0
- haris-0.8.0/src/haris/llm/retry.py +94 -0
- haris-0.8.0/src/haris/llm/router.py +83 -0
- haris-0.8.0/src/haris/llm/schemas.py +91 -0
- haris-0.8.0/src/haris/llm/settings.py +77 -0
- haris-0.8.0/src/haris/llm/structured.py +117 -0
- haris-0.8.0/src/haris/llm/template_loader.py +47 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/assess_false_positives.j2 +22 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/enrich_finding.j2 +33 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/identify_attack_chains.j2 +23 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/suggest_variants.j2 +26 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/system.j2 +7 -0
- haris-0.8.0/src/haris/llm/templates/enrichment/triage_findings.j2 +24 -0
- haris-0.8.0/src/haris/llm/templates/qa/explain_finding.j2 +12 -0
- haris-0.8.0/src/haris/llm/templates/qa/filter_and_explain.j2 +12 -0
- haris-0.8.0/src/haris/llm/templates/qa/freeform_question.j2 +6 -0
- haris-0.8.0/src/haris/llm/templates/qa/generate_test_cases.j2 +12 -0
- haris-0.8.0/src/haris/llm/templates/qa/remediation_plan.j2 +4 -0
- haris-0.8.0/src/haris/llm/templates/qa/suggest_mitigations.j2 +12 -0
- haris-0.8.0/src/haris/llm/templates/qa/summarize_report.j2 +4 -0
- haris-0.8.0/src/haris/llm/templates/qa/system.j2 +8 -0
- haris-0.8.0/src/haris/llm/triage.py +97 -0
- haris-0.8.0/src/haris/llm/variant_analysis.py +76 -0
- haris-0.8.0/src/haris/models/__init__.py +91 -0
- haris-0.8.0/src/haris/models/chat.py +41 -0
- haris-0.8.0/src/haris/models/config.py +67 -0
- haris-0.8.0/src/haris/models/correlator.py +25 -0
- haris-0.8.0/src/haris/models/enrichment.py +69 -0
- haris-0.8.0/src/haris/models/enums.py +146 -0
- haris-0.8.0/src/haris/models/finding.py +131 -0
- haris-0.8.0/src/haris/models/llm.py +18 -0
- haris-0.8.0/src/haris/models/owasp.py +67 -0
- haris-0.8.0/src/haris/models/profiles.py +18 -0
- haris-0.8.0/src/haris/models/remediation.py +36 -0
- haris-0.8.0/src/haris/models/risk.py +12 -0
- haris-0.8.0/src/haris/models/scan_config_template.py +60 -0
- haris-0.8.0/src/haris/models/scan_context.py +80 -0
- haris-0.8.0/src/haris/models/scanner.py +34 -0
- haris-0.8.0/src/haris/models/session.py +124 -0
- haris-0.8.0/src/haris/models/target.py +230 -0
- haris-0.8.0/src/haris/models/templates.py +82 -0
- haris-0.8.0/src/haris/models/verification.py +69 -0
- haris-0.8.0/src/haris/net/__init__.py +28 -0
- haris-0.8.0/src/haris/net/egress_proxy.py +199 -0
- haris-0.8.0/src/haris/net/errors.py +18 -0
- haris-0.8.0/src/haris/net/policy.py +22 -0
- haris-0.8.0/src/haris/net/ratelimit.py +53 -0
- haris-0.8.0/src/haris/net/redact.py +16 -0
- haris-0.8.0/src/haris/net/requestlog.py +76 -0
- haris-0.8.0/src/haris/net/retry.py +20 -0
- haris-0.8.0/src/haris/net/scoped_client.py +353 -0
- haris-0.8.0/src/haris/net/ssrf.py +86 -0
- haris-0.8.0/src/haris/net/transport.py +108 -0
- haris-0.8.0/src/haris/reporting/__init__.py +65 -0
- haris-0.8.0/src/haris/reporting/base.py +28 -0
- haris-0.8.0/src/haris/reporting/csv_report.py +59 -0
- haris-0.8.0/src/haris/reporting/escape.py +43 -0
- haris-0.8.0/src/haris/reporting/findings.py +33 -0
- haris-0.8.0/src/haris/reporting/html_report.py +126 -0
- haris-0.8.0/src/haris/reporting/json_report.py +48 -0
- haris-0.8.0/src/haris/reporting/junit_report.py +66 -0
- haris-0.8.0/src/haris/reporting/markdown_report.py +239 -0
- haris-0.8.0/src/haris/reporting/report_schema.py +93 -0
- haris-0.8.0/src/haris/reporting/sarif_report.py +196 -0
- haris-0.8.0/src/haris/resources/__init__.py +0 -0
- haris-0.8.0/src/haris/resources/config/agent.yaml +24 -0
- haris-0.8.0/src/haris/resources/config/ai_mappings.yaml +221 -0
- haris-0.8.0/src/haris/resources/config/ai_probes.yaml +47 -0
- haris-0.8.0/src/haris/resources/config/ai_signatures.yaml +168 -0
- haris-0.8.0/src/haris/resources/config/confidence.yaml +73 -0
- haris-0.8.0/src/haris/resources/config/default_config.yaml +161 -0
- haris-0.8.0/src/haris/resources/config/llm_models.yaml +34 -0
- haris-0.8.0/src/haris/resources/config/scanner_data.yaml +43 -0
- haris-0.8.0/src/haris/resources/config/scanners/garak.yaml +14 -0
- haris-0.8.0/src/haris/resources/config/scanners/nikto.yaml +116 -0
- haris-0.8.0/src/haris/resources/config/scanners/nmap.yaml +48 -0
- haris-0.8.0/src/haris/resources/config/scanners/nuclei.yaml +354 -0
- haris-0.8.0/src/haris/resources/config/scanners/promptfoo.yaml +23 -0
- haris-0.8.0/src/haris/resources/config/scanners/sslyze.yaml +64 -0
- haris-0.8.0/src/haris/resources/config/scanners/wapiti.yaml +83 -0
- haris-0.8.0/src/haris/resources/config/scanners/zap.yaml +22 -0
- haris-0.8.0/src/haris/resources/config/verify.yaml +87 -0
- haris-0.8.0/src/haris/resources/config/vuln_classes.yaml +364 -0
- haris-0.8.0/src/haris/resources/schema/report.schema.json +683 -0
- haris-0.8.0/src/haris/scan_files.py +30 -0
- haris-0.8.0/src/haris/scanners/__init__.py +45 -0
- haris-0.8.0/src/haris/scanners/argv_policy.py +47 -0
- haris-0.8.0/src/haris/scanners/base.py +117 -0
- haris-0.8.0/src/haris/scanners/garak_scanner.py +182 -0
- haris-0.8.0/src/haris/scanners/nikto_scanner.py +276 -0
- haris-0.8.0/src/haris/scanners/nmap_scanner.py +274 -0
- haris-0.8.0/src/haris/scanners/nuclei_argv.py +148 -0
- haris-0.8.0/src/haris/scanners/nuclei_results.py +195 -0
- haris-0.8.0/src/haris/scanners/nuclei_scanner.py +435 -0
- haris-0.8.0/src/haris/scanners/nuclei_selection.py +171 -0
- haris-0.8.0/src/haris/scanners/nuclei_templates.py +26 -0
- haris-0.8.0/src/haris/scanners/nuclei_urls.py +62 -0
- haris-0.8.0/src/haris/scanners/option_policy.py +246 -0
- haris-0.8.0/src/haris/scanners/option_values.py +77 -0
- haris-0.8.0/src/haris/scanners/process.py +60 -0
- haris-0.8.0/src/haris/scanners/promptfoo_scanner.py +246 -0
- haris-0.8.0/src/haris/scanners/redaction.py +66 -0
- haris-0.8.0/src/haris/scanners/sslyze_scanner.py +262 -0
- haris-0.8.0/src/haris/scanners/wapiti_exclude.py +27 -0
- haris-0.8.0/src/haris/scanners/wapiti_scanner.py +274 -0
- haris-0.8.0/src/haris/scanners/wapiti_seed.py +18 -0
- haris-0.8.0/src/haris/scanners/wapiti_session.py +104 -0
- haris-0.8.0/src/haris/scanners/zap_plan.py +155 -0
- haris-0.8.0/src/haris/scanners/zap_scanner.py +243 -0
- haris-0.8.0/src/haris/templates/__init__.py +9 -0
- haris-0.8.0/src/haris/templates/adapters.py +336 -0
- haris-0.8.0/src/haris/templates/manager.py +174 -0
- haris-0.8.0/src/haris/templates/report.py +49 -0
- haris-0.8.0/src/haris/templates/updater.py +201 -0
- haris-0.8.0/src/haris/verify/__init__.py +15 -0
- haris-0.8.0/src/haris/verify/evidence.py +41 -0
- haris-0.8.0/src/haris/verify/llm_verdict.py +172 -0
- haris-0.8.0/src/haris/verify/oracles.py +165 -0
- haris-0.8.0/src/haris/verify/oracles_active.py +189 -0
- haris-0.8.0/src/haris/verify/oracles_baseline.py +84 -0
- haris-0.8.0/src/haris/verify/pipeline.py +66 -0
- haris-0.8.0/src/haris/verify/probe.py +128 -0
- haris-0.8.0/src/haris/verify/registry.py +42 -0
- haris-0.8.0/src/haris/verify/replay.py +144 -0
- haris-0.8.0/src/haris/verify/settings.py +84 -0
- haris-0.8.0/src/haris/verify/timing.py +72 -0
- haris-0.8.0/src/haris/verify/verdict_prompt.py +77 -0
- haris-0.8.0/src/haris/web/__init__.py +1 -0
- haris-0.8.0/src/haris/web/access.py +64 -0
- haris-0.8.0/src/haris/web/agent_gate.py +158 -0
- haris-0.8.0/src/haris/web/app.py +107 -0
- haris-0.8.0/src/haris/web/conversations.py +51 -0
- haris-0.8.0/src/haris/web/job_queue.py +148 -0
- haris-0.8.0/src/haris/web/llm_support.py +102 -0
- haris-0.8.0/src/haris/web/logging_setup.py +23 -0
- haris-0.8.0/src/haris/web/page_data.py +19 -0
- haris-0.8.0/src/haris/web/routers/__init__.py +43 -0
- haris-0.8.0/src/haris/web/routers/account.py +88 -0
- haris-0.8.0/src/haris/web/routers/admin.py +153 -0
- haris-0.8.0/src/haris/web/routers/admin_api.py +15 -0
- haris-0.8.0/src/haris/web/routers/auth_login.py +309 -0
- haris-0.8.0/src/haris/web/routers/health.py +8 -0
- haris-0.8.0/src/haris/web/routers/llm_chat.py +164 -0
- haris-0.8.0/src/haris/web/routers/llm_scan.py +96 -0
- haris-0.8.0/src/haris/web/routers/oidc.py +76 -0
- haris-0.8.0/src/haris/web/routers/pages.py +152 -0
- haris-0.8.0/src/haris/web/routers/scan_data.py +92 -0
- haris-0.8.0/src/haris/web/routers/scan_templates.py +106 -0
- haris-0.8.0/src/haris/web/routers/scans.py +93 -0
- haris-0.8.0/src/haris/web/routers/scans_api.py +336 -0
- haris-0.8.0/src/haris/web/routers/targets.py +85 -0
- haris-0.8.0/src/haris/web/routers/templates_api.py +228 -0
- haris-0.8.0/src/haris/web/routers/tokens.py +78 -0
- haris-0.8.0/src/haris/web/routers/websites.py +58 -0
- haris-0.8.0/src/haris/web/routers/websites_api.py +50 -0
- haris-0.8.0/src/haris/web/routing.py +80 -0
- haris-0.8.0/src/haris/web/scan_runtime.py +169 -0
- haris-0.8.0/src/haris/web/scanner_info.py +32 -0
- haris-0.8.0/src/haris/web/schemas/__init__.py +0 -0
- haris-0.8.0/src/haris/web/schemas/access.py +46 -0
- haris-0.8.0/src/haris/web/schemas/llm.py +101 -0
- haris-0.8.0/src/haris/web/schemas/scans.py +58 -0
- haris-0.8.0/src/haris/web/schemas/sites.py +77 -0
- haris-0.8.0/src/haris/web/settings.py +46 -0
- haris-0.8.0/src/haris/web/state.py +40 -0
- haris-0.8.0/src/haris/web/static/css/findings.css +248 -0
- haris-0.8.0/src/haris/web/static/css/fonts.css +28 -0
- haris-0.8.0/src/haris/web/static/css/layout.css +241 -0
- haris-0.8.0/src/haris/web/static/css/pages.css +220 -0
- haris-0.8.0/src/haris/web/static/css/template_form.css +54 -0
- haris-0.8.0/src/haris/web/static/favicon.svg +4 -0
- haris-0.8.0/src/haris/web/static/haris_logo.png +0 -0
- haris-0.8.0/src/haris/web/static/js/dashboard.js +12 -0
- haris-0.8.0/src/haris/web/static/js/login.js +4 -0
- haris-0.8.0/src/haris/web/static/js/password_form.js +25 -0
- haris-0.8.0/src/haris/web/static/js/profile.js +16 -0
- haris-0.8.0/src/haris/web/static/js/reload.js +1 -0
- haris-0.8.0/src/haris/web/static/js/scan_detail.js +161 -0
- haris-0.8.0/src/haris/web/static/js/scan_new.js +97 -0
- haris-0.8.0/src/haris/web/static/js/scans.js +8 -0
- haris-0.8.0/src/haris/web/static/js/template_form.js +303 -0
- haris-0.8.0/src/haris/web/static/js/templates_page.js +102 -0
- haris-0.8.0/src/haris/web/static/js/users.js +44 -0
- haris-0.8.0/src/haris/web/static/js/website_detail.js +98 -0
- haris-0.8.0/src/haris/web/static/main.js +135 -0
- haris-0.8.0/src/haris/web/static/style.css +335 -0
- haris-0.8.0/src/haris/web/static/theme-init.js +4 -0
- haris-0.8.0/src/haris/web/static/vendor/LICENSE.chartjs +9 -0
- haris-0.8.0/src/haris/web/static/vendor/LICENSE.dompurify +202 -0
- haris-0.8.0/src/haris/web/static/vendor/LICENSE.htmx +13 -0
- haris-0.8.0/src/haris/web/static/vendor/LICENSE.inter +93 -0
- haris-0.8.0/src/haris/web/static/vendor/LICENSE.marked +44 -0
- haris-0.8.0/src/haris/web/static/vendor/README +32 -0
- haris-0.8.0/src/haris/web/static/vendor/chart.umd.min.js +14 -0
- haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-400-normal.woff2 +0 -0
- haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-500-normal.woff2 +0 -0
- haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-600-normal.woff2 +0 -0
- haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-700-normal.woff2 +0 -0
- haris-0.8.0/src/haris/web/static/vendor/htmx.min.js +1 -0
- haris-0.8.0/src/haris/web/static/vendor/marked.umd.js +86 -0
- haris-0.8.0/src/haris/web/static/vendor/purify.min.js +7 -0
- haris-0.8.0/src/haris/web/targets.py +190 -0
- haris-0.8.0/src/haris/web/templates/_scan_rows.html +43 -0
- haris-0.8.0/src/haris/web/templates/auth/audit_log.html +107 -0
- haris-0.8.0/src/haris/web/templates/auth/login.html +101 -0
- haris-0.8.0/src/haris/web/templates/auth/profile.html +165 -0
- haris-0.8.0/src/haris/web/templates/auth/register.html +85 -0
- haris-0.8.0/src/haris/web/templates/auth/setup.html +88 -0
- haris-0.8.0/src/haris/web/templates/auth/users.html +155 -0
- haris-0.8.0/src/haris/web/templates/auth/verify_email.html +54 -0
- haris-0.8.0/src/haris/web/templates/base.html +121 -0
- haris-0.8.0/src/haris/web/templates/dashboard.html +113 -0
- haris-0.8.0/src/haris/web/templates/licenses.html +82 -0
- haris-0.8.0/src/haris/web/templates/partials/scan_ai_insights.html +82 -0
- haris-0.8.0/src/haris/web/templates/partials/template_form_scanners_b.html +198 -0
- haris-0.8.0/src/haris/web/templates/scan_detail.html +332 -0
- haris-0.8.0/src/haris/web/templates/scan_new.html +147 -0
- haris-0.8.0/src/haris/web/templates/scans.html +89 -0
- haris-0.8.0/src/haris/web/templates/settings.html +56 -0
- haris-0.8.0/src/haris/web/templates/template_form.html +321 -0
- haris-0.8.0/src/haris/web/templates/templates.html +190 -0
- haris-0.8.0/src/haris/web/templates/website_detail.html +111 -0
- haris-0.8.0/src/haris/web/templates/websites.html +42 -0
- haris-0.8.0/src/haris/web/templating.py +38 -0
- haris-0.8.0/src/haris.egg-info/PKG-INFO +204 -0
- haris-0.8.0/src/haris.egg-info/SOURCES.txt +541 -0
- haris-0.8.0/src/haris.egg-info/dependency_links.txt +1 -0
- haris-0.8.0/src/haris.egg-info/entry_points.txt +2 -0
- haris-0.8.0/src/haris.egg-info/requires.txt +25 -0
- haris-0.8.0/src/haris.egg-info/top_level.txt +1 -0
- haris-0.8.0/tests/test_agent_budget.py +183 -0
- haris-0.8.0/tests/test_agent_docker.py +194 -0
- haris-0.8.0/tests/test_agent_fields.py +102 -0
- haris-0.8.0/tests/test_agent_guardrails.py +137 -0
- haris-0.8.0/tests/test_agent_injection.py +110 -0
- haris-0.8.0/tests/test_agent_policy.py +153 -0
- haris-0.8.0/tests/test_agent_post_reexec.py +277 -0
- haris-0.8.0/tests/test_agent_proxy.py +245 -0
- haris-0.8.0/tests/test_agent_runtime.py +60 -0
- haris-0.8.0/tests/test_agent_sandbox_probe.py +48 -0
- haris-0.8.0/tests/test_agent_stage.py +89 -0
- haris-0.8.0/tests/test_agent_tunnel.py +44 -0
- haris-0.8.0/tests/test_agent_validator.py +208 -0
- haris-0.8.0/tests/test_ai_active.py +325 -0
- haris-0.8.0/tests/test_ai_adapter_gate.py +46 -0
- haris-0.8.0/tests/test_ai_adapter_preflight.py +157 -0
- haris-0.8.0/tests/test_ai_classes.py +33 -0
- haris-0.8.0/tests/test_ai_cli.py +79 -0
- haris-0.8.0/tests/test_ai_discovery.py +127 -0
- haris-0.8.0/tests/test_ai_garak.py +169 -0
- haris-0.8.0/tests/test_ai_mcp.py +245 -0
- haris-0.8.0/tests/test_ai_owasp.py +130 -0
- haris-0.8.0/tests/test_ai_passive.py +197 -0
- haris-0.8.0/tests/test_ai_promptfoo.py +199 -0
- haris-0.8.0/tests/test_ai_sse.py +48 -0
- haris-0.8.0/tests/test_auth_email.py +350 -0
- haris-0.8.0/tests/test_auth_fixes.py +181 -0
- haris-0.8.0/tests/test_auth_oidc.py +186 -0
- haris-0.8.0/tests/test_auth_service.py +570 -0
- haris-0.8.0/tests/test_bench_callback.py +213 -0
- haris-0.8.0/tests/test_bench_fixtures.py +175 -0
- haris-0.8.0/tests/test_bench_ground_truth.py +198 -0
- haris-0.8.0/tests/test_bench_in_image.py +43 -0
- haris-0.8.0/tests/test_bench_login.py +310 -0
- haris-0.8.0/tests/test_bench_run.py +227 -0
- haris-0.8.0/tests/test_bench_scanner_args.py +113 -0
- haris-0.8.0/tests/test_bench_score.py +418 -0
- haris-0.8.0/tests/test_calibrate_abstain.py +306 -0
- haris-0.8.0/tests/test_chat.py +163 -0
- haris-0.8.0/tests/test_check_litellm.py +81 -0
- haris-0.8.0/tests/test_checks_baseline.py +278 -0
- haris-0.8.0/tests/test_checks_cookies.py +187 -0
- haris-0.8.0/tests/test_checks_dns.py +145 -0
- haris-0.8.0/tests/test_checks_exposure.py +151 -0
- haris-0.8.0/tests/test_checks_headers.py +205 -0
- haris-0.8.0/tests/test_checks_info.py +173 -0
- haris-0.8.0/tests/test_checks_probes.py +229 -0
- haris-0.8.0/tests/test_checks_registry.py +78 -0
- haris-0.8.0/tests/test_checks_tls.py +128 -0
- haris-0.8.0/tests/test_cli_exit.py +146 -0
- haris-0.8.0/tests/test_cli_web.py +24 -0
- haris-0.8.0/tests/test_config_paths.py +24 -0
- haris-0.8.0/tests/test_config_scope.py +14 -0
- haris-0.8.0/tests/test_correlator.py +146 -0
- haris-0.8.0/tests/test_db.py +333 -0
- haris-0.8.0/tests/test_db_identity.py +160 -0
- haris-0.8.0/tests/test_db_jobs.py +98 -0
- haris-0.8.0/tests/test_db_ownership.py +104 -0
- haris-0.8.0/tests/test_db_rollback.py +70 -0
- haris-0.8.0/tests/test_db_scope.py +96 -0
- haris-0.8.0/tests/test_docker_exec.py +149 -0
- haris-0.8.0/tests/test_egress_proxy.py +248 -0
- haris-0.8.0/tests/test_engine.py +453 -0
- haris-0.8.0/tests/test_engine_egress.py +82 -0
- haris-0.8.0/tests/test_engine_pipeline.py +293 -0
- haris-0.8.0/tests/test_enrichment.py +344 -0
- haris-0.8.0/tests/test_excluded_paths_syntax.py +55 -0
- haris-0.8.0/tests/test_finding.py +189 -0
- haris-0.8.0/tests/test_identity.py +177 -0
- haris-0.8.0/tests/test_ignore_diff.py +252 -0
- haris-0.8.0/tests/test_image_security.py +32 -0
- haris-0.8.0/tests/test_l6_jsonrpc.py +8 -0
- haris-0.8.0/tests/test_litellm_backend.py +392 -0
- haris-0.8.0/tests/test_llm.py +236 -0
- haris-0.8.0/tests/test_llm_backend_names.py +150 -0
- haris-0.8.0/tests/test_llm_budget.py +155 -0
- haris-0.8.0/tests/test_llm_injection.py +142 -0
- haris-0.8.0/tests/test_llm_parsing.py +93 -0
- haris-0.8.0/tests/test_llm_pricing.py +68 -0
- haris-0.8.0/tests/test_llm_redaction.py +98 -0
- haris-0.8.0/tests/test_llm_retry.py +102 -0
- haris-0.8.0/tests/test_llm_settings.py +47 -0
- haris-0.8.0/tests/test_migration_llm_backend_names.py +123 -0
- haris-0.8.0/tests/test_migrations.py +148 -0
- haris-0.8.0/tests/test_nikto_interesting_path.py +131 -0
- haris-0.8.0/tests/test_no_provider_key_names.py +17 -0
- haris-0.8.0/tests/test_nuclei_argv_golden.py +242 -0
- haris-0.8.0/tests/test_nuclei_groups.py +369 -0
- haris-0.8.0/tests/test_nuclei_phase2_bound.py +175 -0
- haris-0.8.0/tests/test_nuclei_phases.py +351 -0
- haris-0.8.0/tests/test_nuclei_scanner.py +694 -0
- haris-0.8.0/tests/test_nuclei_selection.py +279 -0
- haris-0.8.0/tests/test_option_policy.py +159 -0
- haris-0.8.0/tests/test_owasp.py +72 -0
- haris-0.8.0/tests/test_owasp_class_coverage.py +110 -0
- haris-0.8.0/tests/test_profiles.py +40 -0
- haris-0.8.0/tests/test_ratelimit.py +50 -0
- haris-0.8.0/tests/test_remediation.py +101 -0
- haris-0.8.0/tests/test_report_escape.py +132 -0
- haris-0.8.0/tests/test_report_integrations.py +23 -0
- haris-0.8.0/tests/test_report_sarif.py +97 -0
- haris-0.8.0/tests/test_report_schema.py +73 -0
- haris-0.8.0/tests/test_report_tabular.py +75 -0
- haris-0.8.0/tests/test_reporting.py +165 -0
- haris-0.8.0/tests/test_retriever.py +360 -0
- haris-0.8.0/tests/test_risk.py +104 -0
- haris-0.8.0/tests/test_router.py +170 -0
- haris-0.8.0/tests/test_runner.py +194 -0
- haris-0.8.0/tests/test_scan_config_templates.py +613 -0
- haris-0.8.0/tests/test_scan_context.py +106 -0
- haris-0.8.0/tests/test_scanner_binding.py +318 -0
- haris-0.8.0/tests/test_scanner_config.py +68 -0
- haris-0.8.0/tests/test_scanner_golden.py +369 -0
- haris-0.8.0/tests/test_scanner_rate_flags.py +210 -0
- haris-0.8.0/tests/test_scanner_runtime.py +272 -0
- haris-0.8.0/tests/test_scanner_status.py +182 -0
- haris-0.8.0/tests/test_schema_v6.py +225 -0
- haris-0.8.0/tests/test_scoped_client.py +362 -0
- haris-0.8.0/tests/test_scoped_stream.py +197 -0
- haris-0.8.0/tests/test_session_revoke.py +32 -0
- haris-0.8.0/tests/test_sslyze_applicability.py +145 -0
- haris-0.8.0/tests/test_ssrf.py +151 -0
- haris-0.8.0/tests/test_target.py +174 -0
- haris-0.8.0/tests/test_templates.py +543 -0
- haris-0.8.0/tests/test_tool_vet.py +67 -0
- haris-0.8.0/tests/test_verify_baseline_oracles.py +249 -0
- haris-0.8.0/tests/test_verify_llm.py +425 -0
- haris-0.8.0/tests/test_verify_oracles.py +301 -0
- haris-0.8.0/tests/test_verify_oracles_active.py +268 -0
- haris-0.8.0/tests/test_verify_pipeline.py +207 -0
- haris-0.8.0/tests/test_verify_redirect_catch_all.py +43 -0
- haris-0.8.0/tests/test_verify_replay_fields.py +182 -0
- haris-0.8.0/tests/test_verify_replay_multi.py +130 -0
- haris-0.8.0/tests/test_verify_unclassified_external.py +124 -0
- haris-0.8.0/tests/test_verify_uncommon_header.py +93 -0
- haris-0.8.0/tests/test_verify_wapiti_oracles.py +173 -0
- haris-0.8.0/tests/test_vuln_class_external_aliases.py +178 -0
- haris-0.8.0/tests/test_vuln_class_wapiti.py +75 -0
- haris-0.8.0/tests/test_wapiti_argv.py +161 -0
- haris-0.8.0/tests/test_wapiti_seed.py +56 -0
- haris-0.8.0/tests/test_wapiti_session.py +216 -0
- haris-0.8.0/tests/test_web_agent.py +283 -0
- haris-0.8.0/tests/test_web_agent_gate_audit.py +146 -0
- haris-0.8.0/tests/test_web_auth_fixes.py +386 -0
- haris-0.8.0/tests/test_web_csrf.py +236 -0
- haris-0.8.0/tests/test_web_env.py +277 -0
- haris-0.8.0/tests/test_web_execute.py +172 -0
- haris-0.8.0/tests/test_web_llm.py +197 -0
- haris-0.8.0/tests/test_web_llm_config.py +331 -0
- haris-0.8.0/tests/test_web_ownership.py +249 -0
- haris-0.8.0/tests/test_web_proofs.py +250 -0
- haris-0.8.0/tests/test_web_queue.py +294 -0
- haris-0.8.0/tests/test_web_routes.py +246 -0
- haris-0.8.0/tests/test_web_scanner_options.py +123 -0
- haris-0.8.0/tests/test_web_targets.py +140 -0
- haris-0.8.0/tests/test_web_templates.py +294 -0
- haris-0.8.0/tests/test_web_tokens.py +338 -0
- haris-0.8.0/tests/test_web_verify.py +171 -0
- haris-0.8.0/tests/test_zap_scanner.py +315 -0
haris-0.8.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 HARIS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
haris-0.8.0/PKG-INFO
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: haris
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: Black-box web application security audit framework
|
|
5
|
+
Author: HARIS contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: security,audit,pentest,owasp,vulnerability-scanner
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Intended Audience :: Information Technology
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Topic :: Security
|
|
16
|
+
Requires-Python: >=3.13
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: pydantic>=2.14.3
|
|
20
|
+
Requires-Dist: requests>=2.34.2
|
|
21
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
22
|
+
Requires-Dist: jinja2>=3.1.6
|
|
23
|
+
Requires-Dist: bcrypt>=5.0.0
|
|
24
|
+
Requires-Dist: starlette>=1.10.0
|
|
25
|
+
Requires-Dist: yoyo-migrations>=9.0.0
|
|
26
|
+
Provides-Extra: web
|
|
27
|
+
Requires-Dist: fastapi>=0.162.2; extra == "web"
|
|
28
|
+
Requires-Dist: uvicorn[standard]>=0.54.0; extra == "web"
|
|
29
|
+
Requires-Dist: python-multipart>=0.0.33; extra == "web"
|
|
30
|
+
Requires-Dist: authlib>=1.9.5; extra == "web"
|
|
31
|
+
Requires-Dist: httpx>=0.28.1; extra == "web"
|
|
32
|
+
Requires-Dist: itsdangerous>=2.2.0; extra == "web"
|
|
33
|
+
Requires-Dist: dnspython>=2.8.0; extra == "web"
|
|
34
|
+
Provides-Extra: reporting
|
|
35
|
+
Requires-Dist: markdown>=3.11.3; extra == "reporting"
|
|
36
|
+
Provides-Extra: llm
|
|
37
|
+
Requires-Dist: litellm==1.108.0; extra == "llm"
|
|
38
|
+
Provides-Extra: all
|
|
39
|
+
Requires-Dist: haris[llm,reporting,web]; extra == "all"
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="assets/haris_logo.png" alt="HARIS" width="400"><br>
|
|
44
|
+
<em>Black-box web security audit framework. Scan, correlate, prioritise, remediate.</em><br><br>
|
|
45
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.13+-blue.svg" alt="Python"></a> <a href="https://owasp.org/www-project-top-ten/"><img src="https://img.shields.io/badge/OWASP-Top%2010%202025-red.svg" alt="OWASP"></a>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
> Scan only systems you are authorised to test. See [LEGAL_NOTICE.md](LEGAL_NOTICE.md).
|
|
49
|
+
|
|
50
|
+
Orchestrates security scanners, correlates findings, and writes one prioritised report. LLM analysis is optional.
|
|
51
|
+
|
|
52
|
+
- **Correlation.** Findings that share a fingerprint become one finding. The score combines the scanners that reported it.
|
|
53
|
+
- **Cross-scanner context.** Built-in checks and nmap fill a `ScanContext`. Later scanners read it. Nuclei derives its tag group from detected technologies.
|
|
54
|
+
- **Business risk and remediation.** Plain-language impact sits next to the technical finding. Fixes are grouped and ordered by impact and effort.
|
|
55
|
+
- **OWASP Top 10 (2025).** Findings are mapped, including Software Supply Chain Failures and Mishandling of Exceptional Conditions.
|
|
56
|
+
- **Verification.** Replay oracles, an optional LLM verdict, and an opt-in agent. A refuted finding stays in the report. See [`docs/verification.md`](docs/verification.md).
|
|
57
|
+
- **Profiles, templates, LLM.** Six profiles. Scan templates are named presets with per-scanner overrides, stored and reused from the web UI. LLM analysis covers Q&A, Jira text, test cases and enrichment, from the scan data.
|
|
58
|
+
|
|
59
|
+
## Quick start
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git clone https://github.com/calghar/HARIS
|
|
63
|
+
cd HARIS
|
|
64
|
+
uv sync --extra web --extra reporting
|
|
65
|
+
uv run haris --help # console script haris, entry point haris.cli:main
|
|
66
|
+
# CLI. --verify defaults to replay (off, replay, llm).
|
|
67
|
+
uv run haris --url https://example.com --profile quick --yes
|
|
68
|
+
uv run haris --list-profiles
|
|
69
|
+
uv run haris --web # bind defaults are 127.0.0.1 and port 8000
|
|
70
|
+
# Docker
|
|
71
|
+
docker compose up
|
|
72
|
+
docker compose run --rm cli --url https://example.com --profile quick --yes
|
|
73
|
+
make reload
|
|
74
|
+
# Scanner template updates
|
|
75
|
+
uv run haris update-templates
|
|
76
|
+
uv run haris update-templates --scanner nuclei --list
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Scanners
|
|
80
|
+
|
|
81
|
+
| Scanner | What it tests | Install | Version recorded |
|
|
82
|
+
| ------- | ------------- | ------- | ---------------- |
|
|
83
|
+
| Wapiti | SQLi, XSS, SSRF, command injection, CRLF, XXE | `pipx install wapiti3` | 3.3 |
|
|
84
|
+
| SSLyze | TLS protocols, cipher suites, certificate chain, Heartbleed, ROBOT | `pipx install sslyze` | 6.x |
|
|
85
|
+
| Nmap | Open ports, service versions, exposed databases | system package manager | 7.x |
|
|
86
|
+
| Nikto | Web server misconfigurations, outdated software, dangerous files | `brew install nikto` | 2.x |
|
|
87
|
+
| Nuclei | technology-targeted templates, then exposure, misconfiguration and DAST baseline | `brew install nuclei` | 3.x |
|
|
88
|
+
| ZAP | Active and passive web scan. Off by default and in no profile. `--scanners zap` | [ZAP download](https://www.zaproxy.org/download/) | 2.16 |
|
|
89
|
+
| garak | Injection and leakage probes on a discovered chat route. Runs only with `--ai-active` and `--i-have-authorization` | install the binary | 0.17 |
|
|
90
|
+
| promptfoo | Red-team plugins on a discovered chat route. Same flags as garak | install the binary | 0.125 |
|
|
91
|
+
|
|
92
|
+
All scanners are separate programs. Install Wapiti and SSLyze with `pipx`, outside the HARIS environment. The version column is the adapter `version` attribute (docstrings: Wapiti 3.3.2, Nikto 2.6; Nuclei fixtures 3.7.1; `garak.yaml` 0.17.1; `promptfoo.yaml` 0.125.1). HARIS does not check the tool version at runtime.
|
|
93
|
+
|
|
94
|
+
## Scan profiles
|
|
95
|
+
|
|
96
|
+
Estimates are the `estimated_duration` strings on each profile.
|
|
97
|
+
|
|
98
|
+
| Profile | Scanners | Use |
|
|
99
|
+
| ------- | -------- | --- |
|
|
100
|
+
| `quick` | The 13 built-in checks other than `ai_security` | First look. 1-3 minutes |
|
|
101
|
+
| `pre-launch` | `quick` plus `nmap`, `sslyze`, `wapiti` | Before production. 10-30 minutes |
|
|
102
|
+
| `full` | `pre-launch` plus `nikto`, `nuclei` | Full audit. 20-30 minutes. ZAP, garak and promptfoo are absent |
|
|
103
|
+
| `ai-security` | `header_checks`, `tls_checks`, `info_disclosure`, `ai_security`, `garak`, `promptfoo` | AI endpoints. 1-10 minutes |
|
|
104
|
+
| `regression` | `header_checks`, `tls_checks`, `misc_checks` | CI gate. 30-60 seconds |
|
|
105
|
+
| `compliance` | `header_checks`, `tls_checks`, `misc_checks`, `info_disclosure`, `cookie_checks`, `nmap`, `sslyze` | TLS, headers, cookies, disclosure, ports. 5-15 minutes |
|
|
106
|
+
|
|
107
|
+
<details>
|
|
108
|
+
<summary>Built-in checks (14). <code>quick</code> runs every check except <code>ai_security</code>.</summary>
|
|
109
|
+
|
|
110
|
+
| Check | What it tests |
|
|
111
|
+
| ----- | ------------- |
|
|
112
|
+
| `header_checks` | Six headers: HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy. Also weak CSP or HSTS, a versioned Server banner, and any X-Powered-By header |
|
|
113
|
+
| `tls_checks` | Certificate and TLS basics |
|
|
114
|
+
| `misc_checks` | CORS, HTTP to HTTPS redirect, 14 sensitive paths |
|
|
115
|
+
| `info_disclosure` | Error pages, debug endpoints, HTML comments |
|
|
116
|
+
| `cookie_checks` | Session cookie flags, scope, expiry and name |
|
|
117
|
+
| `sri_checks` | Subresource Integrity on third-party resources |
|
|
118
|
+
| `cache_checks` | Cache-Control on login, account and session-setting responses |
|
|
119
|
+
| `method_checks` | OPTIONS advertisement and TRACE |
|
|
120
|
+
| `redirect_checks` | Open redirect via common redirect parameters |
|
|
121
|
+
| `graphql_checks` | GraphQL introspection |
|
|
122
|
+
| `openapi_checks` | Exposed OpenAPI or Swagger documents |
|
|
123
|
+
| `listing_checks` | Directory listing |
|
|
124
|
+
| `dns_checks` | CAA, SPF and DMARC |
|
|
125
|
+
| `ai_security` | AI endpoints and MCP servers. Prompts only with `--ai-active` and `--i-have-authorization`. See [`docs/ai_security.md`](docs/ai_security.md) |
|
|
126
|
+
|
|
127
|
+
The 14 sensitive paths are `/.env`, `/.git/config`, `/robots.txt`, `/sitemap.xml`, `/.well-known/security.txt`, `/wp-login.php`, `/admin`, `/phpmyadmin`, `/server-status`, `/server-info`, `/.DS_Store`, `/crossdomain.xml`, `/elmah.axd` and `/trace.axd`.
|
|
128
|
+
|
|
129
|
+
</details>
|
|
130
|
+
|
|
131
|
+
## Configuration
|
|
132
|
+
|
|
133
|
+
Value precedence, highest first:
|
|
134
|
+
|
|
135
|
+
1. Flags: `--url`, `--profile`, `--output`, `--formats`, `--log-level`.
|
|
136
|
+
2. Environment variables that override YAML keys, for example `HARIS_TARGET_URL` and `HARIS_PROFILE`.
|
|
137
|
+
3. The YAML file: `--config`, else `HARIS_CONFIG`, else `./config/default_config.yaml`, else the packaged `src/haris/resources/config/default_config.yaml`.
|
|
138
|
+
4. Built-in defaults.
|
|
139
|
+
|
|
140
|
+
Copy `.env.example` to `.env`. Docker Compose reads it. Outside Docker, export the variables in the shell.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
HARIS_ADMIN_EMAIL=admin@example.com
|
|
144
|
+
HARIS_ADMIN_PASSWORD=changeme123
|
|
145
|
+
HARIS_SECRET_KEY=<random-32-char-string> # python -c "import secrets; print(secrets.token_hex(32))"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
# excerpt of src/haris/resources/config/default_config.yaml
|
|
150
|
+
profile: full
|
|
151
|
+
target:
|
|
152
|
+
url: "https://example.com"
|
|
153
|
+
auth:
|
|
154
|
+
method: none # none | cookie | header | form
|
|
155
|
+
llm:
|
|
156
|
+
model: "" # required for LLM features: <route>/<id>
|
|
157
|
+
api_key_env: LITELLM_API_KEY # name of the variable that holds the key
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Every variable, default and effect is in [`docs/configuration.md`](docs/configuration.md).
|
|
161
|
+
|
|
162
|
+
## Web dashboard
|
|
163
|
+
|
|
164
|
+
`uv run haris --web` serves the dashboard. It requires login.
|
|
165
|
+
|
|
166
|
+
- **First admin:** startup creates one when `HARIS_ADMIN_EMAIL` and `HARIS_ADMIN_PASSWORD` are set and the user table is empty.
|
|
167
|
+
- **Setup page:** `/auth/setup` answers 404 until `HARIS_SETUP_TOKEN` is set, and once a user exists.
|
|
168
|
+
- **Registration:** self-registration uses `HARIS_ALLOWED_EMAIL_DOMAINS`. Roles are `admin` and `user`.
|
|
169
|
+
- **OIDC:** set `HARIS_OIDC_ENABLED=true` plus `HARIS_OIDC_ISSUER`, `HARIS_OIDC_CLIENT_ID` and `HARIS_OIDC_CLIENT_SECRET`.
|
|
170
|
+
|
|
171
|
+
Details are in [`docs/authentication.md`](docs/authentication.md).
|
|
172
|
+
|
|
173
|
+
## LLM analysis
|
|
174
|
+
|
|
175
|
+
LLM features use LiteLLM, which is optional.
|
|
176
|
+
|
|
177
|
+
- **Install:** `uv sync --extra llm`. The published image includes it.
|
|
178
|
+
- **Model:** set `llm.model` to `<route>/<id>`, for example `ollama_chat/llama3.1`. For a gateway, also set `llm.api_base` and `llm.api_key_env`.
|
|
179
|
+
- **Old backend names:** `anthropic`, `openai`, `ollama` and `bedrock` are rejected: CLI exit 3, web 400.
|
|
180
|
+
|
|
181
|
+
Setup and the container note are in [`docs/llm_integration.md`](docs/llm_integration.md). Migration steps are in [`docs/upgrading.md`](docs/upgrading.md).
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
uv run haris llm ask --scan-id <id> --question "Top 3 risks for an exec"
|
|
185
|
+
uv run haris llm remediate --scan-id <id> --format jira
|
|
186
|
+
uv run haris llm summarize --scan-id <id> --audience developer
|
|
187
|
+
uv run haris --url https://example.com --profile quick --yes --llm-enrich # in-pipeline enrichment
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Documentation
|
|
191
|
+
|
|
192
|
+
- Design: [architecture](docs/architecture.md), [methodology](docs/methodology.md), [writing a check](docs/writing_checks.md), [integrating a tool](docs/integrating_tools.md).
|
|
193
|
+
- Safety and quality: [verification](docs/verification.md), [agent safety](docs/agent_safety.md), [AI security](docs/ai_security.md), [benchmarks](docs/benchmarks.md).
|
|
194
|
+
- Operation: [configuration](docs/configuration.md), [authentication](docs/authentication.md), [LLM integration](docs/llm_integration.md), [upgrading](docs/upgrading.md), [CI integrations](docs/integrations.md).
|
|
195
|
+
|
|
196
|
+
A new scanner subclasses `BaseScanner` and is added to `SCANNER_REGISTRY`. A new check is added to `CHECK_REGISTRY`. A report subclasses `BaseReporter` and implements `generate()`. An LLM backend subclasses `BaseLLMBackend` and implements `complete()`.
|
|
197
|
+
|
|
198
|
+
## Limitations, legal and licence
|
|
199
|
+
|
|
200
|
+
- Black-box only. No source code analysis. Target auth methods on `AuthConfig` are `none`, `cookie`, `header` and `form`.
|
|
201
|
+
- LLM features need an API key and have a cost. They are optional. Email verification needs SMTP. Without it, an admin activates accounts.
|
|
202
|
+
- A security professional should confirm a finding before anyone acts on it. External scanner results depend on those tools being installed.
|
|
203
|
+
|
|
204
|
+
For authorised testing only. See [LEGAL_NOTICE.md](LEGAL_NOTICE.md). MIT licence. See [LICENSE](LICENSE).
|
haris-0.8.0/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/haris_logo.png" alt="HARIS" width="400"><br>
|
|
3
|
+
<em>Black-box web security audit framework. Scan, correlate, prioritise, remediate.</em><br><br>
|
|
4
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"></a> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.13+-blue.svg" alt="Python"></a> <a href="https://owasp.org/www-project-top-ten/"><img src="https://img.shields.io/badge/OWASP-Top%2010%202025-red.svg" alt="OWASP"></a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
> Scan only systems you are authorised to test. See [LEGAL_NOTICE.md](LEGAL_NOTICE.md).
|
|
8
|
+
|
|
9
|
+
Orchestrates security scanners, correlates findings, and writes one prioritised report. LLM analysis is optional.
|
|
10
|
+
|
|
11
|
+
- **Correlation.** Findings that share a fingerprint become one finding. The score combines the scanners that reported it.
|
|
12
|
+
- **Cross-scanner context.** Built-in checks and nmap fill a `ScanContext`. Later scanners read it. Nuclei derives its tag group from detected technologies.
|
|
13
|
+
- **Business risk and remediation.** Plain-language impact sits next to the technical finding. Fixes are grouped and ordered by impact and effort.
|
|
14
|
+
- **OWASP Top 10 (2025).** Findings are mapped, including Software Supply Chain Failures and Mishandling of Exceptional Conditions.
|
|
15
|
+
- **Verification.** Replay oracles, an optional LLM verdict, and an opt-in agent. A refuted finding stays in the report. See [`docs/verification.md`](docs/verification.md).
|
|
16
|
+
- **Profiles, templates, LLM.** Six profiles. Scan templates are named presets with per-scanner overrides, stored and reused from the web UI. LLM analysis covers Q&A, Jira text, test cases and enrichment, from the scan data.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
git clone https://github.com/calghar/HARIS
|
|
22
|
+
cd HARIS
|
|
23
|
+
uv sync --extra web --extra reporting
|
|
24
|
+
uv run haris --help # console script haris, entry point haris.cli:main
|
|
25
|
+
# CLI. --verify defaults to replay (off, replay, llm).
|
|
26
|
+
uv run haris --url https://example.com --profile quick --yes
|
|
27
|
+
uv run haris --list-profiles
|
|
28
|
+
uv run haris --web # bind defaults are 127.0.0.1 and port 8000
|
|
29
|
+
# Docker
|
|
30
|
+
docker compose up
|
|
31
|
+
docker compose run --rm cli --url https://example.com --profile quick --yes
|
|
32
|
+
make reload
|
|
33
|
+
# Scanner template updates
|
|
34
|
+
uv run haris update-templates
|
|
35
|
+
uv run haris update-templates --scanner nuclei --list
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Scanners
|
|
39
|
+
|
|
40
|
+
| Scanner | What it tests | Install | Version recorded |
|
|
41
|
+
| ------- | ------------- | ------- | ---------------- |
|
|
42
|
+
| Wapiti | SQLi, XSS, SSRF, command injection, CRLF, XXE | `pipx install wapiti3` | 3.3 |
|
|
43
|
+
| SSLyze | TLS protocols, cipher suites, certificate chain, Heartbleed, ROBOT | `pipx install sslyze` | 6.x |
|
|
44
|
+
| Nmap | Open ports, service versions, exposed databases | system package manager | 7.x |
|
|
45
|
+
| Nikto | Web server misconfigurations, outdated software, dangerous files | `brew install nikto` | 2.x |
|
|
46
|
+
| Nuclei | technology-targeted templates, then exposure, misconfiguration and DAST baseline | `brew install nuclei` | 3.x |
|
|
47
|
+
| ZAP | Active and passive web scan. Off by default and in no profile. `--scanners zap` | [ZAP download](https://www.zaproxy.org/download/) | 2.16 |
|
|
48
|
+
| garak | Injection and leakage probes on a discovered chat route. Runs only with `--ai-active` and `--i-have-authorization` | install the binary | 0.17 |
|
|
49
|
+
| promptfoo | Red-team plugins on a discovered chat route. Same flags as garak | install the binary | 0.125 |
|
|
50
|
+
|
|
51
|
+
All scanners are separate programs. Install Wapiti and SSLyze with `pipx`, outside the HARIS environment. The version column is the adapter `version` attribute (docstrings: Wapiti 3.3.2, Nikto 2.6; Nuclei fixtures 3.7.1; `garak.yaml` 0.17.1; `promptfoo.yaml` 0.125.1). HARIS does not check the tool version at runtime.
|
|
52
|
+
|
|
53
|
+
## Scan profiles
|
|
54
|
+
|
|
55
|
+
Estimates are the `estimated_duration` strings on each profile.
|
|
56
|
+
|
|
57
|
+
| Profile | Scanners | Use |
|
|
58
|
+
| ------- | -------- | --- |
|
|
59
|
+
| `quick` | The 13 built-in checks other than `ai_security` | First look. 1-3 minutes |
|
|
60
|
+
| `pre-launch` | `quick` plus `nmap`, `sslyze`, `wapiti` | Before production. 10-30 minutes |
|
|
61
|
+
| `full` | `pre-launch` plus `nikto`, `nuclei` | Full audit. 20-30 minutes. ZAP, garak and promptfoo are absent |
|
|
62
|
+
| `ai-security` | `header_checks`, `tls_checks`, `info_disclosure`, `ai_security`, `garak`, `promptfoo` | AI endpoints. 1-10 minutes |
|
|
63
|
+
| `regression` | `header_checks`, `tls_checks`, `misc_checks` | CI gate. 30-60 seconds |
|
|
64
|
+
| `compliance` | `header_checks`, `tls_checks`, `misc_checks`, `info_disclosure`, `cookie_checks`, `nmap`, `sslyze` | TLS, headers, cookies, disclosure, ports. 5-15 minutes |
|
|
65
|
+
|
|
66
|
+
<details>
|
|
67
|
+
<summary>Built-in checks (14). <code>quick</code> runs every check except <code>ai_security</code>.</summary>
|
|
68
|
+
|
|
69
|
+
| Check | What it tests |
|
|
70
|
+
| ----- | ------------- |
|
|
71
|
+
| `header_checks` | Six headers: HSTS, CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy. Also weak CSP or HSTS, a versioned Server banner, and any X-Powered-By header |
|
|
72
|
+
| `tls_checks` | Certificate and TLS basics |
|
|
73
|
+
| `misc_checks` | CORS, HTTP to HTTPS redirect, 14 sensitive paths |
|
|
74
|
+
| `info_disclosure` | Error pages, debug endpoints, HTML comments |
|
|
75
|
+
| `cookie_checks` | Session cookie flags, scope, expiry and name |
|
|
76
|
+
| `sri_checks` | Subresource Integrity on third-party resources |
|
|
77
|
+
| `cache_checks` | Cache-Control on login, account and session-setting responses |
|
|
78
|
+
| `method_checks` | OPTIONS advertisement and TRACE |
|
|
79
|
+
| `redirect_checks` | Open redirect via common redirect parameters |
|
|
80
|
+
| `graphql_checks` | GraphQL introspection |
|
|
81
|
+
| `openapi_checks` | Exposed OpenAPI or Swagger documents |
|
|
82
|
+
| `listing_checks` | Directory listing |
|
|
83
|
+
| `dns_checks` | CAA, SPF and DMARC |
|
|
84
|
+
| `ai_security` | AI endpoints and MCP servers. Prompts only with `--ai-active` and `--i-have-authorization`. See [`docs/ai_security.md`](docs/ai_security.md) |
|
|
85
|
+
|
|
86
|
+
The 14 sensitive paths are `/.env`, `/.git/config`, `/robots.txt`, `/sitemap.xml`, `/.well-known/security.txt`, `/wp-login.php`, `/admin`, `/phpmyadmin`, `/server-status`, `/server-info`, `/.DS_Store`, `/crossdomain.xml`, `/elmah.axd` and `/trace.axd`.
|
|
87
|
+
|
|
88
|
+
</details>
|
|
89
|
+
|
|
90
|
+
## Configuration
|
|
91
|
+
|
|
92
|
+
Value precedence, highest first:
|
|
93
|
+
|
|
94
|
+
1. Flags: `--url`, `--profile`, `--output`, `--formats`, `--log-level`.
|
|
95
|
+
2. Environment variables that override YAML keys, for example `HARIS_TARGET_URL` and `HARIS_PROFILE`.
|
|
96
|
+
3. The YAML file: `--config`, else `HARIS_CONFIG`, else `./config/default_config.yaml`, else the packaged `src/haris/resources/config/default_config.yaml`.
|
|
97
|
+
4. Built-in defaults.
|
|
98
|
+
|
|
99
|
+
Copy `.env.example` to `.env`. Docker Compose reads it. Outside Docker, export the variables in the shell.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
HARIS_ADMIN_EMAIL=admin@example.com
|
|
103
|
+
HARIS_ADMIN_PASSWORD=changeme123
|
|
104
|
+
HARIS_SECRET_KEY=<random-32-char-string> # python -c "import secrets; print(secrets.token_hex(32))"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
# excerpt of src/haris/resources/config/default_config.yaml
|
|
109
|
+
profile: full
|
|
110
|
+
target:
|
|
111
|
+
url: "https://example.com"
|
|
112
|
+
auth:
|
|
113
|
+
method: none # none | cookie | header | form
|
|
114
|
+
llm:
|
|
115
|
+
model: "" # required for LLM features: <route>/<id>
|
|
116
|
+
api_key_env: LITELLM_API_KEY # name of the variable that holds the key
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Every variable, default and effect is in [`docs/configuration.md`](docs/configuration.md).
|
|
120
|
+
|
|
121
|
+
## Web dashboard
|
|
122
|
+
|
|
123
|
+
`uv run haris --web` serves the dashboard. It requires login.
|
|
124
|
+
|
|
125
|
+
- **First admin:** startup creates one when `HARIS_ADMIN_EMAIL` and `HARIS_ADMIN_PASSWORD` are set and the user table is empty.
|
|
126
|
+
- **Setup page:** `/auth/setup` answers 404 until `HARIS_SETUP_TOKEN` is set, and once a user exists.
|
|
127
|
+
- **Registration:** self-registration uses `HARIS_ALLOWED_EMAIL_DOMAINS`. Roles are `admin` and `user`.
|
|
128
|
+
- **OIDC:** set `HARIS_OIDC_ENABLED=true` plus `HARIS_OIDC_ISSUER`, `HARIS_OIDC_CLIENT_ID` and `HARIS_OIDC_CLIENT_SECRET`.
|
|
129
|
+
|
|
130
|
+
Details are in [`docs/authentication.md`](docs/authentication.md).
|
|
131
|
+
|
|
132
|
+
## LLM analysis
|
|
133
|
+
|
|
134
|
+
LLM features use LiteLLM, which is optional.
|
|
135
|
+
|
|
136
|
+
- **Install:** `uv sync --extra llm`. The published image includes it.
|
|
137
|
+
- **Model:** set `llm.model` to `<route>/<id>`, for example `ollama_chat/llama3.1`. For a gateway, also set `llm.api_base` and `llm.api_key_env`.
|
|
138
|
+
- **Old backend names:** `anthropic`, `openai`, `ollama` and `bedrock` are rejected: CLI exit 3, web 400.
|
|
139
|
+
|
|
140
|
+
Setup and the container note are in [`docs/llm_integration.md`](docs/llm_integration.md). Migration steps are in [`docs/upgrading.md`](docs/upgrading.md).
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
uv run haris llm ask --scan-id <id> --question "Top 3 risks for an exec"
|
|
144
|
+
uv run haris llm remediate --scan-id <id> --format jira
|
|
145
|
+
uv run haris llm summarize --scan-id <id> --audience developer
|
|
146
|
+
uv run haris --url https://example.com --profile quick --yes --llm-enrich # in-pipeline enrichment
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
- Design: [architecture](docs/architecture.md), [methodology](docs/methodology.md), [writing a check](docs/writing_checks.md), [integrating a tool](docs/integrating_tools.md).
|
|
152
|
+
- Safety and quality: [verification](docs/verification.md), [agent safety](docs/agent_safety.md), [AI security](docs/ai_security.md), [benchmarks](docs/benchmarks.md).
|
|
153
|
+
- Operation: [configuration](docs/configuration.md), [authentication](docs/authentication.md), [LLM integration](docs/llm_integration.md), [upgrading](docs/upgrading.md), [CI integrations](docs/integrations.md).
|
|
154
|
+
|
|
155
|
+
A new scanner subclasses `BaseScanner` and is added to `SCANNER_REGISTRY`. A new check is added to `CHECK_REGISTRY`. A report subclasses `BaseReporter` and implements `generate()`. An LLM backend subclasses `BaseLLMBackend` and implements `complete()`.
|
|
156
|
+
|
|
157
|
+
## Limitations, legal and licence
|
|
158
|
+
|
|
159
|
+
- Black-box only. No source code analysis. Target auth methods on `AuthConfig` are `none`, `cookie`, `header` and `form`.
|
|
160
|
+
- LLM features need an API key and have a cost. They are optional. Email verification needs SMTP. Without it, an admin activates accounts.
|
|
161
|
+
- A security professional should confirm a finding before anyone acts on it. External scanner results depend on those tools being installed.
|
|
162
|
+
|
|
163
|
+
For authorised testing only. See [LEGAL_NOTICE.md](LEGAL_NOTICE.md). MIT licence. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "haris"
|
|
7
|
+
version = "0.8.0"
|
|
8
|
+
description = "Black-box web application security audit framework"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.13"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "HARIS contributors"},
|
|
14
|
+
]
|
|
15
|
+
keywords = ["security", "audit", "pentest", "owasp", "vulnerability-scanner"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Information Technology",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Programming Language :: Python :: 3.14",
|
|
24
|
+
"Topic :: Security",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
dependencies = [
|
|
28
|
+
"pydantic>=2.14.3",
|
|
29
|
+
"requests>=2.34.2",
|
|
30
|
+
"pyyaml>=6.0.3",
|
|
31
|
+
"jinja2>=3.1.6",
|
|
32
|
+
"bcrypt>=5.0.0",
|
|
33
|
+
"starlette>=1.10.0",
|
|
34
|
+
"yoyo-migrations>=9.0.0",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
# Web dashboard
|
|
39
|
+
web = [
|
|
40
|
+
"fastapi>=0.162.2",
|
|
41
|
+
"uvicorn[standard]>=0.54.0",
|
|
42
|
+
"python-multipart>=0.0.33",
|
|
43
|
+
"authlib>=1.9.5",
|
|
44
|
+
"httpx>=0.28.1",
|
|
45
|
+
"itsdangerous>=2.2.0",
|
|
46
|
+
"dnspython>=2.8.0",
|
|
47
|
+
]
|
|
48
|
+
# Report generation extras
|
|
49
|
+
reporting = [
|
|
50
|
+
"markdown>=3.11.3",
|
|
51
|
+
]
|
|
52
|
+
# LLM calls; exact pin and deny-list: scripts/check_litellm.py
|
|
53
|
+
llm = [
|
|
54
|
+
"litellm==1.108.0",
|
|
55
|
+
]
|
|
56
|
+
# Everything installable alongside the web dashboard
|
|
57
|
+
all = [
|
|
58
|
+
"haris[web,reporting,llm]",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[dependency-groups]
|
|
62
|
+
dev = [
|
|
63
|
+
"pytest>=9.2.0",
|
|
64
|
+
"pytest-cov>=7.1.0",
|
|
65
|
+
"ruff>=0.17.4",
|
|
66
|
+
"mypy>=2.4.1",
|
|
67
|
+
"types-requests",
|
|
68
|
+
"types-PyYAML",
|
|
69
|
+
"types-authlib",
|
|
70
|
+
"bandit[toml]>=1.9.4",
|
|
71
|
+
"pip-audit>=2.10.1",
|
|
72
|
+
"pre-commit>=4.7.0",
|
|
73
|
+
"jsonschema>=4.26.0",
|
|
74
|
+
"types-jsonschema>=4.26.0.20261006",
|
|
75
|
+
"pytest-bdd>=9.0.1",
|
|
76
|
+
]
|
|
77
|
+
docs = [
|
|
78
|
+
"mkdocs-material>=9.8.1",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[project.scripts]
|
|
82
|
+
haris = "haris.cli:main"
|
|
83
|
+
|
|
84
|
+
[tool.setuptools.packages.find]
|
|
85
|
+
where = ["src"]
|
|
86
|
+
include = ["haris*"]
|
|
87
|
+
|
|
88
|
+
[tool.setuptools.package-data]
|
|
89
|
+
haris = [
|
|
90
|
+
"web/templates/**/*",
|
|
91
|
+
"web/static/**/*",
|
|
92
|
+
"llm/templates/**/*",
|
|
93
|
+
"resources/config/**/*",
|
|
94
|
+
"resources/schema/**/*",
|
|
95
|
+
"db/migrations/*",
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
[tool.pytest.ini_options]
|
|
99
|
+
testpaths = ["tests"]
|
|
100
|
+
addopts = "-v --tb=short"
|
|
101
|
+
markers = [
|
|
102
|
+
"docker: requires a local Docker daemon and the haris-agent-sandbox image",
|
|
103
|
+
]
|
|
104
|
+
filterwarnings = [
|
|
105
|
+
"ignore:The default datetime adapter:DeprecationWarning",
|
|
106
|
+
"ignore::pytest.PytestUnknownMarkWarning",
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
[tool.ruff]
|
|
110
|
+
target-version = "py313"
|
|
111
|
+
line-length = 88
|
|
112
|
+
|
|
113
|
+
[tool.ruff.lint]
|
|
114
|
+
select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "TID251"]
|
|
115
|
+
# B008: FastAPI's Depends() in function defaults is the standard DI pattern
|
|
116
|
+
ignore = ["B008"]
|
|
117
|
+
|
|
118
|
+
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
119
|
+
"requests".msg = "Send HTTP through haris.net.ScopedClient."
|
|
120
|
+
"httpx".msg = "Send HTTP through haris.net.ScopedClient."
|
|
121
|
+
"urllib3".msg = "Send HTTP through haris.net.ScopedClient."
|
|
122
|
+
|
|
123
|
+
[tool.ruff.lint.per-file-ignores]
|
|
124
|
+
"src/haris/net/**" = ["TID251"]
|
|
125
|
+
# Fake transports and test servers
|
|
126
|
+
"tests/**" = ["TID251"]
|
|
127
|
+
# Benchmark harness talks to its own local fixtures
|
|
128
|
+
"bench/**" = ["TID251"]
|
|
129
|
+
|
|
130
|
+
[tool.mypy]
|
|
131
|
+
python_version = "3.13"
|
|
132
|
+
warn_return_any = true
|
|
133
|
+
warn_unused_configs = true
|
|
134
|
+
|
|
135
|
+
[[tool.mypy.overrides]]
|
|
136
|
+
module = "yoyo.*"
|
|
137
|
+
ignore_missing_imports = true
|
|
138
|
+
|
|
139
|
+
[tool.bandit]
|
|
140
|
+
exclude_dirs = ["tests", ".venv", "venv"]
|
|
141
|
+
# B603/B607: scanners intentionally call external tools (nmap, nuclei, etc.) by name
|
|
142
|
+
skips = ["B603", "B607"]
|
haris-0.8.0/setup.cfg
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from .policy import (
|
|
2
|
+
AgentPolicy,
|
|
3
|
+
activation_result,
|
|
4
|
+
bind_cli,
|
|
5
|
+
bind_policy,
|
|
6
|
+
current_policy,
|
|
7
|
+
policy_for_web,
|
|
8
|
+
reset_policy,
|
|
9
|
+
)
|
|
10
|
+
from .stages import note_stage
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"AgentPolicy",
|
|
14
|
+
"activation_result",
|
|
15
|
+
"bind_cli",
|
|
16
|
+
"bind_policy",
|
|
17
|
+
"current_policy",
|
|
18
|
+
"note_stage",
|
|
19
|
+
"policy_for_web",
|
|
20
|
+
"reset_policy",
|
|
21
|
+
]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
import json
|
|
3
|
+
import os
|
|
4
|
+
import threading
|
|
5
|
+
from datetime import UTC, datetime
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from ..llm.redaction import redact
|
|
10
|
+
|
|
11
|
+
LOG_CAP = 500
|
|
12
|
+
DIGEST_FIELDS = frozenset({"digest"})
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def digest(text: str) -> str:
|
|
16
|
+
return hashlib.sha256(redact(text).encode()).hexdigest()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _clean(value: str, *, cap: bool, secrets: list[str]) -> str:
|
|
20
|
+
cleaned = "".join(ch for ch in redact(value) if ch >= " " or ch in "\t")
|
|
21
|
+
for secret in secrets:
|
|
22
|
+
cleaned = cleaned.replace(secret, "[REDACTED]")
|
|
23
|
+
return cleaned[:LOG_CAP] if cap else cleaned
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _redact(value: object, key: str, secrets: list[str]) -> object:
|
|
27
|
+
if isinstance(value, str):
|
|
28
|
+
return _clean(value, cap=key not in DIGEST_FIELDS, secrets=secrets)
|
|
29
|
+
if isinstance(value, dict):
|
|
30
|
+
return {str(k): _redact(v, str(k), secrets) for k, v in value.items()}
|
|
31
|
+
if isinstance(value, list):
|
|
32
|
+
return [_redact(item, "", secrets) for item in value]
|
|
33
|
+
return value
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class AuditLog:
|
|
37
|
+
"""Append-only JSONL. Each record is redacted before it is written."""
|
|
38
|
+
|
|
39
|
+
def __init__(self, path: Path) -> None:
|
|
40
|
+
self.path = path
|
|
41
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
42
|
+
self._fh = path.open("a", encoding="utf-8")
|
|
43
|
+
self._lock = threading.Lock()
|
|
44
|
+
self._secrets: list[str] = []
|
|
45
|
+
|
|
46
|
+
def redact_secret(self, secret: str) -> None:
|
|
47
|
+
"""Drop this exact string from every later record."""
|
|
48
|
+
if secret and secret not in self._secrets:
|
|
49
|
+
self._secrets.append(secret)
|
|
50
|
+
|
|
51
|
+
def write(self, kind: str, **fields: object) -> None:
|
|
52
|
+
record: dict[str, Any] = {
|
|
53
|
+
"kind": kind,
|
|
54
|
+
"ts": datetime.now(UTC).isoformat(),
|
|
55
|
+
**{
|
|
56
|
+
key: _redact(value, key, self._secrets) for key, value in fields.items()
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
line = json.dumps(record, sort_keys=True, default=str)
|
|
60
|
+
with self._lock:
|
|
61
|
+
self._fh.write(line + "\n")
|
|
62
|
+
self._fh.flush()
|
|
63
|
+
os.fsync(self._fh.fileno())
|
|
64
|
+
|
|
65
|
+
def close(self) -> None:
|
|
66
|
+
with self._lock:
|
|
67
|
+
self._fh.close()
|