aiptx 2.0.7__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.
- aipt_v2/__init__.py +110 -0
- aipt_v2/__main__.py +24 -0
- aipt_v2/agents/AIPTxAgent/__init__.py +10 -0
- aipt_v2/agents/AIPTxAgent/aiptx_agent.py +211 -0
- aipt_v2/agents/__init__.py +46 -0
- aipt_v2/agents/base.py +520 -0
- aipt_v2/agents/exploit_agent.py +688 -0
- aipt_v2/agents/ptt.py +406 -0
- aipt_v2/agents/state.py +168 -0
- aipt_v2/app.py +957 -0
- aipt_v2/browser/__init__.py +31 -0
- aipt_v2/browser/automation.py +458 -0
- aipt_v2/browser/crawler.py +453 -0
- aipt_v2/cli.py +2933 -0
- aipt_v2/compliance/__init__.py +71 -0
- aipt_v2/compliance/compliance_report.py +449 -0
- aipt_v2/compliance/framework_mapper.py +424 -0
- aipt_v2/compliance/nist_mapping.py +345 -0
- aipt_v2/compliance/owasp_mapping.py +330 -0
- aipt_v2/compliance/pci_mapping.py +297 -0
- aipt_v2/config.py +341 -0
- aipt_v2/core/__init__.py +43 -0
- aipt_v2/core/agent.py +630 -0
- aipt_v2/core/llm.py +395 -0
- aipt_v2/core/memory.py +305 -0
- aipt_v2/core/ptt.py +329 -0
- aipt_v2/database/__init__.py +14 -0
- aipt_v2/database/models.py +232 -0
- aipt_v2/database/repository.py +384 -0
- aipt_v2/docker/__init__.py +23 -0
- aipt_v2/docker/builder.py +260 -0
- aipt_v2/docker/manager.py +222 -0
- aipt_v2/docker/sandbox.py +371 -0
- aipt_v2/evasion/__init__.py +58 -0
- aipt_v2/evasion/request_obfuscator.py +272 -0
- aipt_v2/evasion/tls_fingerprint.py +285 -0
- aipt_v2/evasion/ua_rotator.py +301 -0
- aipt_v2/evasion/waf_bypass.py +439 -0
- aipt_v2/execution/__init__.py +23 -0
- aipt_v2/execution/executor.py +302 -0
- aipt_v2/execution/parser.py +544 -0
- aipt_v2/execution/terminal.py +337 -0
- aipt_v2/health.py +437 -0
- aipt_v2/intelligence/__init__.py +194 -0
- aipt_v2/intelligence/adaptation.py +474 -0
- aipt_v2/intelligence/auth.py +520 -0
- aipt_v2/intelligence/chaining.py +775 -0
- aipt_v2/intelligence/correlation.py +536 -0
- aipt_v2/intelligence/cve_aipt.py +334 -0
- aipt_v2/intelligence/cve_info.py +1111 -0
- aipt_v2/intelligence/knowledge_graph.py +590 -0
- aipt_v2/intelligence/learning.py +626 -0
- aipt_v2/intelligence/llm_analyzer.py +502 -0
- aipt_v2/intelligence/llm_tool_selector.py +518 -0
- aipt_v2/intelligence/payload_generator.py +562 -0
- aipt_v2/intelligence/rag.py +239 -0
- aipt_v2/intelligence/scope.py +442 -0
- aipt_v2/intelligence/searchers/__init__.py +5 -0
- aipt_v2/intelligence/searchers/exploitdb_searcher.py +523 -0
- aipt_v2/intelligence/searchers/github_searcher.py +467 -0
- aipt_v2/intelligence/searchers/google_searcher.py +281 -0
- aipt_v2/intelligence/tools.json +443 -0
- aipt_v2/intelligence/triage.py +670 -0
- aipt_v2/interactive_shell.py +559 -0
- aipt_v2/interface/__init__.py +5 -0
- aipt_v2/interface/cli.py +230 -0
- aipt_v2/interface/main.py +501 -0
- aipt_v2/interface/tui.py +1276 -0
- aipt_v2/interface/utils.py +583 -0
- aipt_v2/llm/__init__.py +39 -0
- aipt_v2/llm/config.py +26 -0
- aipt_v2/llm/llm.py +514 -0
- aipt_v2/llm/memory.py +214 -0
- aipt_v2/llm/request_queue.py +89 -0
- aipt_v2/llm/utils.py +89 -0
- aipt_v2/local_tool_installer.py +1467 -0
- aipt_v2/models/__init__.py +15 -0
- aipt_v2/models/findings.py +295 -0
- aipt_v2/models/phase_result.py +224 -0
- aipt_v2/models/scan_config.py +207 -0
- aipt_v2/monitoring/grafana/dashboards/aipt-dashboard.json +355 -0
- aipt_v2/monitoring/grafana/dashboards/default.yml +17 -0
- aipt_v2/monitoring/grafana/datasources/prometheus.yml +17 -0
- aipt_v2/monitoring/prometheus.yml +60 -0
- aipt_v2/orchestration/__init__.py +52 -0
- aipt_v2/orchestration/pipeline.py +398 -0
- aipt_v2/orchestration/progress.py +300 -0
- aipt_v2/orchestration/scheduler.py +296 -0
- aipt_v2/orchestrator.py +2427 -0
- aipt_v2/payloads/__init__.py +27 -0
- aipt_v2/payloads/cmdi.py +150 -0
- aipt_v2/payloads/sqli.py +263 -0
- aipt_v2/payloads/ssrf.py +204 -0
- aipt_v2/payloads/templates.py +222 -0
- aipt_v2/payloads/traversal.py +166 -0
- aipt_v2/payloads/xss.py +204 -0
- aipt_v2/prompts/__init__.py +60 -0
- aipt_v2/proxy/__init__.py +29 -0
- aipt_v2/proxy/history.py +352 -0
- aipt_v2/proxy/interceptor.py +452 -0
- aipt_v2/recon/__init__.py +44 -0
- aipt_v2/recon/dns.py +241 -0
- aipt_v2/recon/osint.py +367 -0
- aipt_v2/recon/subdomain.py +372 -0
- aipt_v2/recon/tech_detect.py +311 -0
- aipt_v2/reports/__init__.py +17 -0
- aipt_v2/reports/generator.py +313 -0
- aipt_v2/reports/html_report.py +378 -0
- aipt_v2/runtime/__init__.py +53 -0
- aipt_v2/runtime/base.py +30 -0
- aipt_v2/runtime/docker.py +401 -0
- aipt_v2/runtime/local.py +346 -0
- aipt_v2/runtime/tool_server.py +205 -0
- aipt_v2/runtime/vps.py +830 -0
- aipt_v2/scanners/__init__.py +28 -0
- aipt_v2/scanners/base.py +273 -0
- aipt_v2/scanners/nikto.py +244 -0
- aipt_v2/scanners/nmap.py +402 -0
- aipt_v2/scanners/nuclei.py +273 -0
- aipt_v2/scanners/web.py +454 -0
- aipt_v2/scripts/security_audit.py +366 -0
- aipt_v2/setup_wizard.py +941 -0
- aipt_v2/skills/__init__.py +80 -0
- aipt_v2/skills/agents/__init__.py +14 -0
- aipt_v2/skills/agents/api_tester.py +706 -0
- aipt_v2/skills/agents/base.py +477 -0
- aipt_v2/skills/agents/code_review.py +459 -0
- aipt_v2/skills/agents/security_agent.py +336 -0
- aipt_v2/skills/agents/web_pentest.py +818 -0
- aipt_v2/skills/prompts/__init__.py +647 -0
- aipt_v2/system_detector.py +539 -0
- aipt_v2/telemetry/__init__.py +7 -0
- aipt_v2/telemetry/tracer.py +347 -0
- aipt_v2/terminal/__init__.py +28 -0
- aipt_v2/terminal/executor.py +400 -0
- aipt_v2/terminal/sandbox.py +350 -0
- aipt_v2/tools/__init__.py +44 -0
- aipt_v2/tools/active_directory/__init__.py +78 -0
- aipt_v2/tools/active_directory/ad_config.py +238 -0
- aipt_v2/tools/active_directory/bloodhound_wrapper.py +447 -0
- aipt_v2/tools/active_directory/kerberos_attacks.py +430 -0
- aipt_v2/tools/active_directory/ldap_enum.py +533 -0
- aipt_v2/tools/active_directory/smb_attacks.py +505 -0
- aipt_v2/tools/agents_graph/__init__.py +19 -0
- aipt_v2/tools/agents_graph/agents_graph_actions.py +69 -0
- aipt_v2/tools/api_security/__init__.py +76 -0
- aipt_v2/tools/api_security/api_discovery.py +608 -0
- aipt_v2/tools/api_security/graphql_scanner.py +622 -0
- aipt_v2/tools/api_security/jwt_analyzer.py +577 -0
- aipt_v2/tools/api_security/openapi_fuzzer.py +761 -0
- aipt_v2/tools/browser/__init__.py +5 -0
- aipt_v2/tools/browser/browser_actions.py +238 -0
- aipt_v2/tools/browser/browser_instance.py +535 -0
- aipt_v2/tools/browser/tab_manager.py +344 -0
- aipt_v2/tools/cloud/__init__.py +70 -0
- aipt_v2/tools/cloud/cloud_config.py +273 -0
- aipt_v2/tools/cloud/cloud_scanner.py +639 -0
- aipt_v2/tools/cloud/prowler_tool.py +571 -0
- aipt_v2/tools/cloud/scoutsuite_tool.py +359 -0
- aipt_v2/tools/executor.py +307 -0
- aipt_v2/tools/parser.py +408 -0
- aipt_v2/tools/proxy/__init__.py +5 -0
- aipt_v2/tools/proxy/proxy_actions.py +103 -0
- aipt_v2/tools/proxy/proxy_manager.py +789 -0
- aipt_v2/tools/registry.py +196 -0
- aipt_v2/tools/scanners/__init__.py +343 -0
- aipt_v2/tools/scanners/acunetix_tool.py +712 -0
- aipt_v2/tools/scanners/burp_tool.py +631 -0
- aipt_v2/tools/scanners/config.py +156 -0
- aipt_v2/tools/scanners/nessus_tool.py +588 -0
- aipt_v2/tools/scanners/zap_tool.py +612 -0
- aipt_v2/tools/terminal/__init__.py +5 -0
- aipt_v2/tools/terminal/terminal_actions.py +37 -0
- aipt_v2/tools/terminal/terminal_manager.py +153 -0
- aipt_v2/tools/terminal/terminal_session.py +449 -0
- aipt_v2/tools/tool_processing.py +108 -0
- aipt_v2/utils/__init__.py +17 -0
- aipt_v2/utils/logging.py +202 -0
- aipt_v2/utils/model_manager.py +187 -0
- aipt_v2/utils/searchers/__init__.py +269 -0
- aipt_v2/verify_install.py +793 -0
- aiptx-2.0.7.dist-info/METADATA +345 -0
- aiptx-2.0.7.dist-info/RECORD +187 -0
- aiptx-2.0.7.dist-info/WHEEL +5 -0
- aiptx-2.0.7.dist-info/entry_points.txt +7 -0
- aiptx-2.0.7.dist-info/licenses/LICENSE +21 -0
- aiptx-2.0.7.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIPT Scan Configuration
|
|
3
|
+
|
|
4
|
+
Defines scan modes and configuration options for the unified pipeline.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
from enum import Enum
|
|
10
|
+
from typing import Any
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ScanMode(Enum):
|
|
14
|
+
"""
|
|
15
|
+
Scan intensity modes
|
|
16
|
+
|
|
17
|
+
QUICK: Fast reconnaissance + AI-autonomous testing only (Aipt)
|
|
18
|
+
STANDARD: Traditional scanners + AI testing (balanced)
|
|
19
|
+
COMPREHENSIVE: All scanners + aggressive AI testing + exploitation
|
|
20
|
+
STEALTH: Low-noise scanning with minimal active probing
|
|
21
|
+
"""
|
|
22
|
+
QUICK = "quick"
|
|
23
|
+
STANDARD = "standard"
|
|
24
|
+
COMPREHENSIVE = "comprehensive"
|
|
25
|
+
STEALTH = "stealth"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ScannerType(Enum):
|
|
29
|
+
"""Available scanners in the pipeline"""
|
|
30
|
+
# Traditional DAST
|
|
31
|
+
ACUNETIX = "acunetix"
|
|
32
|
+
BURP_SUITE = "burp"
|
|
33
|
+
ZAP = "zap"
|
|
34
|
+
|
|
35
|
+
# Template-based
|
|
36
|
+
NUCLEI = "nuclei"
|
|
37
|
+
|
|
38
|
+
# AI-Autonomous
|
|
39
|
+
STRIX = "aipt"
|
|
40
|
+
|
|
41
|
+
# Reconnaissance
|
|
42
|
+
NMAP = "nmap"
|
|
43
|
+
SUBFINDER = "subfinder"
|
|
44
|
+
HTTPX = "httpx"
|
|
45
|
+
|
|
46
|
+
# Fuzzing
|
|
47
|
+
FFUF = "ffuf"
|
|
48
|
+
SQLMAP = "sqlmap"
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@dataclass
|
|
52
|
+
class ScanConfig:
|
|
53
|
+
"""
|
|
54
|
+
Unified scan configuration for AIPT
|
|
55
|
+
|
|
56
|
+
This config controls all aspects of the scanning pipeline:
|
|
57
|
+
- Target specification
|
|
58
|
+
- Scanner selection and configuration
|
|
59
|
+
- AI agent settings
|
|
60
|
+
- Output and reporting options
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
# Target configuration
|
|
64
|
+
target: str # Primary target URL or domain
|
|
65
|
+
scope: list[str] = field(default_factory=list) # Additional in-scope URLs/patterns
|
|
66
|
+
exclude_patterns: list[str] = field(default_factory=list) # URLs to exclude
|
|
67
|
+
|
|
68
|
+
# Scan mode
|
|
69
|
+
mode: ScanMode = ScanMode.STANDARD
|
|
70
|
+
|
|
71
|
+
# Phase configuration
|
|
72
|
+
enable_recon: bool = True
|
|
73
|
+
enable_traditional_scan: bool = True
|
|
74
|
+
enable_ai_pentest: bool = True # NEW: Aipt AI-autonomous testing
|
|
75
|
+
enable_exploitation: bool = False # Disabled by default for safety
|
|
76
|
+
enable_reporting: bool = True
|
|
77
|
+
|
|
78
|
+
# Scanner selection
|
|
79
|
+
enabled_scanners: list[ScannerType] = field(default_factory=lambda: [
|
|
80
|
+
ScannerType.NUCLEI,
|
|
81
|
+
ScannerType.STRIX,
|
|
82
|
+
])
|
|
83
|
+
|
|
84
|
+
# Traditional scanner configs
|
|
85
|
+
acunetix_config: dict[str, Any] = field(default_factory=dict)
|
|
86
|
+
burp_config: dict[str, Any] = field(default_factory=dict)
|
|
87
|
+
zap_config: dict[str, Any] = field(default_factory=dict)
|
|
88
|
+
nuclei_config: dict[str, Any] = field(default_factory=dict)
|
|
89
|
+
|
|
90
|
+
# Aipt AI configuration
|
|
91
|
+
aipt_config: "AiptConfig" = field(default_factory=lambda: AiptConfig())
|
|
92
|
+
|
|
93
|
+
# Authentication
|
|
94
|
+
auth_config: dict[str, Any] | None = None
|
|
95
|
+
|
|
96
|
+
# Rate limiting
|
|
97
|
+
max_requests_per_second: int = 10
|
|
98
|
+
max_concurrent_scans: int = 3
|
|
99
|
+
|
|
100
|
+
# Timeouts (in seconds)
|
|
101
|
+
phase_timeout: int = 3600 # 1 hour per phase
|
|
102
|
+
total_timeout: int = 14400 # 4 hours total
|
|
103
|
+
|
|
104
|
+
# Output configuration
|
|
105
|
+
output_dir: str = "./aipt_results"
|
|
106
|
+
report_formats: list[str] = field(default_factory=lambda: ["html", "json", "pdf"])
|
|
107
|
+
|
|
108
|
+
# Verbosity
|
|
109
|
+
verbose: bool = False
|
|
110
|
+
debug: bool = False
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def quick(cls, target: str) -> "ScanConfig":
|
|
114
|
+
"""Create a quick scan config (AI + Nuclei only)"""
|
|
115
|
+
return cls(
|
|
116
|
+
target=target,
|
|
117
|
+
mode=ScanMode.QUICK,
|
|
118
|
+
enable_recon=True,
|
|
119
|
+
enable_traditional_scan=False,
|
|
120
|
+
enable_ai_pentest=True,
|
|
121
|
+
enable_exploitation=False,
|
|
122
|
+
enabled_scanners=[ScannerType.NUCLEI, ScannerType.STRIX],
|
|
123
|
+
phase_timeout=1800, # 30 min
|
|
124
|
+
total_timeout=3600, # 1 hour
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
@classmethod
|
|
128
|
+
def standard(cls, target: str) -> "ScanConfig":
|
|
129
|
+
"""Create a standard scan config"""
|
|
130
|
+
return cls(
|
|
131
|
+
target=target,
|
|
132
|
+
mode=ScanMode.STANDARD,
|
|
133
|
+
enabled_scanners=[
|
|
134
|
+
ScannerType.NUCLEI,
|
|
135
|
+
ScannerType.ZAP,
|
|
136
|
+
ScannerType.STRIX,
|
|
137
|
+
],
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def comprehensive(cls, target: str) -> "ScanConfig":
|
|
142
|
+
"""Create a comprehensive scan config (all scanners + exploitation)"""
|
|
143
|
+
return cls(
|
|
144
|
+
target=target,
|
|
145
|
+
mode=ScanMode.COMPREHENSIVE,
|
|
146
|
+
enable_exploitation=True,
|
|
147
|
+
enabled_scanners=[
|
|
148
|
+
ScannerType.ACUNETIX,
|
|
149
|
+
ScannerType.BURP_SUITE,
|
|
150
|
+
ScannerType.ZAP,
|
|
151
|
+
ScannerType.NUCLEI,
|
|
152
|
+
ScannerType.STRIX,
|
|
153
|
+
],
|
|
154
|
+
aipt_config=AiptConfig(
|
|
155
|
+
modules=["all"],
|
|
156
|
+
autonomous_exploitation=True,
|
|
157
|
+
max_agent_iterations=50,
|
|
158
|
+
),
|
|
159
|
+
phase_timeout=7200, # 2 hours
|
|
160
|
+
total_timeout=28800, # 8 hours
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
@dataclass
|
|
165
|
+
class AiptConfig:
|
|
166
|
+
"""
|
|
167
|
+
Aipt AI Agent Configuration
|
|
168
|
+
|
|
169
|
+
Controls how the AI-autonomous pentesting phase operates.
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
# LLM configuration
|
|
173
|
+
llm_provider: str = "openai" # openai, anthropic, azure
|
|
174
|
+
llm_model: str = "gpt-4o" # gpt-4o, claude-3-5-sonnet, etc.
|
|
175
|
+
llm_api_key: str | None = None # If None, uses environment variable
|
|
176
|
+
|
|
177
|
+
# Prompt modules to load (vulnerability knowledge)
|
|
178
|
+
modules: list[str] = field(default_factory=lambda: [
|
|
179
|
+
"sql_injection",
|
|
180
|
+
"xss",
|
|
181
|
+
"rce",
|
|
182
|
+
"ssrf",
|
|
183
|
+
"auth_bypass",
|
|
184
|
+
])
|
|
185
|
+
|
|
186
|
+
# Agent behavior
|
|
187
|
+
max_agent_iterations: int = 30 # Max tool calls per session
|
|
188
|
+
autonomous_exploitation: bool = False # If True, attempts full exploitation
|
|
189
|
+
confirm_before_exploit: bool = True # Require human confirmation
|
|
190
|
+
|
|
191
|
+
# Scope constraints
|
|
192
|
+
stay_in_scope: bool = True
|
|
193
|
+
allowed_methods: list[str] = field(default_factory=lambda: ["GET", "POST"])
|
|
194
|
+
disallowed_paths: list[str] = field(default_factory=lambda: [
|
|
195
|
+
"/admin",
|
|
196
|
+
"/logout",
|
|
197
|
+
"/delete",
|
|
198
|
+
])
|
|
199
|
+
|
|
200
|
+
# Sandbox settings
|
|
201
|
+
use_docker_sandbox: bool = True
|
|
202
|
+
sandbox_network_mode: str = "bridge"
|
|
203
|
+
sandbox_timeout: int = 300 # 5 min per sandbox session
|
|
204
|
+
|
|
205
|
+
# Output
|
|
206
|
+
save_agent_traces: bool = True
|
|
207
|
+
trace_output_dir: str = "./aipt_traces"
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
{
|
|
2
|
+
"annotations": {
|
|
3
|
+
"list": []
|
|
4
|
+
},
|
|
5
|
+
"editable": true,
|
|
6
|
+
"fiscalYearStartMonth": 0,
|
|
7
|
+
"graphTooltip": 0,
|
|
8
|
+
"id": null,
|
|
9
|
+
"links": [],
|
|
10
|
+
"liveNow": false,
|
|
11
|
+
"panels": [
|
|
12
|
+
{
|
|
13
|
+
"datasource": {
|
|
14
|
+
"type": "prometheus",
|
|
15
|
+
"uid": "prometheus"
|
|
16
|
+
},
|
|
17
|
+
"fieldConfig": {
|
|
18
|
+
"defaults": {
|
|
19
|
+
"color": {
|
|
20
|
+
"mode": "palette-classic"
|
|
21
|
+
},
|
|
22
|
+
"mappings": [],
|
|
23
|
+
"thresholds": {
|
|
24
|
+
"mode": "absolute",
|
|
25
|
+
"steps": [
|
|
26
|
+
{ "color": "green", "value": null },
|
|
27
|
+
{ "color": "yellow", "value": 80 },
|
|
28
|
+
{ "color": "red", "value": 90 }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"unit": "percent"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"gridPos": { "h": 8, "w": 6, "x": 0, "y": 0 },
|
|
35
|
+
"id": 1,
|
|
36
|
+
"options": {
|
|
37
|
+
"orientation": "auto",
|
|
38
|
+
"reduceOptions": {
|
|
39
|
+
"calcs": ["lastNotNull"],
|
|
40
|
+
"fields": "",
|
|
41
|
+
"values": false
|
|
42
|
+
},
|
|
43
|
+
"showThresholdLabels": false,
|
|
44
|
+
"showThresholdMarkers": true
|
|
45
|
+
},
|
|
46
|
+
"pluginVersion": "10.0.0",
|
|
47
|
+
"targets": [
|
|
48
|
+
{
|
|
49
|
+
"expr": "process_cpu_percent",
|
|
50
|
+
"refId": "A"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"title": "CPU Usage",
|
|
54
|
+
"type": "gauge"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"datasource": {
|
|
58
|
+
"type": "prometheus",
|
|
59
|
+
"uid": "prometheus"
|
|
60
|
+
},
|
|
61
|
+
"fieldConfig": {
|
|
62
|
+
"defaults": {
|
|
63
|
+
"color": {
|
|
64
|
+
"mode": "palette-classic"
|
|
65
|
+
},
|
|
66
|
+
"mappings": [],
|
|
67
|
+
"thresholds": {
|
|
68
|
+
"mode": "absolute",
|
|
69
|
+
"steps": [
|
|
70
|
+
{ "color": "green", "value": null }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"unit": "bytes"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"gridPos": { "h": 8, "w": 6, "x": 6, "y": 0 },
|
|
77
|
+
"id": 2,
|
|
78
|
+
"options": {
|
|
79
|
+
"orientation": "auto",
|
|
80
|
+
"reduceOptions": {
|
|
81
|
+
"calcs": ["lastNotNull"],
|
|
82
|
+
"fields": "",
|
|
83
|
+
"values": false
|
|
84
|
+
},
|
|
85
|
+
"showThresholdLabels": false,
|
|
86
|
+
"showThresholdMarkers": true
|
|
87
|
+
},
|
|
88
|
+
"pluginVersion": "10.0.0",
|
|
89
|
+
"targets": [
|
|
90
|
+
{
|
|
91
|
+
"expr": "process_resident_memory_bytes",
|
|
92
|
+
"refId": "A"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"title": "Memory Usage",
|
|
96
|
+
"type": "gauge"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"datasource": {
|
|
100
|
+
"type": "prometheus",
|
|
101
|
+
"uid": "prometheus"
|
|
102
|
+
},
|
|
103
|
+
"fieldConfig": {
|
|
104
|
+
"defaults": {
|
|
105
|
+
"color": {
|
|
106
|
+
"mode": "palette-classic"
|
|
107
|
+
},
|
|
108
|
+
"mappings": [],
|
|
109
|
+
"thresholds": {
|
|
110
|
+
"mode": "absolute",
|
|
111
|
+
"steps": [
|
|
112
|
+
{ "color": "green", "value": null }
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"unit": "s"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"gridPos": { "h": 8, "w": 6, "x": 12, "y": 0 },
|
|
119
|
+
"id": 3,
|
|
120
|
+
"options": {
|
|
121
|
+
"colorMode": "value",
|
|
122
|
+
"graphMode": "area",
|
|
123
|
+
"justifyMode": "auto",
|
|
124
|
+
"orientation": "auto",
|
|
125
|
+
"reduceOptions": {
|
|
126
|
+
"calcs": ["lastNotNull"],
|
|
127
|
+
"fields": "",
|
|
128
|
+
"values": false
|
|
129
|
+
},
|
|
130
|
+
"textMode": "auto"
|
|
131
|
+
},
|
|
132
|
+
"pluginVersion": "10.0.0",
|
|
133
|
+
"targets": [
|
|
134
|
+
{
|
|
135
|
+
"expr": "aipt_uptime_seconds",
|
|
136
|
+
"refId": "A"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"title": "Uptime",
|
|
140
|
+
"type": "stat"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"datasource": {
|
|
144
|
+
"type": "prometheus",
|
|
145
|
+
"uid": "prometheus"
|
|
146
|
+
},
|
|
147
|
+
"fieldConfig": {
|
|
148
|
+
"defaults": {
|
|
149
|
+
"color": {
|
|
150
|
+
"mode": "palette-classic"
|
|
151
|
+
},
|
|
152
|
+
"mappings": [],
|
|
153
|
+
"thresholds": {
|
|
154
|
+
"mode": "absolute",
|
|
155
|
+
"steps": [
|
|
156
|
+
{ "color": "green", "value": null }
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"gridPos": { "h": 8, "w": 6, "x": 18, "y": 0 },
|
|
162
|
+
"id": 4,
|
|
163
|
+
"options": {
|
|
164
|
+
"colorMode": "value",
|
|
165
|
+
"graphMode": "area",
|
|
166
|
+
"justifyMode": "auto",
|
|
167
|
+
"orientation": "auto",
|
|
168
|
+
"reduceOptions": {
|
|
169
|
+
"calcs": ["lastNotNull"],
|
|
170
|
+
"fields": "",
|
|
171
|
+
"values": false
|
|
172
|
+
},
|
|
173
|
+
"textMode": "auto"
|
|
174
|
+
},
|
|
175
|
+
"pluginVersion": "10.0.0",
|
|
176
|
+
"targets": [
|
|
177
|
+
{
|
|
178
|
+
"expr": "aipt_http_requests_total",
|
|
179
|
+
"refId": "A"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"title": "Total Requests",
|
|
183
|
+
"type": "stat"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"datasource": {
|
|
187
|
+
"type": "prometheus",
|
|
188
|
+
"uid": "prometheus"
|
|
189
|
+
},
|
|
190
|
+
"fieldConfig": {
|
|
191
|
+
"defaults": {
|
|
192
|
+
"color": {
|
|
193
|
+
"mode": "palette-classic"
|
|
194
|
+
},
|
|
195
|
+
"custom": {
|
|
196
|
+
"axisCenteredZero": false,
|
|
197
|
+
"axisColorMode": "text",
|
|
198
|
+
"axisLabel": "",
|
|
199
|
+
"axisPlacement": "auto",
|
|
200
|
+
"barAlignment": 0,
|
|
201
|
+
"drawStyle": "line",
|
|
202
|
+
"fillOpacity": 10,
|
|
203
|
+
"gradientMode": "none",
|
|
204
|
+
"hideFrom": {
|
|
205
|
+
"legend": false,
|
|
206
|
+
"tooltip": false,
|
|
207
|
+
"viz": false
|
|
208
|
+
},
|
|
209
|
+
"lineInterpolation": "linear",
|
|
210
|
+
"lineWidth": 1,
|
|
211
|
+
"pointSize": 5,
|
|
212
|
+
"scaleDistribution": {
|
|
213
|
+
"type": "linear"
|
|
214
|
+
},
|
|
215
|
+
"showPoints": "auto",
|
|
216
|
+
"spanNulls": false,
|
|
217
|
+
"stacking": {
|
|
218
|
+
"group": "A",
|
|
219
|
+
"mode": "none"
|
|
220
|
+
},
|
|
221
|
+
"thresholdsStyle": {
|
|
222
|
+
"mode": "off"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"mappings": [],
|
|
226
|
+
"thresholds": {
|
|
227
|
+
"mode": "absolute",
|
|
228
|
+
"steps": [
|
|
229
|
+
{ "color": "green", "value": null }
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 },
|
|
235
|
+
"id": 5,
|
|
236
|
+
"options": {
|
|
237
|
+
"legend": {
|
|
238
|
+
"calcs": [],
|
|
239
|
+
"displayMode": "list",
|
|
240
|
+
"placement": "bottom",
|
|
241
|
+
"showLegend": true
|
|
242
|
+
},
|
|
243
|
+
"tooltip": {
|
|
244
|
+
"mode": "single",
|
|
245
|
+
"sort": "none"
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"targets": [
|
|
249
|
+
{
|
|
250
|
+
"expr": "rate(aipt_http_requests_total[5m])",
|
|
251
|
+
"legendFormat": "Requests/sec",
|
|
252
|
+
"refId": "A"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"title": "Request Rate",
|
|
256
|
+
"type": "timeseries"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"datasource": {
|
|
260
|
+
"type": "prometheus",
|
|
261
|
+
"uid": "prometheus"
|
|
262
|
+
},
|
|
263
|
+
"fieldConfig": {
|
|
264
|
+
"defaults": {
|
|
265
|
+
"color": {
|
|
266
|
+
"mode": "palette-classic"
|
|
267
|
+
},
|
|
268
|
+
"custom": {
|
|
269
|
+
"axisCenteredZero": false,
|
|
270
|
+
"axisColorMode": "text",
|
|
271
|
+
"axisLabel": "",
|
|
272
|
+
"axisPlacement": "auto",
|
|
273
|
+
"barAlignment": 0,
|
|
274
|
+
"drawStyle": "line",
|
|
275
|
+
"fillOpacity": 10,
|
|
276
|
+
"gradientMode": "none",
|
|
277
|
+
"hideFrom": {
|
|
278
|
+
"legend": false,
|
|
279
|
+
"tooltip": false,
|
|
280
|
+
"viz": false
|
|
281
|
+
},
|
|
282
|
+
"lineInterpolation": "linear",
|
|
283
|
+
"lineWidth": 1,
|
|
284
|
+
"pointSize": 5,
|
|
285
|
+
"scaleDistribution": {
|
|
286
|
+
"type": "linear"
|
|
287
|
+
},
|
|
288
|
+
"showPoints": "auto",
|
|
289
|
+
"spanNulls": false,
|
|
290
|
+
"stacking": {
|
|
291
|
+
"group": "A",
|
|
292
|
+
"mode": "none"
|
|
293
|
+
},
|
|
294
|
+
"thresholdsStyle": {
|
|
295
|
+
"mode": "off"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"mappings": [],
|
|
299
|
+
"thresholds": {
|
|
300
|
+
"mode": "absolute",
|
|
301
|
+
"steps": [
|
|
302
|
+
{ "color": "green", "value": null },
|
|
303
|
+
{ "color": "red", "value": 80 }
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 },
|
|
309
|
+
"id": 6,
|
|
310
|
+
"options": {
|
|
311
|
+
"legend": {
|
|
312
|
+
"calcs": [],
|
|
313
|
+
"displayMode": "list",
|
|
314
|
+
"placement": "bottom",
|
|
315
|
+
"showLegend": true
|
|
316
|
+
},
|
|
317
|
+
"tooltip": {
|
|
318
|
+
"mode": "single",
|
|
319
|
+
"sort": "none"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"targets": [
|
|
323
|
+
{
|
|
324
|
+
"expr": "aipt_scan_requests_total",
|
|
325
|
+
"legendFormat": "Scans",
|
|
326
|
+
"refId": "A"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"expr": "aipt_tool_invocations_total",
|
|
330
|
+
"legendFormat": "Tool Invocations",
|
|
331
|
+
"refId": "B"
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
"title": "Scan & Tool Activity",
|
|
335
|
+
"type": "timeseries"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"refresh": "5s",
|
|
339
|
+
"schemaVersion": 38,
|
|
340
|
+
"style": "dark",
|
|
341
|
+
"tags": ["aipt", "security", "pentest"],
|
|
342
|
+
"templating": {
|
|
343
|
+
"list": []
|
|
344
|
+
},
|
|
345
|
+
"time": {
|
|
346
|
+
"from": "now-1h",
|
|
347
|
+
"to": "now"
|
|
348
|
+
},
|
|
349
|
+
"timepicker": {},
|
|
350
|
+
"timezone": "",
|
|
351
|
+
"title": "AIPT v2 Dashboard",
|
|
352
|
+
"uid": "aipt-v2-main",
|
|
353
|
+
"version": 1,
|
|
354
|
+
"weekStart": ""
|
|
355
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Grafana Dashboard Provisioning
|
|
3
|
+
# =============================================================================
|
|
4
|
+
|
|
5
|
+
apiVersion: 1
|
|
6
|
+
|
|
7
|
+
providers:
|
|
8
|
+
- name: 'AIPT Dashboards'
|
|
9
|
+
orgId: 1
|
|
10
|
+
folder: ''
|
|
11
|
+
folderUid: ''
|
|
12
|
+
type: file
|
|
13
|
+
disableDeletion: false
|
|
14
|
+
editable: true
|
|
15
|
+
updateIntervalSeconds: 10
|
|
16
|
+
options:
|
|
17
|
+
path: /etc/grafana/provisioning/dashboards
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Grafana Datasource Configuration
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Auto-provision Prometheus as the default datasource
|
|
5
|
+
|
|
6
|
+
apiVersion: 1
|
|
7
|
+
|
|
8
|
+
datasources:
|
|
9
|
+
- name: Prometheus
|
|
10
|
+
type: prometheus
|
|
11
|
+
access: proxy
|
|
12
|
+
url: http://prometheus:9090
|
|
13
|
+
isDefault: true
|
|
14
|
+
editable: false
|
|
15
|
+
jsonData:
|
|
16
|
+
timeInterval: "15s"
|
|
17
|
+
httpMethod: POST
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# Prometheus Configuration for AIPT v2
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Scrape configuration for AIPT metrics
|
|
5
|
+
|
|
6
|
+
global:
|
|
7
|
+
scrape_interval: 15s
|
|
8
|
+
evaluation_interval: 15s
|
|
9
|
+
|
|
10
|
+
# Attach these labels to any time series or alerts
|
|
11
|
+
external_labels:
|
|
12
|
+
monitor: 'aipt-monitor'
|
|
13
|
+
environment: 'production'
|
|
14
|
+
|
|
15
|
+
# Alertmanager configuration (optional)
|
|
16
|
+
# alerting:
|
|
17
|
+
# alertmanagers:
|
|
18
|
+
# - static_configs:
|
|
19
|
+
# - targets:
|
|
20
|
+
# - alertmanager:9093
|
|
21
|
+
|
|
22
|
+
# Rule files (optional)
|
|
23
|
+
# rule_files:
|
|
24
|
+
# - "alerts/*.yml"
|
|
25
|
+
|
|
26
|
+
scrape_configs:
|
|
27
|
+
# Prometheus self-monitoring
|
|
28
|
+
- job_name: 'prometheus'
|
|
29
|
+
static_configs:
|
|
30
|
+
- targets: ['localhost:9090']
|
|
31
|
+
|
|
32
|
+
# AIPT API metrics
|
|
33
|
+
- job_name: 'aipt-api'
|
|
34
|
+
metrics_path: '/metrics'
|
|
35
|
+
static_configs:
|
|
36
|
+
- targets: ['aipt-api:8000']
|
|
37
|
+
relabel_configs:
|
|
38
|
+
- source_labels: [__address__]
|
|
39
|
+
target_label: instance
|
|
40
|
+
replacement: 'aipt-api'
|
|
41
|
+
|
|
42
|
+
# AIPT Worker metrics (if enabled)
|
|
43
|
+
- job_name: 'aipt-worker'
|
|
44
|
+
metrics_path: '/metrics'
|
|
45
|
+
static_configs:
|
|
46
|
+
- targets: ['aipt-worker:8001']
|
|
47
|
+
relabel_configs:
|
|
48
|
+
- source_labels: [__address__]
|
|
49
|
+
target_label: instance
|
|
50
|
+
replacement: 'aipt-worker'
|
|
51
|
+
|
|
52
|
+
# PostgreSQL metrics (if using postgres_exporter)
|
|
53
|
+
# - job_name: 'postgres'
|
|
54
|
+
# static_configs:
|
|
55
|
+
# - targets: ['postgres-exporter:9187']
|
|
56
|
+
|
|
57
|
+
# Redis metrics (if using redis_exporter)
|
|
58
|
+
# - job_name: 'redis'
|
|
59
|
+
# static_configs:
|
|
60
|
+
# - targets: ['redis-exporter:9121']
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIPT Orchestration Module
|
|
3
|
+
|
|
4
|
+
Enhanced pipeline orchestration with:
|
|
5
|
+
- Phase-based workflow management
|
|
6
|
+
- Tool coordination and scheduling
|
|
7
|
+
- Progress tracking and callbacks
|
|
8
|
+
- Result aggregation and reporting
|
|
9
|
+
|
|
10
|
+
The main Orchestrator class is re-exported from the original orchestrator.py
|
|
11
|
+
for backward compatibility.
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
# Import from the original orchestrator (backward compatibility)
|
|
16
|
+
try:
|
|
17
|
+
from aipt_v2.orchestrator import (
|
|
18
|
+
Orchestrator,
|
|
19
|
+
Phase,
|
|
20
|
+
PhaseResult,
|
|
21
|
+
OrchestratorConfig,
|
|
22
|
+
validate_domain,
|
|
23
|
+
validate_ip,
|
|
24
|
+
)
|
|
25
|
+
except ImportError:
|
|
26
|
+
Orchestrator = None
|
|
27
|
+
Phase = None
|
|
28
|
+
PhaseResult = None
|
|
29
|
+
OrchestratorConfig = None
|
|
30
|
+
|
|
31
|
+
# New orchestration components
|
|
32
|
+
from .pipeline import Pipeline, PipelineStage, PipelineResult
|
|
33
|
+
from .scheduler import TaskScheduler, ScheduledTask, TaskPriority
|
|
34
|
+
from .progress import ProgressTracker, ProgressCallback
|
|
35
|
+
|
|
36
|
+
__all__ = [
|
|
37
|
+
# Original orchestrator
|
|
38
|
+
"Orchestrator",
|
|
39
|
+
"Phase",
|
|
40
|
+
"PhaseResult",
|
|
41
|
+
"OrchestratorConfig",
|
|
42
|
+
"validate_domain",
|
|
43
|
+
# New components
|
|
44
|
+
"Pipeline",
|
|
45
|
+
"PipelineStage",
|
|
46
|
+
"PipelineResult",
|
|
47
|
+
"TaskScheduler",
|
|
48
|
+
"ScheduledTask",
|
|
49
|
+
"TaskPriority",
|
|
50
|
+
"ProgressTracker",
|
|
51
|
+
"ProgressCallback",
|
|
52
|
+
]
|