Test plans and runs
test_plans
One check with its options (parameters, minimum intervals, managed flag of automatic plans), enabled flag and a version that changes with every edit.
11 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
tenant_id | bigint(20) unsigned | tenants on delete cascade | ||
name | varchar(255) | |||
description | text | yes | ||
enabled | tinyint(1) | 1 | ||
checks | longtext | |||
options | longtext | yes | ||
version | int(10) unsigned | 1 | ||
alerted_at | timestamp | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
Indexes: tenant_id
test_plan_items
What a plan runs on: a target, a host or a group.
5 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
test_plan_id | bigint(20) unsigned | test_plans on delete cascade | ||
target_id | bigint(20) unsigned | yes | targets on delete cascade | |
group_id | bigint(20) unsigned | yes | groups on delete cascade | |
host_id | bigint(20) unsigned | yes | hosts on delete cascade |
Indexes: group_id · host_id · target_id · test_plan_id
schedules
When a plan runs: interval (minutes, anchor, optional weekdays and time window), daily at a time on weekdays, or once at a moment. With timezone.
14 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
test_plan_id | bigint(20) unsigned | test_plans on delete cascade | ||
type | varchar(16) | |||
interval_minutes | int(10) unsigned | yes | ||
time_of_day | varchar(5) | yes | ||
weekdays | longtext | yes | ||
window_start | varchar(5) | yes | ||
window_end | varchar(5) | yes | ||
run_at | timestamp | yes | ||
timezone | varchar(255) | UTC | ||
anchor_at | timestamp | yes | ||
enabled | tinyint(1) | 1 | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
Indexes: test_plan_id
scan_runs
One execution of a plan on one satellite (scheduled) or one immediate job (oneshot): status, checks, targets, summary, error, timings.
21 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
uuid unique | uuid | |||
tenant_id | bigint(20) unsigned | tenants on delete cascade | ||
test_plan_id | bigint(20) unsigned | yes | test_plans on delete set null | |
schedule_id | bigint(20) unsigned | yes | schedules on delete set null | |
satellite_id | bigint(20) unsigned | satellites on delete cascade | ||
kind | varchar(16) | |||
run_key unique | varchar(255) | yes | ||
status | varchar(16) | queued | ||
checks | longtext | yes | ||
targets | longtext | yes | ||
options | longtext | yes | ||
summary | longtext | yes | ||
error | text | yes | ||
requested_by | bigint(20) unsigned | yes | users on delete set null | |
scheduled_for | timestamp | yes | ||
dispatched_at | timestamp | yes | ||
started_at | timestamp | yes | ||
finished_at | timestamp | yes | ||
created_at | timestamp | yes | ||
updated_at | timestamp | yes |
Indexes: requested_by · run_key (unique) · satellite_id · schedule_id · tenant_id, created_at · test_plan_id, satellite_id, finished_at · uuid (unique)
scan_run_items
Live progress of a run: one row per target and task, so the run page shows what is done.
10 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
scan_run_id | bigint(20) unsigned | scan_runs on delete cascade | ||
item_key | varchar(191) | |||
target | varchar(255) | |||
task | varchar(64) | |||
status | varchar(16) | |||
detail | varchar(500) | yes | ||
started_at | timestamp | yes | ||
finished_at | timestamp | yes | ||
updated_at | timestamp | yes |
Indexes: scan_run_id, item_key (unique)
scan_run_steps
Commands a satellite ran in debug mode, with exit code and output (up to 64 KiB each).
9 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
scan_run_id | bigint(20) unsigned | scan_runs on delete cascade | ||
uid | varchar(16) | |||
command | text | |||
exit_code | int(11) | yes | ||
duration_ms | int(10) unsigned | yes | ||
stdout | longtext | yes | ||
stderr | longtext | yes | ||
created_at | timestamp | current_timestamp() |
Indexes: scan_run_id, uid (unique)
scan_results
Validated result of one check on one target in a run: status, structured data and optional raw output (nmap XML, …). Pruned with their run after POLARIS_RETENTION_RESULTS days.
12 columns
| Column | Type | Null | Default | References |
|---|---|---|---|---|
id PK | bigint(20) unsigned | |||
scan_run_id | bigint(20) unsigned | scan_runs on delete cascade | ||
uid | varchar(16) | yes | ||
satellite_id | bigint(20) unsigned | satellites on delete cascade | ||
host_id | bigint(20) unsigned | yes | hosts on delete set null | |
target | varchar(255) | |||
check_type | varchar(16) | |||
status | varchar(16) | |||
duration_ms | int(10) unsigned | yes | ||
data | longtext | yes | ||
raw | longtext | yes | ||
created_at | timestamp | current_timestamp() |
Indexes: host_id, check_type, created_at · satellite_id · scan_run_id, uid