hunterxsec 7.0.0__py3-none-any.whl
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.
- hunterx/__init__.py +45 -0
- hunterx/agents/__init__.py +30 -0
- hunterx/agents/base.py +71 -0
- hunterx/agents/capabilities.py +27 -0
- hunterx/agents/context.py +27 -0
- hunterx/agents/coordinator.py +55 -0
- hunterx/agents/events.py +28 -0
- hunterx/agents/memory.py +51 -0
- hunterx/agents/messaging.py +32 -0
- hunterx/agents/orchestrator.py +59 -0
- hunterx/agents/registry.py +44 -0
- hunterx/agents/scheduler.py +95 -0
- hunterx/agents/state.py +17 -0
- hunterx/api/__init__.py +16 -0
- hunterx/api/adaptive_mission_planning.py +123 -0
- hunterx/api/app.py +123 -0
- hunterx/api/auth.py +90 -0
- hunterx/api/deps.py +55 -0
- hunterx/api/finding.py +146 -0
- hunterx/api/middleware.py +59 -0
- hunterx/api/mission_dashboard.py +51 -0
- hunterx/api/mission_orchestration.py +201 -0
- hunterx/api/reporting.py +129 -0
- hunterx/api/router.py +90 -0
- hunterx/api/schemas.py +29 -0
- hunterx/api/target_memory.py +127 -0
- hunterx/api/tools.py +222 -0
- hunterx/application/__init__.py +35 -0
- hunterx/application/adaptive_mission_planning.py +850 -0
- hunterx/application/auth.py +1837 -0
- hunterx/application/authorization.py +2005 -0
- hunterx/application/cloud.py +2294 -0
- hunterx/application/crawl.py +1099 -0
- hunterx/application/dns.py +617 -0
- hunterx/application/dto.py +48 -0
- hunterx/application/findings.py +55 -0
- hunterx/application/javascript.py +1255 -0
- hunterx/application/livehost.py +602 -0
- hunterx/application/mission_dashboard.py +255 -0
- hunterx/application/mission_orchestration.py +911 -0
- hunterx/application/mission_planning.py +114 -0
- hunterx/application/missions.py +102 -0
- hunterx/application/observability.py +184 -0
- hunterx/application/orchestration.py +87 -0
- hunterx/application/professional_reporting.py +1666 -0
- hunterx/application/recon.py +475 -0
- hunterx/application/reports.py +46 -0
- hunterx/application/target_intelligence.py +1026 -0
- hunterx/application/target_memory.py +1594 -0
- hunterx/application/technology.py +1068 -0
- hunterx/application/tool_factory.py +102 -0
- hunterx/application/toolchain.py +1012 -0
- hunterx/application/topology.py +767 -0
- hunterx/application/vulnerability.py +1187 -0
- hunterx/application/vulnerability_finding.py +1987 -0
- hunterx/application/vulnerability_proof.py +2424 -0
- hunterx/application/vulnerability_proof_strategy.py +854 -0
- hunterx/application/vulnerability_validation.py +1906 -0
- hunterx/architecture/__init__.py +35 -0
- hunterx/architecture/__main__.py +13 -0
- hunterx/architecture/cli.py +266 -0
- hunterx/architecture/cycles.py +151 -0
- hunterx/architecture/docs.py +125 -0
- hunterx/architecture/imports.py +225 -0
- hunterx/architecture/layers.py +236 -0
- hunterx/architecture/lint.py +439 -0
- hunterx/architecture/policy.py +535 -0
- hunterx/architecture/report.py +218 -0
- hunterx/architecture/stability.py +234 -0
- hunterx/architecture/violations.py +151 -0
- hunterx/cache.py +12 -0
- hunterx/cli/__init__.py +17 -0
- hunterx/cli/app.py +66 -0
- hunterx/cli/commands.py +836 -0
- hunterx/cli/registry.py +61 -0
- hunterx/cli/render.py +76 -0
- hunterx/config/__init__.py +30 -0
- hunterx/config/hunterx.yaml +34 -0
- hunterx/config/loader.py +150 -0
- hunterx/config/settings.py +108 -0
- hunterx/domain/__init__.py +15 -0
- hunterx/domain/adaptive_mission_planning/__init__.py +182 -0
- hunterx/domain/adaptive_mission_planning/attack_path.py +317 -0
- hunterx/domain/adaptive_mission_planning/catalog.py +179 -0
- hunterx/domain/adaptive_mission_planning/checkpoint.py +65 -0
- hunterx/domain/adaptive_mission_planning/decision.py +380 -0
- hunterx/domain/adaptive_mission_planning/enums.py +345 -0
- hunterx/domain/adaptive_mission_planning/graph.py +335 -0
- hunterx/domain/adaptive_mission_planning/mission.py +222 -0
- hunterx/domain/adaptive_mission_planning/models.py +836 -0
- hunterx/domain/adaptive_mission_planning/objective.py +377 -0
- hunterx/domain/adaptive_mission_planning/policy.py +299 -0
- hunterx/domain/adaptive_mission_planning/replan.py +340 -0
- hunterx/domain/adaptive_mission_planning/resource.py +101 -0
- hunterx/domain/adaptive_mission_planning/scoring.py +176 -0
- hunterx/domain/adaptive_mission_planning/state.py +173 -0
- hunterx/domain/adaptive_mission_planning/toolchain.py +299 -0
- hunterx/domain/api/__init__.py +89 -0
- hunterx/domain/api/classification.py +174 -0
- hunterx/domain/api/confidence.py +141 -0
- hunterx/domain/api/conflicts.py +107 -0
- hunterx/domain/api/correlator.py +214 -0
- hunterx/domain/api/history.py +278 -0
- hunterx/domain/api/models.py +1305 -0
- hunterx/domain/api/parsers/__init__.py +34 -0
- hunterx/domain/api/parsers/graphql.py +173 -0
- hunterx/domain/api/parsers/hints.py +462 -0
- hunterx/domain/api/parsers/openapi.py +445 -0
- hunterx/domain/api/parsers/postman.py +236 -0
- hunterx/domain/api/parsers/soap.py +215 -0
- hunterx/domain/api/parsers/websocket.py +106 -0
- hunterx/domain/api/scope.py +222 -0
- hunterx/domain/api/strategy.py +138 -0
- hunterx/domain/api/validator.py +77 -0
- hunterx/domain/auth/__init__.py +138 -0
- hunterx/domain/auth/analyzer.py +2476 -0
- hunterx/domain/auth/classification.py +109 -0
- hunterx/domain/auth/confidence.py +151 -0
- hunterx/domain/auth/correlator.py +228 -0
- hunterx/domain/auth/history.py +205 -0
- hunterx/domain/auth/models.py +1658 -0
- hunterx/domain/auth/scope.py +228 -0
- hunterx/domain/auth/strategy.py +144 -0
- hunterx/domain/auth/validator.py +93 -0
- hunterx/domain/authorization/__init__.py +185 -0
- hunterx/domain/authorization/analyzer.py +2829 -0
- hunterx/domain/authorization/classification.py +147 -0
- hunterx/domain/authorization/confidence.py +152 -0
- hunterx/domain/authorization/correlator.py +261 -0
- hunterx/domain/authorization/history.py +223 -0
- hunterx/domain/authorization/models.py +1831 -0
- hunterx/domain/authorization/scope.py +228 -0
- hunterx/domain/authorization/strategy.py +147 -0
- hunterx/domain/authorization/validator.py +93 -0
- hunterx/domain/cloud/__init__.py +157 -0
- hunterx/domain/cloud/analyzer.py +1540 -0
- hunterx/domain/cloud/classification.py +321 -0
- hunterx/domain/cloud/confidence.py +145 -0
- hunterx/domain/cloud/conflicts.py +119 -0
- hunterx/domain/cloud/correlator.py +211 -0
- hunterx/domain/cloud/history.py +215 -0
- hunterx/domain/cloud/models.py +1782 -0
- hunterx/domain/cloud/providers.py +2956 -0
- hunterx/domain/cloud/redaction.py +123 -0
- hunterx/domain/cloud/scope.py +199 -0
- hunterx/domain/cloud/strategy.py +85 -0
- hunterx/domain/cloud/validator.py +104 -0
- hunterx/domain/dns/__init__.py +81 -0
- hunterx/domain/dns/confidence.py +148 -0
- hunterx/domain/dns/conflicts.py +101 -0
- hunterx/domain/dns/correlator.py +194 -0
- hunterx/domain/dns/dnssec.py +167 -0
- hunterx/domain/dns/history.py +150 -0
- hunterx/domain/dns/mail.py +200 -0
- hunterx/domain/dns/models.py +679 -0
- hunterx/domain/dns/normalizer.py +192 -0
- hunterx/domain/dns/scope.py +181 -0
- hunterx/domain/dns/strategy.py +158 -0
- hunterx/domain/dns/validator.py +142 -0
- hunterx/domain/dns/wildcard.py +182 -0
- hunterx/domain/entities/__init__.py +43 -0
- hunterx/domain/entities/_tidb_fields.py +111 -0
- hunterx/domain/entities/asset.py +46 -0
- hunterx/domain/entities/dashboard.py +129 -0
- hunterx/domain/entities/evidence.py +66 -0
- hunterx/domain/entities/finding.py +129 -0
- hunterx/domain/entities/mission.py +130 -0
- hunterx/domain/entities/report.py +71 -0
- hunterx/domain/entities/scan.py +60 -0
- hunterx/domain/entities/target.py +74 -0
- hunterx/domain/entities/tidb/__init__.py +897 -0
- hunterx/domain/entities/tidb/_base.py +90 -0
- hunterx/domain/entities/tidb/adaptive_mission_planning.py +260 -0
- hunterx/domain/entities/tidb/api.py +152 -0
- hunterx/domain/entities/tidb/api_intelligence.py +506 -0
- hunterx/domain/entities/tidb/audit.py +146 -0
- hunterx/domain/entities/tidb/auth_intelligence.py +715 -0
- hunterx/domain/entities/tidb/authorization_intelligence.py +555 -0
- hunterx/domain/entities/tidb/cloud_intelligence.py +878 -0
- hunterx/domain/entities/tidb/core.py +135 -0
- hunterx/domain/entities/tidb/execution.py +197 -0
- hunterx/domain/entities/tidb/finding_orchestration.py +469 -0
- hunterx/domain/entities/tidb/findings.py +207 -0
- hunterx/domain/entities/tidb/javascript_intelligence.py +506 -0
- hunterx/domain/entities/tidb/knowledge.py +201 -0
- hunterx/domain/entities/tidb/memory.py +403 -0
- hunterx/domain/entities/tidb/mission_orchestration.py +311 -0
- hunterx/domain/entities/tidb/network.py +841 -0
- hunterx/domain/entities/tidb/orchestration.py +383 -0
- hunterx/domain/entities/tidb/proof.py +299 -0
- hunterx/domain/entities/tidb/proof_strategy.py +170 -0
- hunterx/domain/entities/tidb/reporting.py +107 -0
- hunterx/domain/entities/tidb/reporting_intelligence.py +278 -0
- hunterx/domain/entities/tidb/security.py +165 -0
- hunterx/domain/entities/tidb/target_intelligence.py +510 -0
- hunterx/domain/entities/tidb/technology.py +273 -0
- hunterx/domain/entities/tidb/topology.py +176 -0
- hunterx/domain/entities/tidb/users.py +116 -0
- hunterx/domain/entities/tidb/validation.py +265 -0
- hunterx/domain/entities/tidb/vulnerability.py +650 -0
- hunterx/domain/entities/tidb/web.py +413 -0
- hunterx/domain/entities/tidb/web_crawl.py +279 -0
- hunterx/domain/events/__init__.py +89 -0
- hunterx/domain/events/audit.py +142 -0
- hunterx/domain/events/catalog.py +876 -0
- hunterx/domain/events/enums.py +81 -0
- hunterx/domain/events/spec.py +114 -0
- hunterx/domain/events/types.py +8839 -0
- hunterx/domain/exceptions/__init__.py +192 -0
- hunterx/domain/exceptions/adaptive_mission_planning.py +62 -0
- hunterx/domain/exceptions/base.py +56 -0
- hunterx/domain/exceptions/config.py +30 -0
- hunterx/domain/exceptions/domain.py +45 -0
- hunterx/domain/exceptions/factory.py +106 -0
- hunterx/domain/exceptions/infrastructure.py +75 -0
- hunterx/domain/exceptions/operation.py +229 -0
- hunterx/domain/exceptions/orchestration.py +71 -0
- hunterx/domain/exceptions/planning.py +86 -0
- hunterx/domain/execution.py +395 -0
- hunterx/domain/javascript/__init__.py +199 -0
- hunterx/domain/javascript/analyzers.py +1041 -0
- hunterx/domain/javascript/confidence.py +88 -0
- hunterx/domain/javascript/conflicts.py +113 -0
- hunterx/domain/javascript/correlator.py +238 -0
- hunterx/domain/javascript/history.py +136 -0
- hunterx/domain/javascript/models.py +2182 -0
- hunterx/domain/javascript/normalizer.py +130 -0
- hunterx/domain/javascript/rules.py +729 -0
- hunterx/domain/javascript/scope.py +150 -0
- hunterx/domain/javascript/secrets.py +269 -0
- hunterx/domain/javascript/strategy.py +124 -0
- hunterx/domain/javascript/technology.py +362 -0
- hunterx/domain/javascript/tokenizer.py +417 -0
- hunterx/domain/livehost/__init__.py +87 -0
- hunterx/domain/livehost/confidence.py +192 -0
- hunterx/domain/livehost/conflicts.py +80 -0
- hunterx/domain/livehost/correlator.py +399 -0
- hunterx/domain/livehost/history.py +180 -0
- hunterx/domain/livehost/models.py +1201 -0
- hunterx/domain/livehost/normalizer.py +161 -0
- hunterx/domain/livehost/scope.py +248 -0
- hunterx/domain/livehost/strategy.py +123 -0
- hunterx/domain/livehost/validator.py +180 -0
- hunterx/domain/mission_orchestration/__init__.py +155 -0
- hunterx/domain/mission_orchestration/baseline.py +257 -0
- hunterx/domain/mission_orchestration/branch.py +87 -0
- hunterx/domain/mission_orchestration/cascade.py +198 -0
- hunterx/domain/mission_orchestration/confidence.py +161 -0
- hunterx/domain/mission_orchestration/coverage.py +100 -0
- hunterx/domain/mission_orchestration/decision.py +266 -0
- hunterx/domain/mission_orchestration/enums.py +269 -0
- hunterx/domain/mission_orchestration/gap.py +169 -0
- hunterx/domain/mission_orchestration/hypothesis.py +241 -0
- hunterx/domain/mission_orchestration/impact.py +125 -0
- hunterx/domain/mission_orchestration/mission.py +326 -0
- hunterx/domain/mission_orchestration/models.py +860 -0
- hunterx/domain/mission_orchestration/negative.py +133 -0
- hunterx/domain/mission_orchestration/objective.py +55 -0
- hunterx/domain/mission_orchestration/orchestrator.py +1178 -0
- hunterx/domain/mission_orchestration/policy.py +152 -0
- hunterx/domain/mission_orchestration/telemetry.py +119 -0
- hunterx/domain/mission_orchestration/trace.py +85 -0
- hunterx/domain/mission_planning.py +775 -0
- hunterx/domain/orchestration/__init__.py +89 -0
- hunterx/domain/orchestration/enums.py +207 -0
- hunterx/domain/orchestration/models.py +549 -0
- hunterx/domain/orchestration/selection.py +131 -0
- hunterx/domain/plugins.py +41 -0
- hunterx/domain/ports/__init__.py +80 -0
- hunterx/domain/ports/messaging.py +70 -0
- hunterx/domain/ports/mission_planning.py +127 -0
- hunterx/domain/ports/observability.py +205 -0
- hunterx/domain/ports/orchestration.py +81 -0
- hunterx/domain/ports/reporting.py +29 -0
- hunterx/domain/ports/repositories.py +158 -0
- hunterx/domain/ports/services.py +104 -0
- hunterx/domain/ports/stores.py +84 -0
- hunterx/domain/ports/tidb_repositories.py +89 -0
- hunterx/domain/ports/tool_factory.py +56 -0
- hunterx/domain/ports/tool_intelligence.py +104 -0
- hunterx/domain/ports/tool_mastery.py +149 -0
- hunterx/domain/recon/__init__.py +35 -0
- hunterx/domain/recon/confidence.py +142 -0
- hunterx/domain/recon/correlator.py +137 -0
- hunterx/domain/recon/models.py +275 -0
- hunterx/domain/reporting/__init__.py +36 -0
- hunterx/domain/reporting/claims.py +211 -0
- hunterx/domain/reporting/classification.py +253 -0
- hunterx/domain/reporting/correlation.py +88 -0
- hunterx/domain/reporting/enums.py +289 -0
- hunterx/domain/reporting/evidence.py +161 -0
- hunterx/domain/reporting/executive.py +92 -0
- hunterx/domain/reporting/lifecycle.py +259 -0
- hunterx/domain/reporting/models.py +2323 -0
- hunterx/domain/reporting/prioritization.py +179 -0
- hunterx/domain/reporting/qa.py +301 -0
- hunterx/domain/reporting/quality.py +247 -0
- hunterx/domain/reporting/redaction.py +124 -0
- hunterx/domain/reporting/remediation.py +199 -0
- hunterx/domain/reporting/reportability.py +137 -0
- hunterx/domain/reporting/retest.py +83 -0
- hunterx/domain/reporting/severity.py +232 -0
- hunterx/domain/reporting/source.py +78 -0
- hunterx/domain/reporting/templates.py +205 -0
- hunterx/domain/reporting/timeline.py +74 -0
- hunterx/domain/services/__init__.py +27 -0
- hunterx/domain/services/correlator.py +40 -0
- hunterx/domain/services/deduplicator.py +18 -0
- hunterx/domain/services/planner.py +56 -0
- hunterx/domain/services/risk.py +19 -0
- hunterx/domain/services/validation.py +149 -0
- hunterx/domain/target_intelligence/__init__.py +170 -0
- hunterx/domain/target_intelligence/actions.py +580 -0
- hunterx/domain/target_intelligence/conflicts.py +160 -0
- hunterx/domain/target_intelligence/correlation.py +165 -0
- hunterx/domain/target_intelligence/coverage.py +400 -0
- hunterx/domain/target_intelligence/enums.py +478 -0
- hunterx/domain/target_intelligence/graph.py +231 -0
- hunterx/domain/target_intelligence/history.py +289 -0
- hunterx/domain/target_intelligence/hypotheses.py +453 -0
- hunterx/domain/target_intelligence/models.py +1304 -0
- hunterx/domain/target_intelligence/replay.py +206 -0
- hunterx/domain/target_intelligence/scope.py +129 -0
- hunterx/domain/target_intelligence/state.py +171 -0
- hunterx/domain/target_intelligence/stores.py +271 -0
- hunterx/domain/target_intelligence/unknowns.py +312 -0
- hunterx/domain/target_memory/__init__.py +135 -0
- hunterx/domain/target_memory/engines.py +1018 -0
- hunterx/domain/target_memory/enums.py +231 -0
- hunterx/domain/target_memory/models.py +1061 -0
- hunterx/domain/technology/__init__.py +130 -0
- hunterx/domain/technology/confidence.py +195 -0
- hunterx/domain/technology/conflicts.py +130 -0
- hunterx/domain/technology/correlator.py +223 -0
- hunterx/domain/technology/detector.py +341 -0
- hunterx/domain/technology/history.py +149 -0
- hunterx/domain/technology/models.py +730 -0
- hunterx/domain/technology/normalizer.py +79 -0
- hunterx/domain/technology/resolver.py +187 -0
- hunterx/domain/technology/scope.py +224 -0
- hunterx/domain/technology/signatures.py +293 -0
- hunterx/domain/technology/strategy.py +140 -0
- hunterx/domain/technology/taxonomy.py +771 -0
- hunterx/domain/technology/validator.py +122 -0
- hunterx/domain/technology/version.py +145 -0
- hunterx/domain/tool_contract.py +148 -0
- hunterx/domain/tool_factory.py +688 -0
- hunterx/domain/tool_intelligence.py +1784 -0
- hunterx/domain/tool_mastery.py +419 -0
- hunterx/domain/tools.py +42 -0
- hunterx/domain/topology/__init__.py +93 -0
- hunterx/domain/topology/analysis.py +302 -0
- hunterx/domain/topology/confidence.py +98 -0
- hunterx/domain/topology/conflicts.py +109 -0
- hunterx/domain/topology/correlator.py +94 -0
- hunterx/domain/topology/deriver.py +459 -0
- hunterx/domain/topology/enums.py +178 -0
- hunterx/domain/topology/graph.py +215 -0
- hunterx/domain/topology/history.py +126 -0
- hunterx/domain/topology/keys.py +93 -0
- hunterx/domain/topology/models.py +626 -0
- hunterx/domain/topology/normalizer.py +56 -0
- hunterx/domain/topology/paths.py +90 -0
- hunterx/domain/topology/resolver.py +72 -0
- hunterx/domain/topology/scope.py +148 -0
- hunterx/domain/topology/strategy.py +105 -0
- hunterx/domain/topology/validator.py +85 -0
- hunterx/domain/topology/views.py +212 -0
- hunterx/domain/value_objects/__init__.py +37 -0
- hunterx/domain/value_objects/scope.py +154 -0
- hunterx/domain/value_objects/severity.py +58 -0
- hunterx/domain/vulnerability/__init__.py +153 -0
- hunterx/domain/vulnerability/confidence.py +71 -0
- hunterx/domain/vulnerability/conflicts.py +213 -0
- hunterx/domain/vulnerability/cpe.py +330 -0
- hunterx/domain/vulnerability/cvss.py +219 -0
- hunterx/domain/vulnerability/enums.py +170 -0
- hunterx/domain/vulnerability/history.py +231 -0
- hunterx/domain/vulnerability/knowledge.py +177 -0
- hunterx/domain/vulnerability/matching.py +232 -0
- hunterx/domain/vulnerability/models.py +1329 -0
- hunterx/domain/vulnerability/normalizer.py +510 -0
- hunterx/domain/vulnerability/purl.py +207 -0
- hunterx/domain/vulnerability/risk.py +209 -0
- hunterx/domain/vulnerability/versions.py +295 -0
- hunterx/domain/vulnerability_finding/__init__.py +187 -0
- hunterx/domain/vulnerability_finding/confidence.py +349 -0
- hunterx/domain/vulnerability_finding/deduplication.py +194 -0
- hunterx/domain/vulnerability_finding/enums.py +473 -0
- hunterx/domain/vulnerability_finding/evidence.py +474 -0
- hunterx/domain/vulnerability_finding/execution.py +243 -0
- hunterx/domain/vulnerability_finding/impact.py +142 -0
- hunterx/domain/vulnerability_finding/lifecycle.py +311 -0
- hunterx/domain/vulnerability_finding/models.py +1349 -0
- hunterx/domain/vulnerability_finding/poc.py +287 -0
- hunterx/domain/vulnerability_finding/redaction.py +139 -0
- hunterx/domain/vulnerability_finding/reporting.py +200 -0
- hunterx/domain/vulnerability_finding/reproduction.py +107 -0
- hunterx/domain/vulnerability_finding/strategy.py +627 -0
- hunterx/domain/vulnerability_finding/unknown.py +188 -0
- hunterx/domain/vulnerability_proof/__init__.py +265 -0
- hunterx/domain/vulnerability_proof/confidence.py +249 -0
- hunterx/domain/vulnerability_proof/contracts.py +420 -0
- hunterx/domain/vulnerability_proof/enums.py +263 -0
- hunterx/domain/vulnerability_proof/evidence.py +98 -0
- hunterx/domain/vulnerability_proof/generation.py +292 -0
- hunterx/domain/vulnerability_proof/impact.py +195 -0
- hunterx/domain/vulnerability_proof/library.py +910 -0
- hunterx/domain/vulnerability_proof/matrix.py +222 -0
- hunterx/domain/vulnerability_proof/models.py +1047 -0
- hunterx/domain/vulnerability_proof/planning.py +153 -0
- hunterx/domain/vulnerability_proof/policy.py +169 -0
- hunterx/domain/vulnerability_proof/quality.py +209 -0
- hunterx/domain/vulnerability_proof/reasoning.py +184 -0
- hunterx/domain/vulnerability_proof/registry.py +282 -0
- hunterx/domain/vulnerability_proof/replay.py +129 -0
- hunterx/domain/vulnerability_proof/selector.py +398 -0
- hunterx/domain/vulnerability_proof/state.py +170 -0
- hunterx/domain/vulnerability_proof/strategy.py +772 -0
- hunterx/domain/vulnerability_proof/temporal.py +151 -0
- hunterx/domain/vulnerability_proof/validator.py +670 -0
- hunterx/domain/vulnerability_validation/__init__.py +150 -0
- hunterx/domain/vulnerability_validation/enums.py +260 -0
- hunterx/domain/vulnerability_validation/evidence.py +140 -0
- hunterx/domain/vulnerability_validation/history.py +231 -0
- hunterx/domain/vulnerability_validation/models.py +792 -0
- hunterx/domain/vulnerability_validation/normalization.py +107 -0
- hunterx/domain/vulnerability_validation/planning.py +165 -0
- hunterx/domain/vulnerability_validation/rules.py +539 -0
- hunterx/domain/vulnerability_validation/safety.py +200 -0
- hunterx/domain/vulnerability_validation/scope.py +174 -0
- hunterx/domain/vulnerability_validation/state.py +161 -0
- hunterx/domain/vulnerability_validation/tool_selection.py +230 -0
- hunterx/domain/vulnerability_validation/verdict.py +291 -0
- hunterx/domain/web/__init__.py +85 -0
- hunterx/domain/web/confidence.py +107 -0
- hunterx/domain/web/correlator.py +140 -0
- hunterx/domain/web/history.py +173 -0
- hunterx/domain/web/models.py +744 -0
- hunterx/domain/web/parsers.py +389 -0
- hunterx/domain/web/policy.py +109 -0
- hunterx/domain/web/scope.py +230 -0
- hunterx/domain/web/strategy.py +143 -0
- hunterx/domain/web/urls.py +164 -0
- hunterx/engines/__init__.py +53 -0
- hunterx/engines/adaptive_mission_planning/engine.py +575 -0
- hunterx/engines/core.py +79 -0
- hunterx/engines/correlation.py +43 -0
- hunterx/engines/deduplicator.py +26 -0
- hunterx/engines/mission.py +96 -0
- hunterx/engines/mission_orchestration/__init__.py +10 -0
- hunterx/engines/mission_orchestration/engine.py +202 -0
- hunterx/engines/mission_planning/__init__.py +12 -0
- hunterx/engines/mission_planning/api.py +239 -0
- hunterx/engines/mission_planning/checkpoints.py +311 -0
- hunterx/engines/mission_planning/config.py +136 -0
- hunterx/engines/mission_planning/engine.py +374 -0
- hunterx/engines/mission_planning/graph.py +133 -0
- hunterx/engines/mission_planning/planner.py +262 -0
- hunterx/engines/mission_planning/profiles.py +211 -0
- hunterx/engines/mission_planning/state.py +272 -0
- hunterx/engines/mission_planning/timeline.py +165 -0
- hunterx/engines/orchestration/__init__.py +136 -0
- hunterx/engines/orchestration/api.py +113 -0
- hunterx/engines/orchestration/checkpoints.py +156 -0
- hunterx/engines/orchestration/coverage.py +245 -0
- hunterx/engines/orchestration/dedup.py +136 -0
- hunterx/engines/orchestration/engine.py +692 -0
- hunterx/engines/orchestration/events.py +154 -0
- hunterx/engines/orchestration/executor.py +632 -0
- hunterx/engines/orchestration/fallback.py +105 -0
- hunterx/engines/orchestration/graph.py +190 -0
- hunterx/engines/orchestration/lifecycle.py +172 -0
- hunterx/engines/orchestration/memory.py +172 -0
- hunterx/engines/orchestration/planner.py +327 -0
- hunterx/engines/orchestration/quality.py +238 -0
- hunterx/engines/orchestration/ratelimit.py +158 -0
- hunterx/engines/orchestration/replan.py +140 -0
- hunterx/engines/orchestration/retry.py +181 -0
- hunterx/engines/orchestration/safety.py +130 -0
- hunterx/engines/orchestration/scope.py +237 -0
- hunterx/engines/orchestration/selector.py +188 -0
- hunterx/engines/planner.py +55 -0
- hunterx/engines/reasoning.py +51 -0
- hunterx/engines/report.py +60 -0
- hunterx/engines/risk.py +40 -0
- hunterx/engines/target_intelligence/__init__.py +38 -0
- hunterx/engines/target_intelligence/engine.py +508 -0
- hunterx/engines/workflow.py +132 -0
- hunterx/events.py +30 -0
- hunterx/exceptions.py +11 -0
- hunterx/infrastructure/__init__.py +14 -0
- hunterx/infrastructure/ai/__init__.py +39 -0
- hunterx/infrastructure/cache/__init__.py +72 -0
- hunterx/infrastructure/db/__init__.py +8 -0
- hunterx/infrastructure/db/graph/__init__.py +95 -0
- hunterx/infrastructure/db/object_store/__init__.py +101 -0
- hunterx/infrastructure/db/search/__init__.py +61 -0
- hunterx/infrastructure/db/sql/__init__.py +38 -0
- hunterx/infrastructure/db/sql/crud.py +196 -0
- hunterx/infrastructure/db/sql/factory.py +130 -0
- hunterx/infrastructure/db/sql/mapping.py +92 -0
- hunterx/infrastructure/db/sql/memory.py +124 -0
- hunterx/infrastructure/db/sql/models.py +197 -0
- hunterx/infrastructure/db/sql/registry.py +60 -0
- hunterx/infrastructure/db/sql/repositories.py +394 -0
- hunterx/infrastructure/db/sql/tidb_models/__init__.py +880 -0
- hunterx/infrastructure/db/sql/tidb_models/_base.py +50 -0
- hunterx/infrastructure/db/sql/tidb_models/adaptive_mission_planning_models.py +258 -0
- hunterx/infrastructure/db/sql/tidb_models/api_intelligence_models.py +326 -0
- hunterx/infrastructure/db/sql/tidb_models/api_models.py +110 -0
- hunterx/infrastructure/db/sql/tidb_models/audit_models.py +103 -0
- hunterx/infrastructure/db/sql/tidb_models/auth_intelligence_models.py +496 -0
- hunterx/infrastructure/db/sql/tidb_models/authorization_intelligence_models.py +561 -0
- hunterx/infrastructure/db/sql/tidb_models/cloud_intelligence_models.py +668 -0
- hunterx/infrastructure/db/sql/tidb_models/core_models.py +79 -0
- hunterx/infrastructure/db/sql/tidb_models/execution_models.py +129 -0
- hunterx/infrastructure/db/sql/tidb_models/finding_models.py +129 -0
- hunterx/infrastructure/db/sql/tidb_models/finding_orchestration_models.py +296 -0
- hunterx/infrastructure/db/sql/tidb_models/javascript_intelligence_models.py +368 -0
- hunterx/infrastructure/db/sql/tidb_models/knowledge_models.py +124 -0
- hunterx/infrastructure/db/sql/tidb_models/memory_models.py +377 -0
- hunterx/infrastructure/db/sql/tidb_models/mission_orchestration_models.py +316 -0
- hunterx/infrastructure/db/sql/tidb_models/network_models.py +549 -0
- hunterx/infrastructure/db/sql/tidb_models/orchestration_models.py +251 -0
- hunterx/infrastructure/db/sql/tidb_models/proof_models.py +325 -0
- hunterx/infrastructure/db/sql/tidb_models/proof_strategy_models.py +179 -0
- hunterx/infrastructure/db/sql/tidb_models/reporting_intelligence_models.py +185 -0
- hunterx/infrastructure/db/sql/tidb_models/reporting_models.py +69 -0
- hunterx/infrastructure/db/sql/tidb_models/security_models.py +108 -0
- hunterx/infrastructure/db/sql/tidb_models/target_intelligence_models.py +308 -0
- hunterx/infrastructure/db/sql/tidb_models/technology_models.py +170 -0
- hunterx/infrastructure/db/sql/tidb_models/topology_models.py +107 -0
- hunterx/infrastructure/db/sql/tidb_models/user_models.py +71 -0
- hunterx/infrastructure/db/sql/tidb_models/validation_models.py +266 -0
- hunterx/infrastructure/db/sql/tidb_models/vulnerability_models.py +395 -0
- hunterx/infrastructure/db/sql/tidb_models/web_crawl_models.py +182 -0
- hunterx/infrastructure/db/sql/tidb_models/web_models.py +297 -0
- hunterx/infrastructure/db/sql/versioning.py +299 -0
- hunterx/infrastructure/event_bus/__init__.py +170 -0
- hunterx/infrastructure/event_bus/store.py +131 -0
- hunterx/infrastructure/health/__init__.py +91 -0
- hunterx/infrastructure/logging/__init__.py +195 -0
- hunterx/infrastructure/memory/__init__.py +59 -0
- hunterx/infrastructure/memory/factory.py +77 -0
- hunterx/infrastructure/memory/orchestration.py +109 -0
- hunterx/infrastructure/memory/planning.py +176 -0
- hunterx/infrastructure/memory/repositories.py +216 -0
- hunterx/infrastructure/metrics/__init__.py +117 -0
- hunterx/infrastructure/queue/__init__.py +73 -0
- hunterx/infrastructure/sandbox/__init__.py +60 -0
- hunterx/infrastructure/secrets/__init__.py +62 -0
- hunterx/infrastructure/telemetry/__init__.py +54 -0
- hunterx/infrastructure/telemetry/providers.py +122 -0
- hunterx/infrastructure/tracing/__init__.py +145 -0
- hunterx/knowledge/__init__.py +17 -0
- hunterx/knowledge/engine.py +56 -0
- hunterx/knowledge/graph.py +53 -0
- hunterx/knowledge/loader.py +59 -0
- hunterx/knowledge/registry.py +78 -0
- hunterx/logging.py +10 -0
- hunterx/managers.py +113 -0
- hunterx/models.py +48 -0
- hunterx/observability.py +80 -0
- hunterx/platform/__init__.py +20 -0
- hunterx/platform/assembler.py +1023 -0
- hunterx/platform/platform.py +233 -0
- hunterx/plugins/__init__.py +26 -0
- hunterx/plugins/dependencies.py +42 -0
- hunterx/plugins/lifecycle.py +30 -0
- hunterx/plugins/loader.py +49 -0
- hunterx/plugins/manager.py +129 -0
- hunterx/plugins/manifest.py +63 -0
- hunterx/plugins/permissions.py +32 -0
- hunterx/plugins/registry.py +42 -0
- hunterx/plugins/sandbox.py +35 -0
- hunterx/plugins/sdk/__init__.py +25 -0
- hunterx/plugins/sdk/context.py +122 -0
- hunterx/plugins/sdk/events.py +19 -0
- hunterx/plugins/sdk/results.py +64 -0
- hunterx/plugins/versioning.py +49 -0
- hunterx/py.typed +0 -0
- hunterx/queue.py +12 -0
- hunterx/reporting/__init__.py +38 -0
- hunterx/reporting/evidence.py +23 -0
- hunterx/reporting/exporter.py +29 -0
- hunterx/reporting/proof.py +284 -0
- hunterx/reporting/renderers.py +101 -0
- hunterx/reporting/report_renderers.py +425 -0
- hunterx/reporting/strategy.py +137 -0
- hunterx/reporting/templates/report.md.j2 +24 -0
- hunterx/reporting/validation.py +439 -0
- hunterx/reporting/views.py +96 -0
- hunterx/scheduler/__init__.py +11 -0
- hunterx/scheduler/jobs.py +62 -0
- hunterx/scheduler/service.py +108 -0
- hunterx/security/__init__.py +21 -0
- hunterx/security/manager.py +88 -0
- hunterx/security/policies.py +46 -0
- hunterx/shared/__init__.py +34 -0
- hunterx/shared/di.py +89 -0
- hunterx/shared/ids.py +73 -0
- hunterx/shared/masking.py +65 -0
- hunterx/shared/result.py +55 -0
- hunterx/shared/time.py +57 -0
- hunterx/telemetry.py +11 -0
- hunterx/tools/__init__.py +107 -0
- hunterx/tools/adapter.py +104 -0
- hunterx/tools/api/__init__.py +42 -0
- hunterx/tools/api/adapters.py +713 -0
- hunterx/tools/api/base.py +143 -0
- hunterx/tools/api/graphql_binaries.py +218 -0
- hunterx/tools/api/registry.py +75 -0
- hunterx/tools/auth/__init__.py +29 -0
- hunterx/tools/auth/analyzer.py +58 -0
- hunterx/tools/auth/base.py +191 -0
- hunterx/tools/auth/registry.py +53 -0
- hunterx/tools/auth/tip.py +207 -0
- hunterx/tools/authorization/__init__.py +32 -0
- hunterx/tools/authorization/analyzer.py +65 -0
- hunterx/tools/authorization/base.py +191 -0
- hunterx/tools/authorization/registry.py +53 -0
- hunterx/tools/authorization/tip.py +232 -0
- hunterx/tools/categories.py +35 -0
- hunterx/tools/cloud/__init__.py +28 -0
- hunterx/tools/cloud/analyzer.py +62 -0
- hunterx/tools/cloud/base.py +177 -0
- hunterx/tools/cloud/registry.py +52 -0
- hunterx/tools/cloud/tip.py +227 -0
- hunterx/tools/content/__init__.py +36 -0
- hunterx/tools/content/base.py +130 -0
- hunterx/tools/content/bruteforcers.py +272 -0
- hunterx/tools/content/ffuf.py +216 -0
- hunterx/tools/content/registry.py +59 -0
- hunterx/tools/content/tip.py +266 -0
- hunterx/tools/discovery.py +48 -0
- hunterx/tools/dns/__init__.py +39 -0
- hunterx/tools/dns/base.py +127 -0
- hunterx/tools/dns/dnspython.py +136 -0
- hunterx/tools/dns/dnsx.py +209 -0
- hunterx/tools/dns/massdns.py +224 -0
- hunterx/tools/dns/registry.py +62 -0
- hunterx/tools/dns/resolver.py +198 -0
- hunterx/tools/dns/shuffledns.py +168 -0
- hunterx/tools/dns/tip.py +263 -0
- hunterx/tools/executor.py +82 -0
- hunterx/tools/exploit/__init__.py +28 -0
- hunterx/tools/exploit/adapters.py +263 -0
- hunterx/tools/exploit/registry.py +55 -0
- hunterx/tools/factory/__init__.py +55 -0
- hunterx/tools/factory/api.py +176 -0
- hunterx/tools/factory/compatibility.py +82 -0
- hunterx/tools/factory/engine.py +194 -0
- hunterx/tools/factory/generators/__init__.py +93 -0
- hunterx/tools/factory/generators/base.py +60 -0
- hunterx/tools/factory/generators/code.py +63 -0
- hunterx/tools/factory/generators/core.py +245 -0
- hunterx/tools/factory/generators/io.py +166 -0
- hunterx/tools/factory/generators/quality.py +287 -0
- hunterx/tools/factory/generators/rules.py +91 -0
- hunterx/tools/factory/layout.py +103 -0
- hunterx/tools/factory/render.py +87 -0
- hunterx/tools/factory/templates.py +489 -0
- hunterx/tools/factory/validator.py +177 -0
- hunterx/tools/factory/versioning.py +64 -0
- hunterx/tools/intelligence/__init__.py +113 -0
- hunterx/tools/intelligence/adapters.py +155 -0
- hunterx/tools/intelligence/ai.py +216 -0
- hunterx/tools/intelligence/api.py +465 -0
- hunterx/tools/intelligence/capability.py +145 -0
- hunterx/tools/intelligence/chaining.py +583 -0
- hunterx/tools/intelligence/compatibility.py +121 -0
- hunterx/tools/intelligence/correlation.py +173 -0
- hunterx/tools/intelligence/dependency.py +141 -0
- hunterx/tools/intelligence/docs.py +132 -0
- hunterx/tools/intelligence/enforcement.py +396 -0
- hunterx/tools/intelligence/escalation.py +161 -0
- hunterx/tools/intelligence/health.py +95 -0
- hunterx/tools/intelligence/layer.py +280 -0
- hunterx/tools/intelligence/lifecycle.py +192 -0
- hunterx/tools/intelligence/normalizers.py +143 -0
- hunterx/tools/intelligence/parsers.py +189 -0
- hunterx/tools/intelligence/performance.py +82 -0
- hunterx/tools/intelligence/planner.py +164 -0
- hunterx/tools/intelligence/recommendation.py +163 -0
- hunterx/tools/intelligence/registry.py +337 -0
- hunterx/tools/intelligence/reliability.py +149 -0
- hunterx/tools/intelligence/schema.py +694 -0
- hunterx/tools/intelligence/selection.py +173 -0
- hunterx/tools/intelligence/selector.py +210 -0
- hunterx/tools/intelligence/state.py +85 -0
- hunterx/tools/intelligence/target.py +146 -0
- hunterx/tools/intelligence/taxonomy.py +178 -0
- hunterx/tools/intelligence/validation.py +244 -0
- hunterx/tools/intelligence/vocabulary.py +202 -0
- hunterx/tools/javascript/__init__.py +47 -0
- hunterx/tools/javascript/analyzer.py +122 -0
- hunterx/tools/javascript/base.py +226 -0
- hunterx/tools/javascript/external.py +289 -0
- hunterx/tools/javascript/registry.py +64 -0
- hunterx/tools/javascript/tip.py +275 -0
- hunterx/tools/knowledge/__init__.py +28 -0
- hunterx/tools/knowledge/adapters.py +164 -0
- hunterx/tools/knowledge/registry.py +51 -0
- hunterx/tools/livehost/__init__.py +41 -0
- hunterx/tools/livehost/base.py +147 -0
- hunterx/tools/livehost/masscan.py +192 -0
- hunterx/tools/livehost/naabu.py +144 -0
- hunterx/tools/livehost/nmap.py +446 -0
- hunterx/tools/livehost/registry.py +66 -0
- hunterx/tools/livehost/rustscan.py +137 -0
- hunterx/tools/livehost/tcp_connect.py +172 -0
- hunterx/tools/livehost/tip.py +326 -0
- hunterx/tools/mastery/__init__.py +58 -0
- hunterx/tools/mastery/api.py +411 -0
- hunterx/tools/mastery/arsenal.py +158 -0
- hunterx/tools/mastery/arsenal_analysis.py +597 -0
- hunterx/tools/mastery/arsenal_enterprise.py +365 -0
- hunterx/tools/mastery/arsenal_exploit.py +271 -0
- hunterx/tools/mastery/arsenal_recon.py +573 -0
- hunterx/tools/mastery/arsenal_web.py +839 -0
- hunterx/tools/mastery/contract.py +281 -0
- hunterx/tools/mastery/coverage.py +85 -0
- hunterx/tools/mastery/dataset_data.py +195 -0
- hunterx/tools/mastery/datasets.py +84 -0
- hunterx/tools/mastery/history.py +130 -0
- hunterx/tools/mastery/knowledge_fixtures.py +440 -0
- hunterx/tools/mastery/playbook_data.py +577 -0
- hunterx/tools/mastery/playbooks.py +168 -0
- hunterx/tools/mastery/registry.py +143 -0
- hunterx/tools/mastery/regression.py +207 -0
- hunterx/tools/mastery/relationship_data.py +119 -0
- hunterx/tools/mastery/relationships.py +182 -0
- hunterx/tools/mastery/replay.py +200 -0
- hunterx/tools/mastery/selection.py +164 -0
- hunterx/tools/mastery/specs.py +254 -0
- hunterx/tools/mastery/toolchain_manifest.py +217 -0
- hunterx/tools/mastery/versioning.py +163 -0
- hunterx/tools/normalizer.py +95 -0
- hunterx/tools/parameter/__init__.py +26 -0
- hunterx/tools/parameter/adapters.py +253 -0
- hunterx/tools/parameter/base.py +115 -0
- hunterx/tools/parameter/registry.py +51 -0
- hunterx/tools/parameter/tip.py +219 -0
- hunterx/tools/parser.py +66 -0
- hunterx/tools/proof_replay/__init__.py +31 -0
- hunterx/tools/proof_replay/adapters.py +145 -0
- hunterx/tools/proof_replay/registry.py +39 -0
- hunterx/tools/proxy/__init__.py +22 -0
- hunterx/tools/proxy/adapters.py +216 -0
- hunterx/tools/proxy/registry.py +49 -0
- hunterx/tools/recon/__init__.py +30 -0
- hunterx/tools/recon/amass.py +144 -0
- hunterx/tools/recon/assetfinder.py +63 -0
- hunterx/tools/recon/base.py +148 -0
- hunterx/tools/recon/bbot.py +152 -0
- hunterx/tools/recon/findomain.py +107 -0
- hunterx/tools/recon/registry.py +69 -0
- hunterx/tools/recon/runner.py +302 -0
- hunterx/tools/recon/subfinder.py +144 -0
- hunterx/tools/recon/theharvester.py +132 -0
- hunterx/tools/recon/tip.py +315 -0
- hunterx/tools/registry.py +42 -0
- hunterx/tools/safe_validation/__init__.py +37 -0
- hunterx/tools/safe_validation/adapters.py +199 -0
- hunterx/tools/safe_validation/base.py +111 -0
- hunterx/tools/safe_validation/registry.py +57 -0
- hunterx/tools/sandbox.py +34 -0
- hunterx/tools/sast/__init__.py +22 -0
- hunterx/tools/sast/registry.py +47 -0
- hunterx/tools/sast/semgrep.py +122 -0
- hunterx/tools/sdk/__init__.py +71 -0
- hunterx/tools/sdk/adapter.py +176 -0
- hunterx/tools/sdk/cache.py +102 -0
- hunterx/tools/sdk/capabilities.py +57 -0
- hunterx/tools/sdk/context.py +169 -0
- hunterx/tools/sdk/dependencies.py +70 -0
- hunterx/tools/sdk/engine.py +199 -0
- hunterx/tools/sdk/events.py +145 -0
- hunterx/tools/sdk/health.py +96 -0
- hunterx/tools/sdk/installer.py +105 -0
- hunterx/tools/sdk/locks.py +90 -0
- hunterx/tools/sdk/monitor.py +101 -0
- hunterx/tools/sdk/output.py +139 -0
- hunterx/tools/sdk/parallel.py +57 -0
- hunterx/tools/sdk/pipeline.py +268 -0
- hunterx/tools/sdk/plugin.py +98 -0
- hunterx/tools/sdk/queue.py +102 -0
- hunterx/tools/sdk/resources.py +184 -0
- hunterx/tools/sdk/result.py +141 -0
- hunterx/tools/sdk/retry.py +51 -0
- hunterx/tools/sdk/sandbox.py +218 -0
- hunterx/tools/sdk/scheduler.py +75 -0
- hunterx/tools/sdk/session.py +117 -0
- hunterx/tools/sdk/timeout.py +69 -0
- hunterx/tools/sdk/version.py +86 -0
- hunterx/tools/secrets/__init__.py +32 -0
- hunterx/tools/secrets/base.py +141 -0
- hunterx/tools/secrets/gitleaks.py +201 -0
- hunterx/tools/secrets/registry.py +51 -0
- hunterx/tools/secrets/tip.py +242 -0
- hunterx/tools/secrets/trufflehog.py +133 -0
- hunterx/tools/tech/__init__.py +40 -0
- hunterx/tools/tech/base.py +193 -0
- hunterx/tools/tech/httpclient.py +168 -0
- hunterx/tools/tech/httpx.py +218 -0
- hunterx/tools/tech/registry.py +65 -0
- hunterx/tools/tech/signature.py +179 -0
- hunterx/tools/tech/tip.py +270 -0
- hunterx/tools/tech/whatweb.py +186 -0
- hunterx/tools/topology/__init__.py +36 -0
- hunterx/tools/topology/base.py +109 -0
- hunterx/tools/topology/models.py +139 -0
- hunterx/tools/topology/registry.py +48 -0
- hunterx/tools/topology/tip.py +191 -0
- hunterx/tools/topology/traceroute.py +119 -0
- hunterx/tools/validation.py +42 -0
- hunterx/tools/vuln/__init__.py +86 -0
- hunterx/tools/vuln/base.py +110 -0
- hunterx/tools/vuln/injection.py +515 -0
- hunterx/tools/vuln/nuclei.py +237 -0
- hunterx/tools/vuln/providers.py +346 -0
- hunterx/tools/vuln/registry.py +153 -0
- hunterx/tools/vuln/scanbase.py +143 -0
- hunterx/tools/vuln/tip.py +518 -0
- hunterx/tools/web/__init__.py +42 -0
- hunterx/tools/web/base.py +129 -0
- hunterx/tools/web/crawler.py +444 -0
- hunterx/tools/web/httpclient.py +149 -0
- hunterx/tools/web/katana.py +201 -0
- hunterx/tools/web/registry.py +84 -0
- hunterx/tools/web/tip.py +379 -0
- hunterx/tools/web/url_discovery.py +257 -0
- hunterx/tools/web/urlbase.py +158 -0
- hunterx/utils.py +28 -0
- hunterxsec-7.0.0.dist-info/METADATA +1088 -0
- hunterxsec-7.0.0.dist-info/RECORD +841 -0
- hunterxsec-7.0.0.dist-info/WHEEL +5 -0
- hunterxsec-7.0.0.dist-info/entry_points.txt +3 -0
- hunterxsec-7.0.0.dist-info/licenses/LICENSE +202 -0
- hunterxsec-7.0.0.dist-info/top_level.txt +1 -0
hunterx/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
#
|
|
4
|
+
# HunterX v7 — AI-Powered Security Orchestration & Intelligence Platform
|
|
5
|
+
|
|
6
|
+
"""HunterX v7 core package.
|
|
7
|
+
|
|
8
|
+
This package is the Clean Architecture backbone of the HunterX platform. It
|
|
9
|
+
contains only foundation code: domain model, application services, engines,
|
|
10
|
+
infrastructure adapters, and the public SDKs. No scanners, no tool
|
|
11
|
+
implementations, no AI models, and no business logic live here.
|
|
12
|
+
|
|
13
|
+
Package layout follows the ratified Development Bible
|
|
14
|
+
(``docs/bible/03 - Folder Structure.md``):
|
|
15
|
+
|
|
16
|
+
- :mod:`hunterx.domain` — pure domain layer (entities, ports, services)
|
|
17
|
+
- :mod:`hunterx.application` — use-case layer
|
|
18
|
+
- :mod:`hunterx.infrastructure` — adapters (db, cache, queue, ai, sandbox, ...)
|
|
19
|
+
- :mod:`hunterx.engines` — engine facades (mission, workflow, planner, ...)
|
|
20
|
+
- :mod:`hunterx.agents` — multi-agent platform
|
|
21
|
+
- :mod:`hunterx.plugins` — plugin system + public plugin SDK
|
|
22
|
+
- :mod:`hunterx.tools` — tool adapter SDK + parser/normalizer framework
|
|
23
|
+
- :mod:`hunterx.knowledge` — knowledge engine + knowledge graph
|
|
24
|
+
- :mod:`hunterx.scheduler` — scheduler + jobs
|
|
25
|
+
- :mod:`hunterx.reporting` — reporting infrastructure
|
|
26
|
+
- :mod:`hunterx.config` — configuration manager
|
|
27
|
+
- :mod:`hunterx.shared` — cross-cutting helpers (ids, masking, di, result)
|
|
28
|
+
- :mod:`hunterx.api` — REST API framework (routing structure)
|
|
29
|
+
- :mod:`hunterx.cli` — CLI framework (command structure)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from __future__ import annotations
|
|
33
|
+
|
|
34
|
+
__version__ = "7.0.0"
|
|
35
|
+
__author__ = "Ahmed Awad (NullC0d3)"
|
|
36
|
+
__license__ = "Apache-2.0"
|
|
37
|
+
|
|
38
|
+
# NOTE: deliberately NOT importing any submodules here to keep the package
|
|
39
|
+
# import cheap and side-effect free. Subsystems are imported on demand.
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"__version__",
|
|
43
|
+
"__author__",
|
|
44
|
+
"__license__",
|
|
45
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Multi-agent platform.
|
|
5
|
+
|
|
6
|
+
Provides the abstract :class:`~hunterx.agents.base.SecurityAgent` contract,
|
|
7
|
+
the agent registry, orchestrator and shared agent infrastructure. Concrete
|
|
8
|
+
agents (recon, scanner, analyst, reporter) are provided by plugins.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from hunterx.agents.base import AgentCapability, SecurityAgent
|
|
14
|
+
from hunterx.agents.context import AgentContext
|
|
15
|
+
from hunterx.agents.memory import AgentMemory
|
|
16
|
+
from hunterx.agents.messaging import AgentMessage
|
|
17
|
+
from hunterx.agents.orchestrator import AgentOrchestrator
|
|
18
|
+
from hunterx.agents.registry import AgentRegistry
|
|
19
|
+
from hunterx.agents.state import AgentState
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"SecurityAgent",
|
|
23
|
+
"AgentCapability",
|
|
24
|
+
"AgentRegistry",
|
|
25
|
+
"AgentOrchestrator",
|
|
26
|
+
"AgentContext",
|
|
27
|
+
"AgentMemory",
|
|
28
|
+
"AgentMessage",
|
|
29
|
+
"AgentState",
|
|
30
|
+
]
|
hunterx/agents/base.py
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent abstraction.
|
|
5
|
+
|
|
6
|
+
An agent is a specialized worker that performs a bounded set of security
|
|
7
|
+
operations. Agents declare their capabilities, run within an orchestrated
|
|
8
|
+
lifecycle, and communicate exclusively through :class:`AgentMessage`.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import abc
|
|
14
|
+
from enum import Enum
|
|
15
|
+
|
|
16
|
+
from hunterx.agents.context import AgentContext
|
|
17
|
+
from hunterx.agents.memory import AgentMemory
|
|
18
|
+
from hunterx.agents.messaging import AgentMessage
|
|
19
|
+
from hunterx.agents.state import AgentState
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AgentCapability(Enum):
|
|
23
|
+
"""Capabilities an agent can declare."""
|
|
24
|
+
|
|
25
|
+
RECON = "recon"
|
|
26
|
+
SCAN = "scan"
|
|
27
|
+
DETECT = "detect"
|
|
28
|
+
ANALYZE = "analyze"
|
|
29
|
+
CORRELATE = "correlate"
|
|
30
|
+
REPORT = "report"
|
|
31
|
+
ENRICH = "enrich"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class SecurityAgent(abc.ABC):
|
|
35
|
+
"""Base class for all agents.
|
|
36
|
+
|
|
37
|
+
Subclasses implement :meth:`run`, which receives the agent context and
|
|
38
|
+
returns a list of messages to hand off to the orchestrator.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
#: Unique agent name (e.g. ``"recon.agent"``).
|
|
42
|
+
name: str = ""
|
|
43
|
+
#: Human-readable description.
|
|
44
|
+
description: str = ""
|
|
45
|
+
#: Capabilities this agent provides.
|
|
46
|
+
capabilities: tuple[AgentCapability, ...] = ()
|
|
47
|
+
|
|
48
|
+
def __init__(self, memory: AgentMemory | None = None) -> None:
|
|
49
|
+
self._memory = memory or AgentMemory()
|
|
50
|
+
self._state = AgentState.IDLE
|
|
51
|
+
|
|
52
|
+
@property
|
|
53
|
+
def memory(self) -> AgentMemory:
|
|
54
|
+
"""Return this agent's working memory."""
|
|
55
|
+
return self._memory
|
|
56
|
+
|
|
57
|
+
@abc.abstractmethod
|
|
58
|
+
def run(self, context: AgentContext) -> list[AgentMessage]:
|
|
59
|
+
"""Execute the agent's work and return hand-off messages."""
|
|
60
|
+
|
|
61
|
+
def can(self, capability: AgentCapability) -> bool:
|
|
62
|
+
"""Return ``True`` if the agent declares ``capability``."""
|
|
63
|
+
return capability in self.capabilities
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def state(self) -> AgentState:
|
|
67
|
+
"""Return the agent's current lifecycle state."""
|
|
68
|
+
return self._state
|
|
69
|
+
|
|
70
|
+
def _transition(self, state: AgentState) -> None:
|
|
71
|
+
self._state = state
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent capability helpers."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from collections.abc import Iterable
|
|
9
|
+
|
|
10
|
+
from hunterx.agents.base import AgentCapability
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CapabilitySet(frozenset):
|
|
14
|
+
"""A frozenset of :class:`AgentCapability` values with query helpers."""
|
|
15
|
+
|
|
16
|
+
def __new__(cls, capabilities: Iterable[AgentCapability] = ()) -> CapabilitySet:
|
|
17
|
+
"""Construct a frozen set from an iterable of capabilities."""
|
|
18
|
+
return super().__new__(cls, capabilities) # type: ignore[arg-type]
|
|
19
|
+
|
|
20
|
+
def requires(self, capability: AgentCapability) -> bool:
|
|
21
|
+
"""Return ``True`` when the set includes ``capability``."""
|
|
22
|
+
return capability in self
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def from_names(cls, names: Iterable[str]) -> CapabilitySet:
|
|
26
|
+
"""Build a set from capability names (case-insensitive)."""
|
|
27
|
+
return cls(AgentCapability(name) for name in names)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent context."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(slots=True)
|
|
13
|
+
class AgentContext:
|
|
14
|
+
"""The execution context handed to an agent for a single run.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
mission_id: owning mission.
|
|
18
|
+
target: target identifier the agent should operate on.
|
|
19
|
+
parameters: agent-specific run parameters.
|
|
20
|
+
workspace: scratch data shared across agents in a run.
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
mission_id: str
|
|
25
|
+
target: str = ""
|
|
26
|
+
parameters: dict[str, Any] = field(default_factory=dict)
|
|
27
|
+
workspace: dict[str, Any] = field(default_factory=dict)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent coordinator.
|
|
5
|
+
|
|
6
|
+
Runs a multi-phase agent pipeline (recon → scan → analyze) for a mission by
|
|
7
|
+
dispatching to agents at each phase and merging their results. This is the
|
|
8
|
+
mission-level counterpart to the lower-level :class:`AgentOrchestrator`.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from collections.abc import Iterable
|
|
14
|
+
|
|
15
|
+
from hunterx.agents.context import AgentContext
|
|
16
|
+
from hunterx.agents.messaging import AgentMessage
|
|
17
|
+
from hunterx.agents.orchestrator import AgentOrchestrator
|
|
18
|
+
from hunterx.shared.result import Failure, Result, Success
|
|
19
|
+
|
|
20
|
+
#: Default phase pipeline: ordered capability groups.
|
|
21
|
+
_PIPELINE: tuple[tuple[str, ...], ...] = (
|
|
22
|
+
("recon.enumerate", "recon.fingerprint"),
|
|
23
|
+
("scan.vulnerabilities",),
|
|
24
|
+
("analyze.correlate", "analyze.prioritize"),
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AgentCoordinator:
|
|
29
|
+
"""Coordinate a phased agent run over a mission.
|
|
30
|
+
|
|
31
|
+
Each phase dispatches work to the named agents; if a phase has no agent
|
|
32
|
+
registered, it is skipped without failing the mission.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def __init__(self, orchestrator: AgentOrchestrator, *, pipeline: tuple[tuple[str, ...], ...] = _PIPELINE) -> None:
|
|
36
|
+
self._orchestrator = orchestrator
|
|
37
|
+
self._pipeline = pipeline
|
|
38
|
+
|
|
39
|
+
def run_mission(self, mission_id: str, *, targets: Iterable[str]) -> Result[list[AgentMessage], Exception]:
|
|
40
|
+
"""Execute the pipeline across every target and merge the results."""
|
|
41
|
+
all_messages: list[AgentMessage] = []
|
|
42
|
+
for phase in self._pipeline:
|
|
43
|
+
for target in targets:
|
|
44
|
+
for agent_name in phase:
|
|
45
|
+
context = AgentContext(mission_id=mission_id, target=target)
|
|
46
|
+
outcome = self._orchestrator.dispatch(agent_name=agent_name, context=context)
|
|
47
|
+
if isinstance(outcome, Failure):
|
|
48
|
+
return outcome
|
|
49
|
+
all_messages.extend(outcome.value)
|
|
50
|
+
return Success(all_messages)
|
|
51
|
+
|
|
52
|
+
@staticmethod
|
|
53
|
+
def collect_findings(messages: Iterable[AgentMessage]) -> list[dict[str, object]]:
|
|
54
|
+
"""Extract ``finding``-kind payloads from merged agent messages."""
|
|
55
|
+
return [message.payload for message in messages if message.kind == "finding"]
|
hunterx/agents/events.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent event adapters.
|
|
5
|
+
|
|
6
|
+
Converts agent messages into canonical domain events so the rest of the
|
|
7
|
+
platform (event bus, telemetry, plugins) can observe agent activity uniformly.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from hunterx.agents.messaging import AgentMessage
|
|
13
|
+
from hunterx.domain.events import DomainEvent
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def message_to_event(message: AgentMessage) -> DomainEvent:
|
|
17
|
+
"""Wrap an agent message as a domain event."""
|
|
18
|
+
return DomainEvent(
|
|
19
|
+
event_type=f"agent.{message.kind}",
|
|
20
|
+
payload={
|
|
21
|
+
"message_id": message.message_id,
|
|
22
|
+
"sender": message.sender,
|
|
23
|
+
"recipient": message.recipient,
|
|
24
|
+
"data": message.payload,
|
|
25
|
+
},
|
|
26
|
+
source=message.sender,
|
|
27
|
+
occurred_at=message.created_at,
|
|
28
|
+
)
|
hunterx/agents/memory.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent memory."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import threading
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AgentMemory:
|
|
13
|
+
"""A bounded, thread-safe working memory for a single agent.
|
|
14
|
+
|
|
15
|
+
Stores observations and results as key/value entries. Used for the
|
|
16
|
+
lifetime of a mission run; long-term knowledge belongs in the knowledge
|
|
17
|
+
engine instead.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, *, max_entries: int = 1000) -> None:
|
|
21
|
+
self._max_entries = max_entries
|
|
22
|
+
self._entries: dict[str, Any] = {}
|
|
23
|
+
self._lock = threading.RLock()
|
|
24
|
+
|
|
25
|
+
def store(self, key: str, value: Any) -> None:
|
|
26
|
+
"""Store or overwrite an entry."""
|
|
27
|
+
with self._lock:
|
|
28
|
+
if key not in self._entries and len(self._entries) >= self._max_entries:
|
|
29
|
+
# Evict the oldest entry to keep the memory bounded.
|
|
30
|
+
self._entries.pop(next(iter(self._entries)))
|
|
31
|
+
self._entries[key] = value
|
|
32
|
+
|
|
33
|
+
def retrieve(self, key: str) -> Any | None:
|
|
34
|
+
"""Return an entry by key or ``None``."""
|
|
35
|
+
with self._lock:
|
|
36
|
+
return self._entries.get(key)
|
|
37
|
+
|
|
38
|
+
def forget(self, key: str) -> None:
|
|
39
|
+
"""Remove an entry by key."""
|
|
40
|
+
with self._lock:
|
|
41
|
+
self._entries.pop(key, None)
|
|
42
|
+
|
|
43
|
+
def snapshot(self) -> dict[str, Any]:
|
|
44
|
+
"""Return a shallow copy of all entries."""
|
|
45
|
+
with self._lock:
|
|
46
|
+
return dict(self._entries)
|
|
47
|
+
|
|
48
|
+
def clear(self) -> None:
|
|
49
|
+
"""Remove all entries."""
|
|
50
|
+
with self._lock:
|
|
51
|
+
self._entries.clear()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent messaging."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from hunterx.shared.ids import generate_id
|
|
12
|
+
from hunterx.shared.time import utcnow_iso
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True, slots=True)
|
|
16
|
+
class AgentMessage:
|
|
17
|
+
"""A message exchanged between agents or between an agent and a caller.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
sender: agent name that produced the message.
|
|
21
|
+
recipient: target agent name (``"*"`` for broadcast).
|
|
22
|
+
kind: message kind (``finding``, ``request``, ``result``, ``event``).
|
|
23
|
+
payload: JSON-serializable content.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
sender: str
|
|
28
|
+
recipient: str = "*"
|
|
29
|
+
kind: str = "event"
|
|
30
|
+
payload: dict[str, Any] = field(default_factory=dict)
|
|
31
|
+
message_id: str = field(default_factory=generate_id)
|
|
32
|
+
created_at: str = field(default_factory=utcnow_iso)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent orchestrator.
|
|
5
|
+
|
|
6
|
+
Routes messages to the right agents and sequences multi-agent runs. The
|
|
7
|
+
orchestrator is dependency-injection friendly: agents are supplied by a
|
|
8
|
+
registry, and routing policy is pluggable.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from hunterx.agents.base import AgentCapability, SecurityAgent
|
|
14
|
+
from hunterx.agents.context import AgentContext
|
|
15
|
+
from hunterx.agents.messaging import AgentMessage
|
|
16
|
+
from hunterx.agents.registry import AgentRegistry
|
|
17
|
+
from hunterx.domain.exceptions import OperationError, PluginNotFoundError
|
|
18
|
+
from hunterx.shared.result import Failure, Result, Success
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AgentOrchestrator:
|
|
22
|
+
"""Dispatch work to capable agents and fan their results back."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, registry: AgentRegistry) -> None:
|
|
25
|
+
self._registry = registry
|
|
26
|
+
|
|
27
|
+
def dispatch(
|
|
28
|
+
self,
|
|
29
|
+
*,
|
|
30
|
+
capability: AgentCapability | None = None,
|
|
31
|
+
agent_name: str | None = None,
|
|
32
|
+
context: AgentContext,
|
|
33
|
+
) -> Result[list[AgentMessage], Exception]:
|
|
34
|
+
"""Run the agent(s) matching ``capability`` or ``agent_name``.
|
|
35
|
+
|
|
36
|
+
Only one of ``capability`` / ``agent_name`` may be given. Returns the
|
|
37
|
+
collected messages produced by the executed agents.
|
|
38
|
+
"""
|
|
39
|
+
if agent_name is not None and capability is not None:
|
|
40
|
+
return Failure(OperationError("Specify either agent_name or capability, not both."))
|
|
41
|
+
|
|
42
|
+
agents: list[SecurityAgent]
|
|
43
|
+
if agent_name is not None:
|
|
44
|
+
try:
|
|
45
|
+
agents = [self._registry.get(agent_name)]
|
|
46
|
+
except PluginNotFoundError as exc:
|
|
47
|
+
return Failure(exc)
|
|
48
|
+
elif capability is not None:
|
|
49
|
+
agents = [agent for agent in self._registry.list() if agent.can(capability)]
|
|
50
|
+
else:
|
|
51
|
+
return Failure(OperationError("Specify agent_name or capability to dispatch."))
|
|
52
|
+
|
|
53
|
+
messages: list[AgentMessage] = []
|
|
54
|
+
for agent in agents:
|
|
55
|
+
try:
|
|
56
|
+
messages.extend(agent.run(context))
|
|
57
|
+
except Exception as exc:
|
|
58
|
+
return Failure(exc)
|
|
59
|
+
return Success(messages)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent registry."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from threading import RLock
|
|
9
|
+
|
|
10
|
+
from hunterx.agents.base import SecurityAgent
|
|
11
|
+
from hunterx.domain.exceptions import DuplicateRegistrationError, PluginNotFoundError
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AgentRegistry:
|
|
15
|
+
"""Thread-safe registry of available agents."""
|
|
16
|
+
|
|
17
|
+
def __init__(self) -> None:
|
|
18
|
+
self._agents: dict[str, SecurityAgent] = {}
|
|
19
|
+
self._lock = RLock()
|
|
20
|
+
|
|
21
|
+
def register(self, agent: SecurityAgent) -> None:
|
|
22
|
+
"""Register an agent instance by its name."""
|
|
23
|
+
with self._lock:
|
|
24
|
+
if agent.name in self._agents:
|
|
25
|
+
raise DuplicateRegistrationError(agent.name)
|
|
26
|
+
self._agents[agent.name] = agent
|
|
27
|
+
|
|
28
|
+
def unregister(self, name: str) -> None:
|
|
29
|
+
"""Remove an agent by name."""
|
|
30
|
+
with self._lock:
|
|
31
|
+
self._agents.pop(name, None)
|
|
32
|
+
|
|
33
|
+
def get(self, name: str) -> SecurityAgent:
|
|
34
|
+
"""Return an agent by name or raise :class:`PluginNotFoundError`."""
|
|
35
|
+
with self._lock:
|
|
36
|
+
agent = self._agents.get(name)
|
|
37
|
+
if agent is None:
|
|
38
|
+
raise PluginNotFoundError(name)
|
|
39
|
+
return agent
|
|
40
|
+
|
|
41
|
+
def list(self) -> list[SecurityAgent]:
|
|
42
|
+
"""Return all registered agents."""
|
|
43
|
+
with self._lock:
|
|
44
|
+
return list(self._agents.values())
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent scheduler.
|
|
5
|
+
|
|
6
|
+
Dispatches agent runs on a recurring schedule. This is the agent-level
|
|
7
|
+
scheduler; mission-level schedules belong to :mod:`hunterx.scheduler`.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import threading
|
|
13
|
+
import time
|
|
14
|
+
from dataclasses import dataclass, field
|
|
15
|
+
|
|
16
|
+
from hunterx.agents.context import AgentContext
|
|
17
|
+
from hunterx.agents.orchestrator import AgentOrchestrator
|
|
18
|
+
from hunterx.shared.result import Failure
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True, slots=True)
|
|
22
|
+
class AgentSchedule:
|
|
23
|
+
"""A recurring agent dispatch.
|
|
24
|
+
|
|
25
|
+
Attributes:
|
|
26
|
+
name: unique schedule name.
|
|
27
|
+
agent_name: agent to dispatch.
|
|
28
|
+
interval_seconds: seconds between dispatches.
|
|
29
|
+
mission_id: mission to attach to the context.
|
|
30
|
+
target: target identifier for the context.
|
|
31
|
+
parameters: extra run parameters.
|
|
32
|
+
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
name: str
|
|
36
|
+
agent_name: str
|
|
37
|
+
interval_seconds: float
|
|
38
|
+
mission_id: str = ""
|
|
39
|
+
target: str = ""
|
|
40
|
+
parameters: dict[str, object] = field(default_factory=dict)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class AgentScheduler:
|
|
44
|
+
"""Schedule agent dispatches in a background thread.
|
|
45
|
+
|
|
46
|
+
Each schedule runs independently; a failed dispatch is recorded and does
|
|
47
|
+
not stop future dispatches of that schedule.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(self, orchestrator: AgentOrchestrator) -> None:
|
|
51
|
+
self._orchestrator = orchestrator
|
|
52
|
+
self._schedules: dict[str, AgentSchedule] = {}
|
|
53
|
+
self._last_run: dict[str, float] = {}
|
|
54
|
+
self._stop = threading.Event()
|
|
55
|
+
self._thread: threading.Thread | None = None
|
|
56
|
+
|
|
57
|
+
def register(self, schedule: AgentSchedule) -> None:
|
|
58
|
+
"""Register a recurring schedule."""
|
|
59
|
+
self._schedules[schedule.name] = schedule
|
|
60
|
+
self._last_run[schedule.name] = 0.0
|
|
61
|
+
|
|
62
|
+
def start(self) -> None:
|
|
63
|
+
"""Start the background dispatch loop."""
|
|
64
|
+
if self._thread is not None and self._thread.is_alive():
|
|
65
|
+
return
|
|
66
|
+
self._stop.clear()
|
|
67
|
+
self._thread = threading.Thread(target=self._loop, name="hunterx-agent-scheduler", daemon=True)
|
|
68
|
+
self._thread.start()
|
|
69
|
+
|
|
70
|
+
def stop(self) -> None:
|
|
71
|
+
"""Stop the background dispatch loop."""
|
|
72
|
+
self._stop.set()
|
|
73
|
+
if self._thread is not None:
|
|
74
|
+
self._thread.join(timeout=2.0)
|
|
75
|
+
self._thread = None
|
|
76
|
+
|
|
77
|
+
def _loop(self) -> None:
|
|
78
|
+
while not self._stop.is_set():
|
|
79
|
+
now = time.monotonic()
|
|
80
|
+
for schedule in list(self._schedules.values()):
|
|
81
|
+
if now - self._last_run[schedule.name] >= schedule.interval_seconds:
|
|
82
|
+
self._last_run[schedule.name] = now
|
|
83
|
+
self._dispatch(schedule)
|
|
84
|
+
self._stop.wait(1.0)
|
|
85
|
+
|
|
86
|
+
def _dispatch(self, schedule: AgentSchedule) -> None:
|
|
87
|
+
context = AgentContext(
|
|
88
|
+
mission_id=schedule.mission_id,
|
|
89
|
+
target=schedule.target,
|
|
90
|
+
parameters=dict(schedule.parameters),
|
|
91
|
+
)
|
|
92
|
+
outcome = self._orchestrator.dispatch(agent_name=schedule.agent_name, context=context)
|
|
93
|
+
if isinstance(outcome, Failure):
|
|
94
|
+
# Recorded only; the loop keeps scheduling.
|
|
95
|
+
return
|
hunterx/agents/state.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""Agent state."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AgentState(Enum):
|
|
12
|
+
"""Lifecycle states of an agent."""
|
|
13
|
+
|
|
14
|
+
IDLE = "idle"
|
|
15
|
+
ACTIVE = "active"
|
|
16
|
+
BLOCKED = "blocked"
|
|
17
|
+
STOPPED = "stopped"
|
hunterx/api/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copyright (c) 2026 Ahmed Awad (NullC0d3)
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""REST API framework.
|
|
5
|
+
|
|
6
|
+
Provides a FastAPI application factory, a router registry for endpoint
|
|
7
|
+
definition, base schemas and dependency helpers. Importing ``hunterx.api``
|
|
8
|
+
never requires FastAPI; it is only needed to build the app.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from hunterx.api.router import ApiRouter, RouteSpec
|
|
14
|
+
from hunterx.api.schemas import ErrorResponse
|
|
15
|
+
|
|
16
|
+
__all__ = ["ApiRouter", "RouteSpec", "ErrorResponse"]
|