Repository navigation
Expand file tree
/
Copy pathconfig_loader.pyi
More file actions
262 lines (209 loc) · 5.82 KB
/
Copy pathconfig_loader.pyi
File metadata and controls
262 lines (209 loc) · 5.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Any
@dataclass
class EngineConfig:
"""Engine-wide settings."""
name: str
version: str
fail_on_severity: str
max_findings: int
@dataclass
class HeuristicConfig:
"""Heuristic scanning configuration."""
enabled: bool
severity_overrides: Dict[str, str]
disabled_rules: Dict[str, bool]
def is_rule_enabled(self, rule_id: str) -> bool: ...
def get_rule_severity(self, rule_id: str, default_severity: str) -> str: ...
@dataclass
class Suppression:
"""Represents a single suppression rule."""
rule_id: str
file: Optional[str]
line: Optional[int]
reason: str
expires: Optional[str]
def matches(self, rule_id: str, file_path: str, line_no: int) -> bool: ...
def _file_matches(self, suppression_file: str, target_file: str) -> bool: ...
@dataclass
class StaticAnalysisConfig:
"""Static analyzer settings."""
slither_enabled: bool
slither_exclude_detectors: str
slither_include_impact: str
aderyn_enabled: bool
aderyn_scope: str
@dataclass
class FuzzingConfig:
"""Fuzzing configuration."""
foundry_enabled: bool
foundry_runs: int
foundry_max_test_rejects: int
medusa_enabled: bool
medusa_test_limit: int
medusa_timeout: int
medusa_workers: int
@dataclass
class SolanaIDLConfig:
"""Solana IDL validation settings."""
idl_path: str
validate_constraints: bool
trace_cpi: bool
@dataclass
class ChainConfig:
"""Chain-specific settings."""
solana_enabled: bool
solana_project_root: str
solana_idl: SolanaIDLConfig
evm_solc_version: str
evm_trusted_contracts: List[str]
@dataclass
class UpgradeDiffConfig:
"""Upgrade safety settings."""
old_implementation_path: str
new_implementation_path: str
ignore_new_view_functions: bool
ignore_comment_changes: bool
@dataclass
class ReportingConfig:
"""Reporting settings."""
format: str
executive_summary: bool
supply_chain: bool
static_analysis: bool
heuristic_scan: bool
fuzzing: bool
threat_intel: bool
access_matrix: bool
verbosity: str
group_by: str
@dataclass
class CIGeneratorConfig:
"""CI/CD pipeline generator settings."""
platform: str
triggers: List[str]
notifications: List[str]
custom_steps: List[str]
@dataclass
class CIConfig:
"""CI/CD integration settings."""
fail_on_findings: bool
post_pr_comment: bool
upload_sarif: bool
exclude_paths: List[str]
generator: Optional[CIGeneratorConfig]
@dataclass
class RedTeamConfig:
"""Red team scan configuration."""
severity_allowlist: List[str]
ignore_checks: List[str]
@dataclass
class ExternalToolsConfig:
"""External tool timeouts and settings."""
aderyn_timeout: int
mythril_timeout: int
foundry_fuzz_runs: int
@dataclass
class SupplyChainConfig:
"""Supply chain security configuration."""
ecosystem: str
osv_timeout: int
osv_max_retries: int
osv_rate_limit: int
@dataclass
class ThreatIntelConfig:
"""Threat intelligence configuration."""
c4_timeout: int
immunefi_timeout: int
solana_github_timeout: int
api_rate_limit: int
offline_mode: bool
@dataclass
class HttpConfig:
"""HTTP client configuration."""
default_timeout: int
max_retries: int
base_delay: float
max_delay: float
backoff_factor: float
@dataclass
class ExploitGenerationConfig:
"""Exploit PoC auto-generation configuration."""
auto_generate: bool
min_severity: str
validate_compilation: bool
output_dir: str
llm_backend: str
template_dir: str
@dataclass
class FingerprintConfig:
"""Protocol fingerprint scanner configuration."""
enabled: bool
min_similarity: float
database_path: str
include_risk_assessment: bool
@dataclass
class VisualizationConfig:
"""Attack graph visualization configuration."""
enabled: bool
include_source_analysis: bool
trace_attack_paths: bool
output_format: str
max_path_depth: int
@dataclass
class HistoryConfig:
"""History scanning configuration."""
max_commits: int
scan_branches: List[str]
include_fixed: bool
output_dir: str
@dataclass
class AIConfig:
"""AI and RAG configuration."""
embedding_backend: str
llm_backend: str
llm_model: str
ollama_url: str
openai_model: str
rag_index_path: str
top_k: int
auto_enrich: bool
llm_enrichment: bool
@dataclass
class PluginsConfig:
"""Plugin system configuration."""
enabled: bool
dirs: List[str]
@dataclass
class GarrisonConfig:
"""Root configuration object."""
engine: EngineConfig = ...
heuristics: HeuristicConfig = ...
suppressions: List[Suppression] = ...
static_analysis: StaticAnalysisConfig = ...
fuzzing: FuzzingConfig = ...
chains: ChainConfig = ...
upgrade_diff: UpgradeDiffConfig = ...
reporting: ReportingConfig = ...
ci: CIConfig = ...
red_team: RedTeamConfig = ...
external_tools: ExternalToolsConfig = ...
supply_chain: SupplyChainConfig = ...
threat_intel: ThreatIntelConfig = ...
http: HttpConfig = ...
exploit_generation: ExploitGenerationConfig = ...
history: HistoryConfig = ...
visualization: VisualizationConfig = ...
fingerprint: FingerprintConfig = ...
ai: AIConfig = ...
plugins: PluginsConfig = ...
def is_finding_suppressed(
self, rule_id: str, file_path: str, line_no: int
) -> Optional[Suppression]: ...
def load_config(config_path: Optional[str] = None) -> GarrisonConfig: ...
def find_config_file() -> Optional[str]: ...
def validate_config(config: dict) -> list[str]: ...
def print_config_summary(config: GarrisonConfig) -> None: ...
# Alias for backward compatibility after rebrand
CounterscarpConfig = GarrisonConfig