Skip to content

Commit

Permalink
Change: openvasd: stream responses, information=true
Browse files Browse the repository at this point in the history
Instead of collecting various sources before combining and changing them
this will get the source, return an iterator so that the using calls can
decide if they want to combine various iterator before map them into the
target struct.

This does reduce the memory footprint when gathering nvt data from e.g.
redis.

Additionally openvasd imports the whole feed instead of just nvts.

To get meta information call:
```
curl localhost:3000/vts?information=true
```
  • Loading branch information
nichtsfrei committed Feb 8, 2024
1 parent 9d1e74d commit f6396e9
Show file tree
Hide file tree
Showing 151 changed files with 3,309 additions and 689 deletions.
36 changes: 36 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions rust/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This contains a rudimentary feed for testing purposes.

This is not a real feed.
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/1.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.1");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/10.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.10");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/100.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.100");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/11.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.11");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/12.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.12");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/13.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.13");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/14.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.14");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/15.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.15");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/16.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.16");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/17.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.17");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/18.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.18");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/19.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.19");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/2.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.2");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/20.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.20");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/21.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.21");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
19 changes: 19 additions & 0 deletions rust/examples/feed/nasl/22.nasl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
if (description)
{
script_oid("0.0.0.0.0.0.0.0.0.22");
script_version("2023-02-23T13:33:44+0000");
script_tag(name:"last_modification", value:"2020-12-07 13:33:44 +0000 (Mon, 07 Dec 2020)");
script_tag(name:"creation_date", value:"2009-05-12 22:04:51 +0200 (Tue, 12 May 2009)");
script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:N");
script_name("Application Server Detection (HTTP)");
script_category(ACT_GATHER_INFO);
script_tag(name:"qod_type", value:"remote_banner");
script_family("Product detection");
script_copyright("Copyright (C) 2023 Greenbone AG");
script_require_ports("Services/www", 6262);
script_exclude_keys("Settings/disable_cgi_scanning");
script_tag(name:"summary", value:"HTTP AS detection");
script_xref(name:"URL", value:"https://greenbone.net");
exit(0);
}
exit(42);
Loading

0 comments on commit f6396e9

Please sign in to comment.