Major architectural changes: - Replace YAML config files with database-stored ScanConfig model - Remove CIDR block support in favor of individual IP addresses per site - Each IP now has its own expected_ping, expected_tcp_ports, expected_udp_ports - AlertRule now uses config_id FK instead of config_file string API changes: - POST /api/scans now requires config_id instead of config_file - Alert rules API uses config_id with validation - All config dropdowns fetch from /api/configs dynamically Template updates: - scans.html, dashboard.html, alert_rules.html load configs via API - Display format: Config Title (X sites) in dropdowns - Removed Jinja2 config_files loops Migrations: - 008: Expand CIDRs to individual IPs with per-IP port configs - 009: Remove CIDR-related columns - 010: Add config_id to alert_rules, remove config_file
74 lines
1.8 KiB
Bash
Executable File
74 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
# SneakyScan Fresh Start Script
|
||
# This script removes all data, configs, and scan output for a clean slate
|
||
|
||
set -e
|
||
|
||
# Check for root/sudo access
|
||
if [ "$EUID" -ne 0 ]; then
|
||
echo "============================================"
|
||
echo " ERROR: Root access required"
|
||
echo "============================================"
|
||
echo ""
|
||
echo "This script needs to run with sudo because"
|
||
echo "Docker creates files with root ownership."
|
||
echo ""
|
||
echo "Please run:"
|
||
echo " sudo ./destroy_everything.sh"
|
||
echo ""
|
||
exit 1
|
||
fi
|
||
|
||
echo "============================================"
|
||
echo " SneakyScan Fresh Start - DESTROY EVERYTHING"
|
||
echo "============================================"
|
||
echo ""
|
||
echo "This will remove:"
|
||
echo " - All database files in ./data/"
|
||
echo " - All config files in ./configs/"
|
||
echo " - All scan outputs in ./output/"
|
||
echo ""
|
||
read -p "Are you sure you want to continue? (yes/no): " -r
|
||
echo ""
|
||
|
||
if [[ ! $REPLY =~ ^[Yy][Ee][Ss]$ ]]; then
|
||
echo "Aborted."
|
||
exit 0
|
||
fi
|
||
|
||
echo "Starting cleanup..."
|
||
echo ""
|
||
|
||
# Clean data directory (database files)
|
||
if [ -d "data" ]; then
|
||
echo "Cleaning data directory..."
|
||
rm -rfv data/*
|
||
echo " Data directory cleaned"
|
||
else
|
||
echo " <20> Data directory not found"
|
||
fi
|
||
|
||
# Clean configs directory
|
||
if [ -d "configs" ]; then
|
||
echo "Cleaning configs directory..."
|
||
rm -rfv configs/*
|
||
echo " Configs directory cleaned"
|
||
else
|
||
echo " <20> Configs directory not found"
|
||
fi
|
||
|
||
# Clean output directory (scan results)
|
||
if [ -d "output" ]; then
|
||
echo "Cleaning output directory..."
|
||
rm -rfv output/*
|
||
echo " Output directory cleaned"
|
||
else
|
||
echo " <20> Output directory not found"
|
||
fi
|
||
|
||
echo ""
|
||
echo "============================================"
|
||
echo " Fresh start complete! All data removed."
|
||
echo "============================================"
|