Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions http_src/services/context/ntopng_globals_services.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,6 @@ export const ntopng_utility = function () {
}
}
},
get_cve_details_url(cve_id, scan_type) {
// IMPORTANT: The retrieved value must match the value in
// scripts/lua/modules/vulnerability_scan/cve_utils.lua for the 'cve_utils.getDocURL' function.
if (scan_type == "cve") {
return `https://nvd.nist.gov/vuln/detail/${cve_id}`;
} else if (scan_type == "openvas") {
return `https://vulners.com/openvas/OPENVAS:${cve_id}`;
}
},
set_http_globals_headers(headers) {
global_http_headers = headers;
},
Expand Down
4 changes: 0 additions & 4 deletions http_src/vue/app-shell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1141,10 +1141,6 @@ function buildNetworkLoad(r) {
msg += `<a href='${pfxVal}/lua/if_stats.lua?ifid=${ifidVal}&page=traffic_recording&tab=jobs'>
<span class="badge ${cls}" ${tooltip(_i18n("traffic_recording.traffic_extraction_jobs"))}>${r.traffic_extraction_num_tasks || 0} <i class="fas fa-tasks fa-lg"></i></span></a>`;
}
if (r.vs_in_progress > 0) {
msg += `<a href='${pfxVal}/lua/vulnerability_scan.lua'>
<span class="badge bg-primary" ${tooltip(_i18n("vulnerability_scan.vulnerability_scan_in_progress"))}>${window.NtopUtils ? NtopUtils.addCommas(r.vs_in_progress) : r.vs_in_progress} <i class="fas fa-satellite-dish"></i></span></a>`;
}
}
if (r.is_loading === true) {
Expand Down
42 changes: 0 additions & 42 deletions http_src/vue/dashboard-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { ntopng_custom_events, ntopng_events_manager } from "../services/context
import formatterUtils from "../utilities/formatter-utils";
import NtopUtils from "../utilities/ntop-utils";
import Loading from "./loading.vue";
import { scan_type_f, last_scan_f, duration_f, scan_frequency_f, is_ok_last_scan_f, tcp_ports_f, tcp_port_f, hosts_f, host_f, cves_f, max_score_cve_f, udp_ports_f, num_vuln_found_f, tcp_udp_ports_list_f, discoverd_hosts_list_f } from "../utilities/vs_report_formatter.js";

const _i18n = (t) => i18n(t);

Expand Down Expand Up @@ -179,42 +178,6 @@ const row_render_functions = {
}
},

vs_scan_result: function (column, row) {
if (column.id == "host") {
return host_f(row[column.id], row, props.ifid);
} else if (column.id == "last_scan") {
return last_scan_f(row[column.id], row);
} else if (column.id == "duration") {
return duration_f(row[column.id], row);
} else if (column.id == "scan_frequency") {
return scan_frequency_f(row[column.id]);
} else if (column.id == "is_ok_last_scan") {
return is_ok_last_scan_f(row[column.id]);
} else if (column.id == "tcp_ports") {
return tcp_ports_f(row[column.id], row);
} else if (column.id == "udp_ports") {
return udp_ports_f(row[column.id], row);
} else if (column.id == "scan_type") {
return scan_type_f(row[column.id], true, row);
} else if (column.id == "hosts") {
return hosts_f(row[column.id], row);
} else if (column.id == "cve" || column.id == "cve_list") {
return cves_f(row[column.id], row);
} else if (column.id == "port") {
return tcp_port_f(row[column.id], row);
} else if (column.id == "max_score_cve") {
return max_score_cve_f(row[column.id], row);
} else if (column.id == "num_vulnerabilities_found") {
return num_vuln_found_f(row[column.id], row);
} else if (column.id == "tcp_udp_ports_list") {
return tcp_udp_ports_list_f(row["tcp_ports_list"], row["udp_ports_list"], row);
} else if (column.id == "discovered_hosts") {
return discoverd_hosts_list_f(row[column.id]);
} else {
return row[column.id];
}
},

