refactor to remove config_files in favor of db
This commit is contained in:
@@ -46,7 +46,7 @@ Stores metadata about each scan execution.
|
||||
| `timestamp` | DATETIME | Scan start time (UTC) |
|
||||
| `duration` | FLOAT | Total scan duration (seconds) |
|
||||
| `status` | VARCHAR(20) | `running`, `completed`, `failed` |
|
||||
| `config_file` | TEXT | Path to YAML config used |
|
||||
| `config_id` | INTEGER | FK to scan_configs table |
|
||||
| `title` | TEXT | Scan title from config |
|
||||
| `json_path` | TEXT | Path to JSON report |
|
||||
| `html_path` | TEXT | Path to HTML report |
|
||||
@@ -144,7 +144,7 @@ Scheduled scan configurations.
|
||||
|--------|------|-------------|
|
||||
| `id` | INTEGER PRIMARY KEY | Unique schedule ID |
|
||||
| `name` | VARCHAR(255) | Schedule name (e.g., "Daily prod scan") |
|
||||
| `config_file` | TEXT | Path to YAML config |
|
||||
| `config_id` | INTEGER | FK to scan_configs table |
|
||||
| `cron_expression` | VARCHAR(100) | Cron-like schedule (e.g., `0 2 * * *`) |
|
||||
| `enabled` | BOOLEAN | Is schedule active? |
|
||||
| `last_run` | DATETIME | Last execution time |
|
||||
@@ -214,7 +214,7 @@ All API endpoints return JSON and follow RESTful conventions.
|
||||
|--------|----------|-------------|--------------|----------|
|
||||
| `GET` | `/api/scans` | List all scans (paginated) | - | `{ "scans": [...], "total": N, "page": 1 }` |
|
||||
| `GET` | `/api/scans/{id}` | Get scan details | - | `{ "scan": {...} }` |
|
||||
| `POST` | `/api/scans` | Trigger new scan | `{ "config_file": "path" }` | `{ "scan_id": N, "status": "running" }` |
|
||||
| `POST` | `/api/scans` | Trigger new scan | `{ "config_id": "path" }` | `{ "scan_id": N, "status": "running" }` |
|
||||
| `DELETE` | `/api/scans/{id}` | Delete scan and files | - | `{ "status": "deleted" }` |
|
||||
| `GET` | `/api/scans/{id}/status` | Get scan status | - | `{ "status": "running", "progress": "45%" }` |
|
||||
| `GET` | `/api/scans/{id1}/compare/{id2}` | Compare two scans | - | `{ "diff": {...} }` |
|
||||
@@ -225,7 +225,7 @@ All API endpoints return JSON and follow RESTful conventions.
|
||||
|--------|----------|-------------|--------------|----------|
|
||||
| `GET` | `/api/schedules` | List all schedules | - | `{ "schedules": [...] }` |
|
||||
| `GET` | `/api/schedules/{id}` | Get schedule details | - | `{ "schedule": {...} }` |
|
||||
| `POST` | `/api/schedules` | Create new schedule | `{ "name": "...", "config_file": "...", "cron_expression": "..." }` | `{ "schedule_id": N }` |
|
||||
| `POST` | `/api/schedules` | Create new schedule | `{ "name": "...", "config_id": "...", "cron_expression": "..." }` | `{ "schedule_id": N }` |
|
||||
| `PUT` | `/api/schedules/{id}` | Update schedule | `{ "enabled": true, "cron_expression": "..." }` | `{ "status": "updated" }` |
|
||||
| `DELETE` | `/api/schedules/{id}` | Delete schedule | - | `{ "status": "deleted" }` |
|
||||
| `POST` | `/api/schedules/{id}/trigger` | Manually trigger scheduled scan | - | `{ "scan_id": N }` |
|
||||
@@ -438,7 +438,7 @@ alert_rules:
|
||||
"scan_id": 123,
|
||||
"title": "Production Network Scan",
|
||||
"timestamp": "2025-11-17T14:15:00Z",
|
||||
"config_file": "prod_config.yaml",
|
||||
"config_id": "prod_config.yaml",
|
||||
"triggered_by": "scheduled"
|
||||
},
|
||||
"alert_details": {
|
||||
|
||||
Reference in New Issue
Block a user