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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user