/* Render function for 'alert_count' table type */
alert_count: function (column, row) {
if (column.id == 'name') {
Expand Down Expand Up @@ -292,11 +255,6 @@ async function refresh_table() {
rows = data; /* default: data is the array of records */
}

if (props.params.table_type != 'vs_scan_result') {
const max_rows = props.max_height ? ((props.max_height / 4) * 6) : 6;
rows = rows.slice(0, max_rows);
}

table_rows.value = rows;
isLoading.value = false // Always false
}
Expand Down
10 changes: 0 additions & 10 deletions http_src/vue/ntop_vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ import { default as PageServerPorts } from "./page-server-ports.vue";
import { default as NedgeRepeatersConfig } from "./page-nedge-repeaters-config.vue";
import { default as PageExportersConfig } from "./page-flowdevice-config.vue";
import { default as PageFlowDeviceInterfaceDetails } from "./page-flowdevice-interface-config.vue";
import { default as PageVulnerabilityScan } from "./page-vulnerability-scan.vue";
import { default as PageHostVsResult } from "./page-host-vs-result.vue";
import { default as PageOpenPorts } from "./page-open-ports.vue";
import { default as PageVulnerabilityScanReport } from "./page-vulnerability-scan-report.vue"
import { default as PageSNMPUsage } from "./page-snmp-usage.vue"
import { default as PageHostsList } from "./page-hosts-list.vue"
import { default as PageFlowsList } from "./page-flows-list.vue"
Expand Down Expand Up @@ -178,7 +174,6 @@ import { default as ModalSnapshot } from "./modal-snapshot.vue";
import { default as ModalAddHostRules } from "./modal-add-traffic-rules.vue";
import { default as ModalAddApplication } from "./modal-add-application.vue";
import { default as ModalDeleteApplication } from "./modal-delete-application.vue";
import { default as ModalEditReport } from "./modal-edit-vs-report.vue";
import { default as ModalAddSNMPDevice } from "./modal-add-snmp-device.vue";
import { default as ModalDeleteSNMPDevice } from "./modal-delete-snmp-device.vue";
import { default as ModalImportSNMPDevices } from "./modal-import-snmp-devices.vue";
Expand Down Expand Up @@ -239,10 +234,6 @@ let ntopVue = {
PageManageConfigurations: PageManageConfigurations,
PageSNMPDeviceRules: PageSNMPDeviceRules,
PageServerPorts: PageServerPorts,
PageVulnerabilityScan: PageVulnerabilityScan,
PageHostVsResult: PageHostVsResult,
PageOpenPorts: PageOpenPorts,
PageVulnerabilityScanReport: PageVulnerabilityScanReport,
PageFlowsList: PageFlowsList,
PageMacsList: PageMacsList,
PageInterfaceICMP: PageInterfaceICMP,
Expand Down Expand Up @@ -399,7 +390,6 @@ let ntopVue = {
ModalAddHostRules: ModalAddHostRules,
ModalAddApplication: ModalAddApplication,
ModalDeleteApplication: ModalDeleteApplication,
ModalEditReport: ModalEditReport,
ModalAddSNMPDevice: ModalAddSNMPDevice,
ModalDeleteSNMPDevice: ModalDeleteSNMPDevice,
ModalImportSNMPDevices: ModalImportSNMPDevices,
Expand Down
52 changes: 0 additions & 52 deletions httpdocs/misc/db_schema_clickhouse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1852,58 +1852,6 @@ ALTER TABLE `hourly_flows` MODIFY COLUMN `DST2SRC_PACKETS` COMMENT 'Packet count

@

/* VS */

CREATE TABLE IF NOT EXISTS `vulnerability_scan_data` (
`HOST` String,
`SCAN_TYPE` String,
`LAST_SCAN` DateTime,
`JSON_INFO` String,
`VS_RESULT_FILE` String
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(LAST_SCAN) ORDER BY (LAST_SCAN, HOST, SCAN_TYPE);
@
ALTER TABLE `vulnerability_scan_data` MODIFY COMMENT 'Per-host vulnerability scan results produced by the ntopng Vulnerability Scanner (VS) module. Each row stores the latest scan output for a given host and scan type as a JSON blob.';
@
ALTER TABLE `vulnerability_scan_data` MODIFY COLUMN `HOST` COMMENT 'IP address or hostname of the scanned target';
@
ALTER TABLE `vulnerability_scan_data` MODIFY COLUMN `SCAN_TYPE` COMMENT 'Type of vulnerability scan performed (e.g. nmap, openvas)';
@
ALTER TABLE `vulnerability_scan_data` MODIFY COLUMN `LAST_SCAN` COMMENT 'Timestamp of when this scan was last performed';
@
ALTER TABLE `vulnerability_scan_data` MODIFY COLUMN `JSON_INFO` COMMENT 'Full scan results as a JSON blob';
@
ALTER TABLE `vulnerability_scan_data` MODIFY COLUMN `VS_RESULT_FILE` COMMENT 'Path to the raw scan result file on disk';

@

CREATE TABLE IF NOT EXISTS `vulnerability_scan_report` (
`REPORT_NAME` String,
`REPORT_DATE` DateTime,
`REPORT_JSON_INFO` String,
`NUM_SCANNED_HOSTS` UInt32,
`NUM_CVES` UInt32,
`NUM_TCP_PORTS` UInt32,
`NUM_UDP_PORTS` UInt32
) ENGINE = MergeTree() PARTITION BY toYYYYMMDD(REPORT_DATE) ORDER BY (REPORT_DATE);
@
ALTER TABLE `vulnerability_scan_report` MODIFY COMMENT 'Summary reports of completed vulnerability scans. Each row represents one scan report with aggregate counts of scanned hosts, CVEs found, and open TCP/UDP ports.';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `REPORT_NAME` COMMENT 'User-defined name for this vulnerability scan report';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `REPORT_DATE` COMMENT 'Timestamp when the report was generated';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `REPORT_JSON_INFO` COMMENT 'Full report metadata and summary as a JSON blob';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `NUM_SCANNED_HOSTS` COMMENT 'Number of hosts scanned in this report';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `NUM_CVES` COMMENT 'Total number of CVEs identified across all scanned hosts';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `NUM_TCP_PORTS` COMMENT 'Total number of open TCP ports found across all scanned hosts';
@
ALTER TABLE `vulnerability_scan_report` MODIFY COLUMN `NUM_UDP_PORTS` COMMENT 'Total number of open UDP ports found across all scanned hosts';

@

CREATE TABLE IF NOT EXISTS `mitre_table_info` (
`ALERT_ID` UInt16,
`ENTITY_ID` UInt16,
Expand Down
52 changes: 0 additions & 52 deletions httpdocs/misc/db_schema_clickhouse_cluster.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1858,58 +1858,6 @@ ALTER TABLE `hourly_flows` ON CLUSTER '$CLUSTER' MODIFY COLUMN `DST2SRC_PACKETS`

@

/* VS */

CREATE TABLE IF NOT EXISTS `vulnerability_scan_data` ON CLUSTER '$CLUSTER' (
`HOST` String,
`SCAN_TYPE` String,
`LAST_SCAN` DateTime,
`JSON_INFO` String,
`VS_RESULT_FILE` String
) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{database}/{table}', '{replica}') PARTITION BY toYYYYMMDD(LAST_SCAN) ORDER BY (LAST_SCAN, HOST, SCAN_TYPE);
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COMMENT 'Per-host vulnerability scan results produced by the ntopng Vulnerability Scanner (VS) module. Each row stores the latest scan output for a given host and scan type as a JSON blob.';
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COLUMN `HOST` COMMENT 'IP address or hostname of the scanned target';
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COLUMN `SCAN_TYPE` COMMENT 'Type of vulnerability scan performed (e.g. nmap, openvas)';
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COLUMN `LAST_SCAN` COMMENT 'Timestamp of when this scan was last performed';
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COLUMN `JSON_INFO` COMMENT 'Full scan results as a JSON blob';
@
ALTER TABLE `vulnerability_scan_data` ON CLUSTER '$CLUSTER' MODIFY COLUMN `VS_RESULT_FILE` COMMENT 'Path to the raw scan result file on disk';

@

CREATE TABLE IF NOT EXISTS `vulnerability_scan_report` ON CLUSTER '$CLUSTER' (
`REPORT_NAME` String,
`REPORT_DATE` DateTime,
`REPORT_JSON_INFO` String,
`NUM_SCANNED_HOSTS` UInt32,
`NUM_CVES` UInt32,
`NUM_TCP_PORTS` UInt32,
`NUM_UDP_PORTS` UInt32
) ENGINE = ReplicatedMergeTree('/clickhouse/{cluster}/tables/{database}/{table}', '{replica}') PARTITION BY toYYYYMMDD(REPORT_DATE) ORDER BY (REPORT_DATE);
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COMMENT 'Summary reports of completed vulnerability scans. Each row represents one scan report with aggregate counts of scanned hosts, CVEs found, and open TCP/UDP ports.';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `REPORT_NAME` COMMENT 'User-defined name for this vulnerability scan report';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `REPORT_DATE` COMMENT 'Timestamp when the report was generated';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `REPORT_JSON_INFO` COMMENT 'Full report metadata and summary as a JSON blob';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `NUM_SCANNED_HOSTS` COMMENT 'Number of hosts scanned in this report';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `NUM_CVES` COMMENT 'Total number of CVEs identified across all scanned hosts';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `NUM_TCP_PORTS` COMMENT 'Total number of open TCP ports found across all scanned hosts';
@
ALTER TABLE `vulnerability_scan_report` ON CLUSTER '$CLUSTER' MODIFY COLUMN `NUM_UDP_PORTS` COMMENT 'Total number of open UDP ports found across all scanned hosts';

@

/* MITRE */

CREATE TABLE IF NOT EXISTS `mitre_table_info` ON CLUSTER '$CLUSTER' (
Expand Down
6 changes: 0 additions & 6 deletions httpdocs/misc/menu_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@
"i18n": "prefs.snmp",
"icon": "fas fa-network-wired",
"url": "/lua/pro/enterprise/snmpdevices_stats.lua"
},
{
"key": "vulnerability_scan",
"i18n": "scan_hosts",
"icon": "fas fa-shield-alt",
"url": "/lua/vulnerability_scan.lua"
}
]
},
Expand Down
8 changes: 0 additions & 8 deletions scripts/callbacks/system/startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" ..
package.path
package.path = dirs.installdir ..
"/scripts/lua/modules/vulnerability_scan/?.lua;" ..
package.path

-- Important: load this before any other alert related module
require "prefs_utils"
Expand All @@ -31,7 +28,6 @@ local delete_data_utils = require "delete_data_utils"
local ts_utils = require "ts_utils"
local presets_utils = require "presets_utils"
local blog_utils = require("blog_utils")
local vs_utils = require "vs_utils"
local drop_host_pool_utils = require "drop_host_pool_utils"
local json = require "dkjson"
local cache_utils = require "cache_utils"
Expand Down Expand Up @@ -365,10 +361,6 @@ if (ntop.exists(influxdb_dir)) then
end
end

-- Vulnerability scan activities
vs_utils.migrate_keys()
vs_utils.restore_host_to_scan()

-- migrate unexpected dns/ntp/dhcp/smtp scripts to /lua/admin/network_configuration.lua
migrate_unexpected_proto_config()

Expand Down
35 changes: 0 additions & 35 deletions scripts/lua/admin/prefs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2666,37 +2666,6 @@ if auth.has_capability(auth.capabilities.preferences) then
</table>]]
end

function printVulnerabilityScan()
print('<form method="post">')
print('<table class="table">')

print('<thead class="table-primary"><tr><th colspan=2 class="info">' ..
i18n("hosts_stats.page_scan_hosts.prefs_tab_title") .. '</th></tr></thead>')

prefsInputFieldPrefs(subpage_active.entries["vs_concurrently_scan_number"].title,
subpage_active.entries["vs_concurrently_scan_number"].description, "ntopng.prefs.",
"host_to_scan_max_num_scans", prefs.host_to_scan_max_num_scans or 4, "number", true, false, nil, {
min = 1,
max = 16
})
local default_vs_slow_scan_value = ternary(prefs.vs_slow_scan == false, "0", "1")
prefsToggleButton(subpage_active, {
field = "toggle_slow_mode",
default = default_vs_slow_scan_value,
pref = "vs.vs_slow_scan"
})

print(
'<tr><th colspan=2 style="text-align:right;"><button type="submit" class="btn btn-primary" style="width:115px" disabled="disabled">' ..
i18n("save") .. '</button></th></tr>')

print [[<input name="csrf" type="hidden" value="]]
print(ntop.getRandomCSRFValue())
print [[" />
</form>
</table>]]
end

function printDumpSettings()
print('<form method="post">')
print('<table class="table">')
Expand Down Expand Up @@ -3205,10 +3174,6 @@ if auth.has_capability(auth.capabilities.preferences) then
printReportsOptions()
end

if (tab == "vulnerability_scan") then
printVulnerabilityScan()
end

print [[
</td></tr>
</table>
Expand Down
7 changes: 0 additions & 7 deletions scripts/lua/experiments/stats_to_mbroker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/vulnerability_scan/?.lua;" .. package.path

-- ############################################

Expand All @@ -18,7 +17,6 @@ local periodic_activities_utils = require "periodic_activities_utils"
local callback_utils = require("callback_utils")
local recording_utils = require("recording_utils")
local auth = require "auth"
local vs_utils = require "vs_utils"
local json = require("dkjson")

-- ############################################
Expand Down Expand Up @@ -80,11 +78,6 @@ local function format_info(ifstats)

res["throughput_bps"] = ifstats.stats.throughput_bps;

if (vs_utils.is_available()) then
local total, total_in_progress = vs_utils.check_in_progress_status()
res["vs_in_progress"] = total_in_progress or 0
end

if prefs.is_dump_flows_enabled then
res["flow_export_drops"] = ifstats.stats_since_reset.db.flow_export_drops
res["flow_export_count"] = ifstats.stats_since_reset.db.flow_export_count
Expand Down
Loading
Loading