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.
Files changed (543) hide show
  1. haris-0.8.0/LICENSE +21 -0
  2. haris-0.8.0/PKG-INFO +204 -0
  3. haris-0.8.0/README.md +163 -0
  4. haris-0.8.0/pyproject.toml +142 -0
  5. haris-0.8.0/setup.cfg +4 -0
  6. haris-0.8.0/src/haris/__init__.py +6 -0
  7. haris-0.8.0/src/haris/__main__.py +5 -0
  8. haris-0.8.0/src/haris/agent/__init__.py +21 -0
  9. haris-0.8.0/src/haris/agent/audit.py +67 -0
  10. haris-0.8.0/src/haris/agent/budget.py +52 -0
  11. haris-0.8.0/src/haris/agent/coordinator.py +253 -0
  12. haris-0.8.0/src/haris/agent/docker_runtime.py +403 -0
  13. haris-0.8.0/src/haris/agent/guardrails.py +176 -0
  14. haris-0.8.0/src/haris/agent/models.py +43 -0
  15. haris-0.8.0/src/haris/agent/policy.py +127 -0
  16. haris-0.8.0/src/haris/agent/prompts.py +17 -0
  17. haris-0.8.0/src/haris/agent/proxy.py +309 -0
  18. haris-0.8.0/src/haris/agent/proxy_auth.py +26 -0
  19. haris-0.8.0/src/haris/agent/runtime.py +133 -0
  20. haris-0.8.0/src/haris/agent/settings.py +45 -0
  21. haris-0.8.0/src/haris/agent/stages.py +5 -0
  22. haris-0.8.0/src/haris/agent/turn.py +118 -0
  23. haris-0.8.0/src/haris/agent/validator.py +138 -0
  24. haris-0.8.0/src/haris/ai_security/__init__.py +3 -0
  25. haris-0.8.0/src/haris/ai_security/active.py +294 -0
  26. haris-0.8.0/src/haris/ai_security/adapters.py +151 -0
  27. haris-0.8.0/src/haris/ai_security/body_validators.py +174 -0
  28. haris-0.8.0/src/haris/ai_security/bundles.py +47 -0
  29. haris-0.8.0/src/haris/ai_security/discovery.py +94 -0
  30. haris-0.8.0/src/haris/ai_security/findings.py +81 -0
  31. haris-0.8.0/src/haris/ai_security/mcp_probe.py +133 -0
  32. haris-0.8.0/src/haris/ai_security/mcp_static.py +169 -0
  33. haris-0.8.0/src/haris/ai_security/options.py +37 -0
  34. haris-0.8.0/src/haris/ai_security/owasp_ai.py +86 -0
  35. haris-0.8.0/src/haris/ai_security/passive.py +275 -0
  36. haris-0.8.0/src/haris/ai_security/probes.py +82 -0
  37. haris-0.8.0/src/haris/ai_security/rpc.py +64 -0
  38. haris-0.8.0/src/haris/ai_security/scanner.py +68 -0
  39. haris-0.8.0/src/haris/ai_security/signatures.py +67 -0
  40. haris-0.8.0/src/haris/auth/__init__.py +0 -0
  41. haris-0.8.0/src/haris/auth/api_tokens.py +63 -0
  42. haris-0.8.0/src/haris/auth/audit.py +54 -0
  43. haris-0.8.0/src/haris/auth/bearer.py +57 -0
  44. haris-0.8.0/src/haris/auth/bootstrap.py +37 -0
  45. haris-0.8.0/src/haris/auth/config.py +87 -0
  46. haris-0.8.0/src/haris/auth/cookies.py +47 -0
  47. haris-0.8.0/src/haris/auth/csrf.py +65 -0
  48. haris-0.8.0/src/haris/auth/database.py +49 -0
  49. haris-0.8.0/src/haris/auth/email.py +100 -0
  50. haris-0.8.0/src/haris/auth/middleware.py +75 -0
  51. haris-0.8.0/src/haris/auth/models.py +104 -0
  52. haris-0.8.0/src/haris/auth/oidc.py +115 -0
  53. haris-0.8.0/src/haris/auth/public.py +16 -0
  54. haris-0.8.0/src/haris/auth/redirects.py +38 -0
  55. haris-0.8.0/src/haris/auth/security_headers.py +72 -0
  56. haris-0.8.0/src/haris/auth/service.py +276 -0
  57. haris-0.8.0/src/haris/auth/tokens.py +5 -0
  58. haris-0.8.0/src/haris/auth/users.py +167 -0
  59. haris-0.8.0/src/haris/auth/verification.py +94 -0
  60. haris-0.8.0/src/haris/bench/__init__.py +0 -0
  61. haris-0.8.0/src/haris/bench/__main__.py +49 -0
  62. haris-0.8.0/src/haris/bench/render.py +34 -0
  63. haris-0.8.0/src/haris/bench/score.py +205 -0
  64. haris-0.8.0/src/haris/bench/truth.py +87 -0
  65. haris-0.8.0/src/haris/checks/__init__.py +53 -0
  66. haris-0.8.0/src/haris/checks/baseline.py +268 -0
  67. haris-0.8.0/src/haris/checks/cache_checks.py +65 -0
  68. haris-0.8.0/src/haris/checks/cookie_checks.py +257 -0
  69. haris-0.8.0/src/haris/checks/cookie_policy.py +79 -0
  70. haris-0.8.0/src/haris/checks/dns_checks.py +162 -0
  71. haris-0.8.0/src/haris/checks/dns_wire.py +123 -0
  72. haris-0.8.0/src/haris/checks/findings.py +30 -0
  73. haris-0.8.0/src/haris/checks/graphql_checks.py +80 -0
  74. haris-0.8.0/src/haris/checks/header_checks.py +229 -0
  75. haris-0.8.0/src/haris/checks/header_policy.py +175 -0
  76. haris-0.8.0/src/haris/checks/info_disclosure.py +227 -0
  77. haris-0.8.0/src/haris/checks/info_patterns.py +142 -0
  78. haris-0.8.0/src/haris/checks/listing_checks.py +73 -0
  79. haris-0.8.0/src/haris/checks/method_checks.py +74 -0
  80. haris-0.8.0/src/haris/checks/misc_checks.py +237 -0
  81. haris-0.8.0/src/haris/checks/openapi_checks.py +65 -0
  82. haris-0.8.0/src/haris/checks/path_probe.py +50 -0
  83. haris-0.8.0/src/haris/checks/probe_scanner.py +26 -0
  84. haris-0.8.0/src/haris/checks/redirect_checks.py +78 -0
  85. haris-0.8.0/src/haris/checks/requesting.py +69 -0
  86. haris-0.8.0/src/haris/checks/sri_checks.py +85 -0
  87. haris-0.8.0/src/haris/checks/tls_checks.py +216 -0
  88. haris-0.8.0/src/haris/checks/tls_probe.py +150 -0
  89. haris-0.8.0/src/haris/checks/validators.py +173 -0
  90. haris-0.8.0/src/haris/cli.py +27 -0
  91. haris-0.8.0/src/haris/cli_handlers.py +212 -0
  92. haris-0.8.0/src/haris/cli_parser.py +283 -0
  93. haris-0.8.0/src/haris/cli_scan.py +158 -0
  94. haris-0.8.0/src/haris/config/__init__.py +6 -0
  95. haris-0.8.0/src/haris/config/loader.py +205 -0
  96. haris-0.8.0/src/haris/config/paths.py +14 -0
  97. haris-0.8.0/src/haris/core/__init__.py +64 -0
  98. haris-0.8.0/src/haris/core/confidence.py +76 -0
  99. haris-0.8.0/src/haris/core/context_extract.py +106 -0
  100. haris-0.8.0/src/haris/core/correlator.py +64 -0
  101. haris-0.8.0/src/haris/core/decorators.py +83 -0
  102. haris-0.8.0/src/haris/core/engine.py +398 -0
  103. haris-0.8.0/src/haris/core/exit_codes.py +24 -0
  104. haris-0.8.0/src/haris/core/identity.py +93 -0
  105. haris-0.8.0/src/haris/core/llm_enrichment.py +83 -0
  106. haris-0.8.0/src/haris/core/owasp.py +335 -0
  107. haris-0.8.0/src/haris/core/profiles.py +193 -0
  108. haris-0.8.0/src/haris/core/remediation.py +119 -0
  109. haris-0.8.0/src/haris/core/risk.py +221 -0
  110. haris-0.8.0/src/haris/core/runner.py +219 -0
  111. haris-0.8.0/src/haris/core/scanner.py +141 -0
  112. haris-0.8.0/src/haris/core/tool_vet.py +54 -0
  113. haris-0.8.0/src/haris/core/vuln_class.py +66 -0
  114. haris-0.8.0/src/haris/data/__init__.py +1 -0
  115. haris-0.8.0/src/haris/data/scanner_config.py +352 -0
  116. haris-0.8.0/src/haris/db/__init__.py +5 -0
  117. haris-0.8.0/src/haris/db/api_tokens.py +86 -0
  118. haris-0.8.0/src/haris/db/baseline.py +236 -0
  119. haris-0.8.0/src/haris/db/connection.py +22 -0
  120. haris-0.8.0/src/haris/db/findings.py +48 -0
  121. haris-0.8.0/src/haris/db/jobs.py +175 -0
  122. haris-0.8.0/src/haris/db/llm_data.py +119 -0
  123. haris-0.8.0/src/haris/db/migrate.py +70 -0
  124. haris-0.8.0/src/haris/db/migrations/0001_baseline.py +5 -0
  125. haris-0.8.0/src/haris/db/migrations/0002_hash_tokens.py +21 -0
  126. haris-0.8.0/src/haris/db/migrations/0003_finding_identity.py +77 -0
  127. haris-0.8.0/src/haris/db/migrations/0004_scan_owner_state.py +33 -0
  128. haris-0.8.0/src/haris/db/migrations/0005_api_tokens.py +30 -0
  129. haris-0.8.0/src/haris/db/migrations/0006_authorized_targets.py +26 -0
  130. haris-0.8.0/src/haris/db/migrations/0007_job_queue.py +29 -0
  131. haris-0.8.0/src/haris/db/migrations/0008_agent_fields.py +20 -0
  132. haris-0.8.0/src/haris/db/migrations/0009_llm_backend_names.py +20 -0
  133. haris-0.8.0/src/haris/db/scans.py +162 -0
  134. haris-0.8.0/src/haris/db/session_read.py +180 -0
  135. haris-0.8.0/src/haris/db/session_write.py +163 -0
  136. haris-0.8.0/src/haris/db/store.py +149 -0
  137. haris-0.8.0/src/haris/db/targets.py +73 -0
  138. haris-0.8.0/src/haris/db/template_defaults.py +144 -0
  139. haris-0.8.0/src/haris/db/templates.py +157 -0
  140. haris-0.8.0/src/haris/db/websites.py +194 -0
  141. haris-0.8.0/src/haris/diff.py +154 -0
  142. haris-0.8.0/src/haris/ignore.py +111 -0
  143. haris-0.8.0/src/haris/llm/__init__.py +28 -0
  144. haris-0.8.0/src/haris/llm/backend.py +239 -0
  145. haris-0.8.0/src/haris/llm/base.py +75 -0
  146. haris-0.8.0/src/haris/llm/budget.py +119 -0
  147. haris-0.8.0/src/haris/llm/correlation.py +77 -0
  148. haris-0.8.0/src/haris/llm/enrichment.py +117 -0
  149. haris-0.8.0/src/haris/llm/enrichment_prompts.py +86 -0
  150. haris-0.8.0/src/haris/llm/litellm_backend.py +154 -0
  151. haris-0.8.0/src/haris/llm/parsing.py +85 -0
  152. haris-0.8.0/src/haris/llm/prompts.py +253 -0
  153. haris-0.8.0/src/haris/llm/qa.py +249 -0
  154. haris-0.8.0/src/haris/llm/redaction.py +75 -0
  155. haris-0.8.0/src/haris/llm/retriever.py +113 -0
  156. haris-0.8.0/src/haris/llm/retry.py +94 -0
  157. haris-0.8.0/src/haris/llm/router.py +83 -0
  158. haris-0.8.0/src/haris/llm/schemas.py +91 -0
  159. haris-0.8.0/src/haris/llm/settings.py +77 -0
  160. haris-0.8.0/src/haris/llm/structured.py +117 -0
  161. haris-0.8.0/src/haris/llm/template_loader.py +47 -0
  162. haris-0.8.0/src/haris/llm/templates/enrichment/assess_false_positives.j2 +22 -0
  163. haris-0.8.0/src/haris/llm/templates/enrichment/enrich_finding.j2 +33 -0
  164. haris-0.8.0/src/haris/llm/templates/enrichment/identify_attack_chains.j2 +23 -0
  165. haris-0.8.0/src/haris/llm/templates/enrichment/suggest_variants.j2 +26 -0
  166. haris-0.8.0/src/haris/llm/templates/enrichment/system.j2 +7 -0
  167. haris-0.8.0/src/haris/llm/templates/enrichment/triage_findings.j2 +24 -0
  168. haris-0.8.0/src/haris/llm/templates/qa/explain_finding.j2 +12 -0
  169. haris-0.8.0/src/haris/llm/templates/qa/filter_and_explain.j2 +12 -0
  170. haris-0.8.0/src/haris/llm/templates/qa/freeform_question.j2 +6 -0
  171. haris-0.8.0/src/haris/llm/templates/qa/generate_test_cases.j2 +12 -0
  172. haris-0.8.0/src/haris/llm/templates/qa/remediation_plan.j2 +4 -0
  173. haris-0.8.0/src/haris/llm/templates/qa/suggest_mitigations.j2 +12 -0
  174. haris-0.8.0/src/haris/llm/templates/qa/summarize_report.j2 +4 -0
  175. haris-0.8.0/src/haris/llm/templates/qa/system.j2 +8 -0
  176. haris-0.8.0/src/haris/llm/triage.py +97 -0
  177. haris-0.8.0/src/haris/llm/variant_analysis.py +76 -0
  178. haris-0.8.0/src/haris/models/__init__.py +91 -0
  179. haris-0.8.0/src/haris/models/chat.py +41 -0
  180. haris-0.8.0/src/haris/models/config.py +67 -0
  181. haris-0.8.0/src/haris/models/correlator.py +25 -0
  182. haris-0.8.0/src/haris/models/enrichment.py +69 -0
  183. haris-0.8.0/src/haris/models/enums.py +146 -0
  184. haris-0.8.0/src/haris/models/finding.py +131 -0
  185. haris-0.8.0/src/haris/models/llm.py +18 -0
  186. haris-0.8.0/src/haris/models/owasp.py +67 -0
  187. haris-0.8.0/src/haris/models/profiles.py +18 -0
  188. haris-0.8.0/src/haris/models/remediation.py +36 -0
  189. haris-0.8.0/src/haris/models/risk.py +12 -0
  190. haris-0.8.0/src/haris/models/scan_config_template.py +60 -0
  191. haris-0.8.0/src/haris/models/scan_context.py +80 -0
  192. haris-0.8.0/src/haris/models/scanner.py +34 -0
  193. haris-0.8.0/src/haris/models/session.py +124 -0
  194. haris-0.8.0/src/haris/models/target.py +230 -0
  195. haris-0.8.0/src/haris/models/templates.py +82 -0
  196. haris-0.8.0/src/haris/models/verification.py +69 -0
  197. haris-0.8.0/src/haris/net/__init__.py +28 -0
  198. haris-0.8.0/src/haris/net/egress_proxy.py +199 -0
  199. haris-0.8.0/src/haris/net/errors.py +18 -0
  200. haris-0.8.0/src/haris/net/policy.py +22 -0
  201. haris-0.8.0/src/haris/net/ratelimit.py +53 -0
  202. haris-0.8.0/src/haris/net/redact.py +16 -0
  203. haris-0.8.0/src/haris/net/requestlog.py +76 -0
  204. haris-0.8.0/src/haris/net/retry.py +20 -0
  205. haris-0.8.0/src/haris/net/scoped_client.py +353 -0
  206. haris-0.8.0/src/haris/net/ssrf.py +86 -0
  207. haris-0.8.0/src/haris/net/transport.py +108 -0
  208. haris-0.8.0/src/haris/reporting/__init__.py +65 -0
  209. haris-0.8.0/src/haris/reporting/base.py +28 -0
  210. haris-0.8.0/src/haris/reporting/csv_report.py +59 -0
  211. haris-0.8.0/src/haris/reporting/escape.py +43 -0
  212. haris-0.8.0/src/haris/reporting/findings.py +33 -0
  213. haris-0.8.0/src/haris/reporting/html_report.py +126 -0
  214. haris-0.8.0/src/haris/reporting/json_report.py +48 -0
  215. haris-0.8.0/src/haris/reporting/junit_report.py +66 -0
  216. haris-0.8.0/src/haris/reporting/markdown_report.py +239 -0
  217. haris-0.8.0/src/haris/reporting/report_schema.py +93 -0
  218. haris-0.8.0/src/haris/reporting/sarif_report.py +196 -0
  219. haris-0.8.0/src/haris/resources/__init__.py +0 -0
  220. haris-0.8.0/src/haris/resources/config/agent.yaml +24 -0
  221. haris-0.8.0/src/haris/resources/config/ai_mappings.yaml +221 -0
  222. haris-0.8.0/src/haris/resources/config/ai_probes.yaml +47 -0
  223. haris-0.8.0/src/haris/resources/config/ai_signatures.yaml +168 -0
  224. haris-0.8.0/src/haris/resources/config/confidence.yaml +73 -0
  225. haris-0.8.0/src/haris/resources/config/default_config.yaml +161 -0
  226. haris-0.8.0/src/haris/resources/config/llm_models.yaml +34 -0
  227. haris-0.8.0/src/haris/resources/config/scanner_data.yaml +43 -0
  228. haris-0.8.0/src/haris/resources/config/scanners/garak.yaml +14 -0
  229. haris-0.8.0/src/haris/resources/config/scanners/nikto.yaml +116 -0
  230. haris-0.8.0/src/haris/resources/config/scanners/nmap.yaml +48 -0
  231. haris-0.8.0/src/haris/resources/config/scanners/nuclei.yaml +354 -0
  232. haris-0.8.0/src/haris/resources/config/scanners/promptfoo.yaml +23 -0
  233. haris-0.8.0/src/haris/resources/config/scanners/sslyze.yaml +64 -0
  234. haris-0.8.0/src/haris/resources/config/scanners/wapiti.yaml +83 -0
  235. haris-0.8.0/src/haris/resources/config/scanners/zap.yaml +22 -0
  236. haris-0.8.0/src/haris/resources/config/verify.yaml +87 -0
  237. haris-0.8.0/src/haris/resources/config/vuln_classes.yaml +364 -0
  238. haris-0.8.0/src/haris/resources/schema/report.schema.json +683 -0
  239. haris-0.8.0/src/haris/scan_files.py +30 -0
  240. haris-0.8.0/src/haris/scanners/__init__.py +45 -0
  241. haris-0.8.0/src/haris/scanners/argv_policy.py +47 -0
  242. haris-0.8.0/src/haris/scanners/base.py +117 -0
  243. haris-0.8.0/src/haris/scanners/garak_scanner.py +182 -0
  244. haris-0.8.0/src/haris/scanners/nikto_scanner.py +276 -0
  245. haris-0.8.0/src/haris/scanners/nmap_scanner.py +274 -0
  246. haris-0.8.0/src/haris/scanners/nuclei_argv.py +148 -0
  247. haris-0.8.0/src/haris/scanners/nuclei_results.py +195 -0
  248. haris-0.8.0/src/haris/scanners/nuclei_scanner.py +435 -0
  249. haris-0.8.0/src/haris/scanners/nuclei_selection.py +171 -0
  250. haris-0.8.0/src/haris/scanners/nuclei_templates.py +26 -0
  251. haris-0.8.0/src/haris/scanners/nuclei_urls.py +62 -0
  252. haris-0.8.0/src/haris/scanners/option_policy.py +246 -0
  253. haris-0.8.0/src/haris/scanners/option_values.py +77 -0
  254. haris-0.8.0/src/haris/scanners/process.py +60 -0
  255. haris-0.8.0/src/haris/scanners/promptfoo_scanner.py +246 -0
  256. haris-0.8.0/src/haris/scanners/redaction.py +66 -0
  257. haris-0.8.0/src/haris/scanners/sslyze_scanner.py +262 -0
  258. haris-0.8.0/src/haris/scanners/wapiti_exclude.py +27 -0
  259. haris-0.8.0/src/haris/scanners/wapiti_scanner.py +274 -0
  260. haris-0.8.0/src/haris/scanners/wapiti_seed.py +18 -0
  261. haris-0.8.0/src/haris/scanners/wapiti_session.py +104 -0
  262. haris-0.8.0/src/haris/scanners/zap_plan.py +155 -0
  263. haris-0.8.0/src/haris/scanners/zap_scanner.py +243 -0
  264. haris-0.8.0/src/haris/templates/__init__.py +9 -0
  265. haris-0.8.0/src/haris/templates/adapters.py +336 -0
  266. haris-0.8.0/src/haris/templates/manager.py +174 -0
  267. haris-0.8.0/src/haris/templates/report.py +49 -0
  268. haris-0.8.0/src/haris/templates/updater.py +201 -0
  269. haris-0.8.0/src/haris/verify/__init__.py +15 -0
  270. haris-0.8.0/src/haris/verify/evidence.py +41 -0
  271. haris-0.8.0/src/haris/verify/llm_verdict.py +172 -0
  272. haris-0.8.0/src/haris/verify/oracles.py +165 -0
  273. haris-0.8.0/src/haris/verify/oracles_active.py +189 -0
  274. haris-0.8.0/src/haris/verify/oracles_baseline.py +84 -0
  275. haris-0.8.0/src/haris/verify/pipeline.py +66 -0
  276. haris-0.8.0/src/haris/verify/probe.py +128 -0
  277. haris-0.8.0/src/haris/verify/registry.py +42 -0
  278. haris-0.8.0/src/haris/verify/replay.py +144 -0
  279. haris-0.8.0/src/haris/verify/settings.py +84 -0
  280. haris-0.8.0/src/haris/verify/timing.py +72 -0
  281. haris-0.8.0/src/haris/verify/verdict_prompt.py +77 -0
  282. haris-0.8.0/src/haris/web/__init__.py +1 -0
  283. haris-0.8.0/src/haris/web/access.py +64 -0
  284. haris-0.8.0/src/haris/web/agent_gate.py +158 -0
  285. haris-0.8.0/src/haris/web/app.py +107 -0
  286. haris-0.8.0/src/haris/web/conversations.py +51 -0
  287. haris-0.8.0/src/haris/web/job_queue.py +148 -0
  288. haris-0.8.0/src/haris/web/llm_support.py +102 -0
  289. haris-0.8.0/src/haris/web/logging_setup.py +23 -0
  290. haris-0.8.0/src/haris/web/page_data.py +19 -0
  291. haris-0.8.0/src/haris/web/routers/__init__.py +43 -0
  292. haris-0.8.0/src/haris/web/routers/account.py +88 -0
  293. haris-0.8.0/src/haris/web/routers/admin.py +153 -0
  294. haris-0.8.0/src/haris/web/routers/admin_api.py +15 -0
  295. haris-0.8.0/src/haris/web/routers/auth_login.py +309 -0
  296. haris-0.8.0/src/haris/web/routers/health.py +8 -0
  297. haris-0.8.0/src/haris/web/routers/llm_chat.py +164 -0
  298. haris-0.8.0/src/haris/web/routers/llm_scan.py +96 -0
  299. haris-0.8.0/src/haris/web/routers/oidc.py +76 -0
  300. haris-0.8.0/src/haris/web/routers/pages.py +152 -0
  301. haris-0.8.0/src/haris/web/routers/scan_data.py +92 -0
  302. haris-0.8.0/src/haris/web/routers/scan_templates.py +106 -0
  303. haris-0.8.0/src/haris/web/routers/scans.py +93 -0
  304. haris-0.8.0/src/haris/web/routers/scans_api.py +336 -0
  305. haris-0.8.0/src/haris/web/routers/targets.py +85 -0
  306. haris-0.8.0/src/haris/web/routers/templates_api.py +228 -0
  307. haris-0.8.0/src/haris/web/routers/tokens.py +78 -0
  308. haris-0.8.0/src/haris/web/routers/websites.py +58 -0
  309. haris-0.8.0/src/haris/web/routers/websites_api.py +50 -0
  310. haris-0.8.0/src/haris/web/routing.py +80 -0
  311. haris-0.8.0/src/haris/web/scan_runtime.py +169 -0
  312. haris-0.8.0/src/haris/web/scanner_info.py +32 -0
  313. haris-0.8.0/src/haris/web/schemas/__init__.py +0 -0
  314. haris-0.8.0/src/haris/web/schemas/access.py +46 -0
  315. haris-0.8.0/src/haris/web/schemas/llm.py +101 -0
  316. haris-0.8.0/src/haris/web/schemas/scans.py +58 -0
  317. haris-0.8.0/src/haris/web/schemas/sites.py +77 -0
  318. haris-0.8.0/src/haris/web/settings.py +46 -0
  319. haris-0.8.0/src/haris/web/state.py +40 -0
  320. haris-0.8.0/src/haris/web/static/css/findings.css +248 -0
  321. haris-0.8.0/src/haris/web/static/css/fonts.css +28 -0
  322. haris-0.8.0/src/haris/web/static/css/layout.css +241 -0
  323. haris-0.8.0/src/haris/web/static/css/pages.css +220 -0
  324. haris-0.8.0/src/haris/web/static/css/template_form.css +54 -0
  325. haris-0.8.0/src/haris/web/static/favicon.svg +4 -0
  326. haris-0.8.0/src/haris/web/static/haris_logo.png +0 -0
  327. haris-0.8.0/src/haris/web/static/js/dashboard.js +12 -0
  328. haris-0.8.0/src/haris/web/static/js/login.js +4 -0
  329. haris-0.8.0/src/haris/web/static/js/password_form.js +25 -0
  330. haris-0.8.0/src/haris/web/static/js/profile.js +16 -0
  331. haris-0.8.0/src/haris/web/static/js/reload.js +1 -0
  332. haris-0.8.0/src/haris/web/static/js/scan_detail.js +161 -0
  333. haris-0.8.0/src/haris/web/static/js/scan_new.js +97 -0
  334. haris-0.8.0/src/haris/web/static/js/scans.js +8 -0
  335. haris-0.8.0/src/haris/web/static/js/template_form.js +303 -0
  336. haris-0.8.0/src/haris/web/static/js/templates_page.js +102 -0
  337. haris-0.8.0/src/haris/web/static/js/users.js +44 -0
  338. haris-0.8.0/src/haris/web/static/js/website_detail.js +98 -0
  339. haris-0.8.0/src/haris/web/static/main.js +135 -0
  340. haris-0.8.0/src/haris/web/static/style.css +335 -0
  341. haris-0.8.0/src/haris/web/static/theme-init.js +4 -0
  342. haris-0.8.0/src/haris/web/static/vendor/LICENSE.chartjs +9 -0
  343. haris-0.8.0/src/haris/web/static/vendor/LICENSE.dompurify +202 -0
  344. haris-0.8.0/src/haris/web/static/vendor/LICENSE.htmx +13 -0
  345. haris-0.8.0/src/haris/web/static/vendor/LICENSE.inter +93 -0
  346. haris-0.8.0/src/haris/web/static/vendor/LICENSE.marked +44 -0
  347. haris-0.8.0/src/haris/web/static/vendor/README +32 -0
  348. haris-0.8.0/src/haris/web/static/vendor/chart.umd.min.js +14 -0
  349. haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-400-normal.woff2 +0 -0
  350. haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-500-normal.woff2 +0 -0
  351. haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-600-normal.woff2 +0 -0
  352. haris-0.8.0/src/haris/web/static/vendor/fonts/inter-latin-700-normal.woff2 +0 -0
  353. haris-0.8.0/src/haris/web/static/vendor/htmx.min.js +1 -0
  354. haris-0.8.0/src/haris/web/static/vendor/marked.umd.js +86 -0
  355. haris-0.8.0/src/haris/web/static/vendor/purify.min.js +7 -0
  356. haris-0.8.0/src/haris/web/targets.py +190 -0
  357. haris-0.8.0/src/haris/web/templates/_scan_rows.html +43 -0
  358. haris-0.8.0/src/haris/web/templates/auth/audit_log.html +107 -0
  359. haris-0.8.0/src/haris/web/templates/auth/login.html +101 -0
  360. haris-0.8.0/src/haris/web/templates/auth/profile.html +165 -0
  361. haris-0.8.0/src/haris/web/templates/auth/register.html +85 -0
  362. haris-0.8.0/src/haris/web/templates/auth/setup.html +88 -0
  363. haris-0.8.0/src/haris/web/templates/auth/users.html +155 -0
  364. haris-0.8.0/src/haris/web/templates/auth/verify_email.html +54 -0
  365. haris-0.8.0/src/haris/web/templates/base.html +121 -0
  366. haris-0.8.0/src/haris/web/templates/dashboard.html +113 -0
  367. haris-0.8.0/src/haris/web/templates/licenses.html +82 -0
  368. haris-0.8.0/src/haris/web/templates/partials/scan_ai_insights.html +82 -0
  369. haris-0.8.0/src/haris/web/templates/partials/template_form_scanners_b.html +198 -0
  370. haris-0.8.0/src/haris/web/templates/scan_detail.html +332 -0
  371. haris-0.8.0/src/haris/web/templates/scan_new.html +147 -0
  372. haris-0.8.0/src/haris/web/templates/scans.html +89 -0
  373. haris-0.8.0/src/haris/web/templates/settings.html +56 -0
  374. haris-0.8.0/src/haris/web/templates/template_form.html +321 -0
  375. haris-0.8.0/src/haris/web/templates/templates.html +190 -0
  376. haris-0.8.0/src/haris/web/templates/website_detail.html +111 -0
  377. haris-0.8.0/src/haris/web/templates/websites.html +42 -0
  378. haris-0.8.0/src/haris/web/templating.py +38 -0
  379. haris-0.8.0/src/haris.egg-info/PKG-INFO +204 -0
  380. haris-0.8.0/src/haris.egg-info/SOURCES.txt +541 -0
  381. haris-0.8.0/src/haris.egg-info/dependency_links.txt +1 -0
  382. haris-0.8.0/src/haris.egg-info/entry_points.txt +2 -0
  383. haris-0.8.0/src/haris.egg-info/requires.txt +25 -0
  384. haris-0.8.0/src/haris.egg-info/top_level.txt +1 -0
  385. haris-0.8.0/tests/test_agent_budget.py +183 -0
  386. haris-0.8.0/tests/test_agent_docker.py +194 -0
  387. haris-0.8.0/tests/test_agent_fields.py +102 -0
  388. haris-0.8.0/tests/test_agent_guardrails.py +137 -0
  389. haris-0.8.0/tests/test_agent_injection.py +110 -0
  390. haris-0.8.0/tests/test_agent_policy.py +153 -0
  391. haris-0.8.0/tests/test_agent_post_reexec.py +277 -0
  392. haris-0.8.0/tests/test_agent_proxy.py +245 -0
  393. haris-0.8.0/tests/test_agent_runtime.py +60 -0
  394. haris-0.8.0/tests/test_agent_sandbox_probe.py +48 -0
  395. haris-0.8.0/tests/test_agent_stage.py +89 -0
  396. haris-0.8.0/tests/test_agent_tunnel.py +44 -0
  397. haris-0.8.0/tests/test_agent_validator.py +208 -0
  398. haris-0.8.0/tests/test_ai_active.py +325 -0
  399. haris-0.8.0/tests/test_ai_adapter_gate.py +46 -0
  400. haris-0.8.0/tests/test_ai_adapter_preflight.py +157 -0
  401. haris-0.8.0/tests/test_ai_classes.py +33 -0
  402. haris-0.8.0/tests/test_ai_cli.py +79 -0
  403. haris-0.8.0/tests/test_ai_discovery.py +127 -0
  404. haris-0.8.0/tests/test_ai_garak.py +169 -0
  405. haris-0.8.0/tests/test_ai_mcp.py +245 -0
  406. haris-0.8.0/tests/test_ai_owasp.py +130 -0
  407. haris-0.8.0/tests/test_ai_passive.py +197 -0
  408. haris-0.8.0/tests/test_ai_promptfoo.py +199 -0
  409. haris-0.8.0/tests/test_ai_sse.py +48 -0
  410. haris-0.8.0/tests/test_auth_email.py +350 -0
  411. haris-0.8.0/tests/test_auth_fixes.py +181 -0
  412. haris-0.8.0/tests/test_auth_oidc.py +186 -0
  413. haris-0.8.0/tests/test_auth_service.py +570 -0
  414. haris-0.8.0/tests/test_bench_callback.py +213 -0
  415. haris-0.8.0/tests/test_bench_fixtures.py +175 -0
  416. haris-0.8.0/tests/test_bench_ground_truth.py +198 -0
  417. haris-0.8.0/tests/test_bench_in_image.py +43 -0
  418. haris-0.8.0/tests/test_bench_login.py +310 -0
  419. haris-0.8.0/tests/test_bench_run.py +227 -0
  420. haris-0.8.0/tests/test_bench_scanner_args.py +113 -0
  421. haris-0.8.0/tests/test_bench_score.py +418 -0
  422. haris-0.8.0/tests/test_calibrate_abstain.py +306 -0
  423. haris-0.8.0/tests/test_chat.py +163 -0
  424. haris-0.8.0/tests/test_check_litellm.py +81 -0
  425. haris-0.8.0/tests/test_checks_baseline.py +278 -0
  426. haris-0.8.0/tests/test_checks_cookies.py +187 -0
  427. haris-0.8.0/tests/test_checks_dns.py +145 -0
  428. haris-0.8.0/tests/test_checks_exposure.py +151 -0
  429. haris-0.8.0/tests/test_checks_headers.py +205 -0
  430. haris-0.8.0/tests/test_checks_info.py +173 -0
  431. haris-0.8.0/tests/test_checks_probes.py +229 -0
  432. haris-0.8.0/tests/test_checks_registry.py +78 -0
  433. haris-0.8.0/tests/test_checks_tls.py +128 -0
  434. haris-0.8.0/tests/test_cli_exit.py +146 -0
  435. haris-0.8.0/tests/test_cli_web.py +24 -0
  436. haris-0.8.0/tests/test_config_paths.py +24 -0
  437. haris-0.8.0/tests/test_config_scope.py +14 -0
  438. haris-0.8.0/tests/test_correlator.py +146 -0
  439. haris-0.8.0/tests/test_db.py +333 -0
  440. haris-0.8.0/tests/test_db_identity.py +160 -0
  441. haris-0.8.0/tests/test_db_jobs.py +98 -0
  442. haris-0.8.0/tests/test_db_ownership.py +104 -0
  443. haris-0.8.0/tests/test_db_rollback.py +70 -0
  444. haris-0.8.0/tests/test_db_scope.py +96 -0
  445. haris-0.8.0/tests/test_docker_exec.py +149 -0
  446. haris-0.8.0/tests/test_egress_proxy.py +248 -0
  447. haris-0.8.0/tests/test_engine.py +453 -0
  448. haris-0.8.0/tests/test_engine_egress.py +82 -0
  449. haris-0.8.0/tests/test_engine_pipeline.py +293 -0
  450. haris-0.8.0/tests/test_enrichment.py +344 -0
  451. haris-0.8.0/tests/test_excluded_paths_syntax.py +55 -0
  452. haris-0.8.0/tests/test_finding.py +189 -0
  453. haris-0.8.0/tests/test_identity.py +177 -0
  454. haris-0.8.0/tests/test_ignore_diff.py +252 -0
  455. haris-0.8.0/tests/test_image_security.py +32 -0
  456. haris-0.8.0/tests/test_l6_jsonrpc.py +8 -0
  457. haris-0.8.0/tests/test_litellm_backend.py +392 -0
  458. haris-0.8.0/tests/test_llm.py +236 -0
  459. haris-0.8.0/tests/test_llm_backend_names.py +150 -0
  460. haris-0.8.0/tests/test_llm_budget.py +155 -0
  461. haris-0.8.0/tests/test_llm_injection.py +142 -0
  462. haris-0.8.0/tests/test_llm_parsing.py +93 -0
  463. haris-0.8.0/tests/test_llm_pricing.py +68 -0
  464. haris-0.8.0/tests/test_llm_redaction.py +98 -0
  465. haris-0.8.0/tests/test_llm_retry.py +102 -0
  466. haris-0.8.0/tests/test_llm_settings.py +47 -0
  467. haris-0.8.0/tests/test_migration_llm_backend_names.py +123 -0
  468. haris-0.8.0/tests/test_migrations.py +148 -0
  469. haris-0.8.0/tests/test_nikto_interesting_path.py +131 -0
  470. haris-0.8.0/tests/test_no_provider_key_names.py +17 -0
  471. haris-0.8.0/tests/test_nuclei_argv_golden.py +242 -0
  472. haris-0.8.0/tests/test_nuclei_groups.py +369 -0
  473. haris-0.8.0/tests/test_nuclei_phase2_bound.py +175 -0
  474. haris-0.8.0/tests/test_nuclei_phases.py +351 -0
  475. haris-0.8.0/tests/test_nuclei_scanner.py +694 -0
  476. haris-0.8.0/tests/test_nuclei_selection.py +279 -0
  477. haris-0.8.0/tests/test_option_policy.py +159 -0
  478. haris-0.8.0/tests/test_owasp.py +72 -0
  479. haris-0.8.0/tests/test_owasp_class_coverage.py +110 -0
  480. haris-0.8.0/tests/test_profiles.py +40 -0
  481. haris-0.8.0/tests/test_ratelimit.py +50 -0
  482. haris-0.8.0/tests/test_remediation.py +101 -0
  483. haris-0.8.0/tests/test_report_escape.py +132 -0
  484. haris-0.8.0/tests/test_report_integrations.py +23 -0
  485. haris-0.8.0/tests/test_report_sarif.py +97 -0
  486. haris-0.8.0/tests/test_report_schema.py +73 -0
  487. haris-0.8.0/tests/test_report_tabular.py +75 -0
  488. haris-0.8.0/tests/test_reporting.py +165 -0
  489. haris-0.8.0/tests/test_retriever.py +360 -0
  490. haris-0.8.0/tests/test_risk.py +104 -0
  491. haris-0.8.0/tests/test_router.py +170 -0
  492. haris-0.8.0/tests/test_runner.py +194 -0
  493. haris-0.8.0/tests/test_scan_config_templates.py +613 -0
  494. haris-0.8.0/tests/test_scan_context.py +106 -0
  495. haris-0.8.0/tests/test_scanner_binding.py +318 -0
  496. haris-0.8.0/tests/test_scanner_config.py +68 -0
  497. haris-0.8.0/tests/test_scanner_golden.py +369 -0
  498. haris-0.8.0/tests/test_scanner_rate_flags.py +210 -0
  499. haris-0.8.0/tests/test_scanner_runtime.py +272 -0
  500. haris-0.8.0/tests/test_scanner_status.py +182 -0
  501. haris-0.8.0/tests/test_schema_v6.py +225 -0
  502. haris-0.8.0/tests/test_scoped_client.py +362 -0
  503. haris-0.8.0/tests/test_scoped_stream.py +197 -0
  504. haris-0.8.0/tests/test_session_revoke.py +32 -0
  505. haris-0.8.0/tests/test_sslyze_applicability.py +145 -0
  506. haris-0.8.0/tests/test_ssrf.py +151 -0
  507. haris-0.8.0/tests/test_target.py +174 -0
  508. haris-0.8.0/tests/test_templates.py +543 -0
  509. haris-0.8.0/tests/test_tool_vet.py +67 -0
  510. haris-0.8.0/tests/test_verify_baseline_oracles.py +249 -0
  511. haris-0.8.0/tests/test_verify_llm.py +425 -0
  512. haris-0.8.0/tests/test_verify_oracles.py +301 -0
  513. haris-0.8.0/tests/test_verify_oracles_active.py +268 -0
  514. haris-0.8.0/tests/test_verify_pipeline.py +207 -0
  515. haris-0.8.0/tests/test_verify_redirect_catch_all.py +43 -0
  516. haris-0.8.0/tests/test_verify_replay_fields.py +182 -0
  517. haris-0.8.0/tests/test_verify_replay_multi.py +130 -0
  518. haris-0.8.0/tests/test_verify_unclassified_external.py +124 -0
  519. haris-0.8.0/tests/test_verify_uncommon_header.py +93 -0
  520. haris-0.8.0/tests/test_verify_wapiti_oracles.py +173 -0
  521. haris-0.8.0/tests/test_vuln_class_external_aliases.py +178 -0
  522. haris-0.8.0/tests/test_vuln_class_wapiti.py +75 -0
  523. haris-0.8.0/tests/test_wapiti_argv.py +161 -0
  524. haris-0.8.0/tests/test_wapiti_seed.py +56 -0
  525. haris-0.8.0/tests/test_wapiti_session.py +216 -0
  526. haris-0.8.0/tests/test_web_agent.py +283 -0
  527. haris-0.8.0/tests/test_web_agent_gate_audit.py +146 -0
  528. haris-0.8.0/tests/test_web_auth_fixes.py +386 -0
  529. haris-0.8.0/tests/test_web_csrf.py +236 -0
  530. haris-0.8.0/tests/test_web_env.py +277 -0
  531. haris-0.8.0/tests/test_web_execute.py +172 -0
  532. haris-0.8.0/tests/test_web_llm.py +197 -0
  533. haris-0.8.0/tests/test_web_llm_config.py +331 -0
  534. haris-0.8.0/tests/test_web_ownership.py +249 -0
  535. haris-0.8.0/tests/test_web_proofs.py +250 -0
  536. haris-0.8.0/tests/test_web_queue.py +294 -0
  537. haris-0.8.0/tests/test_web_routes.py +246 -0
  538. haris-0.8.0/tests/test_web_scanner_options.py +123 -0
  539. haris-0.8.0/tests/test_web_targets.py +140 -0
  540. haris-0.8.0/tests/test_web_templates.py +294 -0
  541. haris-0.8.0/tests/test_web_tokens.py +338 -0
  542. haris-0.8.0/tests/test_web_verify.py +171 -0
  543. 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,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,6 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
3
+ try:
4
+ __version__ = version("haris")
5
+ except PackageNotFoundError:
6
+ __version__ = "0+unknown"
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())
@@ -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()