Add TCP port scan persistence and API endpoint.

Probe configured ports for alive hosts, persist port states, and expose scan port results via REST.

Made-with: Cursor
This commit is contained in:
Andrey Lutsenko
2026-04-09 21:54:17 +10:00
parent 9afbbbb762
commit e9452dcc0a
6 changed files with 159 additions and 1 deletions
+12
View File
@@ -28,3 +28,15 @@ create table if not exists scan_hosts (
create index if not exists idx_scan_hosts_scan_id_checked_at
on scan_hosts (scan_id, checked_at desc);
create table if not exists scan_ports (
id bigserial primary key,
scan_id text not null references scan_jobs(id) on delete cascade,
ip inet not null,
port int not null,
is_open boolean not null,
checked_at timestamptz not null
);
create index if not exists idx_scan_ports_scan_id_checked_at
on scan_ports (scan_id, checked_at desc);