Initial server source import
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
import json
|
||||
import threading
|
||||
|
||||
|
||||
RETIRED_MESSAGE = 'Legacy ScanManager mutation controls are retired; use the authenticated supervisor.'
|
||||
|
||||
|
||||
class ScanManager:
|
||||
"""Read-only compatibility shell for the retired legacy scanner UI."""
|
||||
|
||||
def __init__(self):
|
||||
self.current_scan = None
|
||||
self.scan_thread = None
|
||||
self.results = []
|
||||
self.progress = {
|
||||
'total': 0,
|
||||
'completed': 0,
|
||||
'failed': 0,
|
||||
'secrets_found': 0,
|
||||
'current_target': None,
|
||||
'status': 'retired',
|
||||
}
|
||||
self.scan_lock = threading.Lock()
|
||||
self.scanned_targets = set()
|
||||
self.scan_history = []
|
||||
|
||||
def start_scan(self, scan_type, targets, scan_options):
|
||||
return False, RETIRED_MESSAGE
|
||||
|
||||
def pause_scan(self):
|
||||
return False
|
||||
|
||||
def resume_scan(self):
|
||||
return False
|
||||
|
||||
def stop_scan(self):
|
||||
return False
|
||||
|
||||
def is_scanning(self):
|
||||
return False
|
||||
|
||||
def get_progress(self):
|
||||
with self.scan_lock:
|
||||
return self.progress.copy()
|
||||
|
||||
def get_results(self):
|
||||
with self.scan_lock:
|
||||
return self.results.copy()
|
||||
|
||||
def clear_results(self):
|
||||
return False
|
||||
|
||||
def get_scan_info(self):
|
||||
with self.scan_lock:
|
||||
return self.current_scan.copy() if self.current_scan else None
|
||||
|
||||
def export_results(self, format='json'):
|
||||
with self.scan_lock:
|
||||
if str(format).lower() == 'json':
|
||||
return json.dumps(self.results, indent=2, default=str)
|
||||
return None
|
||||
|
||||
def clear_scan_history(self):
|
||||
return False
|
||||
|
||||
def get_scan_history(self):
|
||||
with self.scan_lock:
|
||||
return self.scan_history.copy()
|
||||
|
||||
def get_scanned_targets_count(self):
|
||||
return len(self.scanned_targets)
|
||||
Reference in New Issue
Block a user