mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +00:00
Fix last details. (#7625)
This commit is contained in:
parent
217df4b012
commit
b51954f850
15 changed files with 403 additions and 368 deletions
28
scripts/lua/rest/v2/get/host/vulnerability_scan_result.lua
Normal file
28
scripts/lua/rest/v2/get/host/vulnerability_scan_result.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
--
|
||||
-- (C) 2013-23 - ntop.org
|
||||
--
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/host/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
local rest_utils = require "rest_utils"
|
||||
local vulnerability_scan_utils = require "vulnerability_scan_utils"
|
||||
|
||||
|
||||
local function retrieve_host_scan_result(host, scan_type)
|
||||
return vulnerability_scan_utils.retrieve_hosts_scan_result(host, scan_type)
|
||||
end
|
||||
|
||||
local host = _GET["host"]
|
||||
local scan_type = _GET["scan_type"]
|
||||
|
||||
if isEmptyString(host) or isEmptyString(scan_type) then
|
||||
rest_utils.answer(rest_utils.consts.err.invalid_args)
|
||||
end
|
||||
|
||||
local result = retrieve_host_scan_result(host, scan_type)
|
||||
|
||||
local extra_headers = {}
|
||||
extra_headers["Content-Disposition"] = "attachment;filename=\"scan_result_export_"..os.time()..".txt\""
|
||||
rest_utils.vanilla_payload_response(rest_utils.consts.success.ok, result, "application/octet-stream", extra_headers)
|
||||
Loading…
Add table
Add a link
Reference in a new issue