Skip to content

Commit

Permalink
Improve OSPD_PARAMS dict
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoStiefvater committed Jul 20, 2020
1 parent d893035 commit 6e5eb50
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 46 deletions.
30 changes: 15 additions & 15 deletions ospd_openvas/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@
'mandatory': 0,
'visible_for_client': 0,
'description': (
'Is maximum number of hosts to test at the same time which'
+ 'should be given to the client (which can override it).'
+ 'This value must be computed given your bandwidth,'
+ 'the number of hosts you want to test, your amount of'
+ 'memory and the horsepower of your processor(s).'
'The maximum number of hosts to test at the same time which '
+ 'should be given to the client (which can override it). '
+ 'This value must be computed given your bandwidth, '
+ 'the number of hosts you want to test, your amount of '
+ 'memory and the performance of your processor(s).'
),
},
'max_checks': {
Expand All @@ -245,14 +245,14 @@
'mandatory': 0,
'visible_for_client': 0,
'description': (
'is the number of plugins that will run against each host being'
+ ' tested. Note that the total number of process will be max'
+ ' checks x max_hosts so you need to find a balance between'
+ ' these two options. Note that launching too many plugins at'
+ ' the same time may disable the remote host, either temporarily'
+ ' (ie: inetd closes its ports) or definitely (the remote host'
+ ' crash because it is asked to do too many things at the'
+ ' same time), so be careful.'
'The number of plugins that will run against each host being '
+ 'tested. Note that the total number of process will be max '
+ 'checks x max_hosts so you need to find a balance between '
+ 'these two options. Note that launching too many plugins at '
+ 'the same time may disable the remote host, either temporarily '
+ '(ie: inetd closes its ports) or definitely (the remote host '
+ 'crash because it is asked to do too many things at the '
+ 'same time), so be careful.'
),
},
'port_range': {
Expand All @@ -268,7 +268,7 @@
+ 'ranges of ports ("1-1500,32000-33000"). Note that you can '
+ 'specify UDP and TCP ports by prefixing each range by T or U. '
+ 'For instance, the following range will make openvas scan UDP '
+ ' ports 1 to 1024 and TCP ports 1 to 65535 : '
+ 'ports 1 to 1024 and TCP ports 1 to 65535 : '
+ '"T:1-65535,U:1-1024".'
),
},
Expand All @@ -294,7 +294,7 @@
'visible_for_client': 0,
'description': (
'Name of the network interface that will be used as the source '
+ 'of connections established by OpenVAS. The scan won\'t be '
+ 'of connections established by openvas. The scan won\'t be '
+ 'launched if the value isn\'t authorized according to '
+ '(sys_)ifaces_allow / (sys_)ifaces_deny if present.'
),
Expand Down
74 changes: 43 additions & 31 deletions tests/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,44 +59,52 @@
'default': 5,
'mandatory': 1,
'visible_for_client': 1,
'description': 'Number of seconds that the security checks will '
'wait for when doing a recv()',
'description': (
'Number of seconds that the security checks will '
+ 'wait for when doing a recv()'
),
},
'non_simult_ports': {
'type': 'string',
'name': 'non_simult_ports',
'default': '22',
'default': '139, 445, 3389, Services/irc',
'mandatory': 1,
'visible_for_client': 1,
'description': 'Prevent to make two connections on the same given '
'ports at the same time.',
'description': (
'Prevent to make two connections on the same given '
+ 'ports at the same time.'
),
},
'open_sock_max_attempts': {
'type': 'integer',
'name': 'open_sock_max_attempts',
'default': 5,
'mandatory': 0,
'visible_for_client': 1,
'description': 'Number of unsuccessful retries to open the socket '
'before to set the port as closed.',
'description': (
'Number of unsuccessful retries to open the socket '
+ 'before to set the port as closed.'
),
},
'timeout_retry': {
'type': 'integer',
'name': 'timeout_retry',
'default': 5,
'mandatory': 0,
'visible_for_client': 1,
'description': 'Number of retries when a socket connection attempt '
'timesout.',
'description': (
'Number of retries when a socket connection attempt ' + 'timesout.'
),
},
'optimize_test': {
'type': 'integer',
'name': 'optimize_test',
'default': 5,
'mandatory': 0,
'visible_for_client': 1,
'description': 'By default, openvas does not trust the remote '
'host banners.',
'description': (
'By default, openvas does not trust the remote ' + 'host banners.'
),
},
'plugins_timeout': {
'type': 'integer',
Expand All @@ -120,8 +128,10 @@
'default': 1,
'mandatory': 1,
'visible_for_client': 1,
'description': 'Disable the plugins with potential to crash '
'the remote services',
'description': (
'Disable the plugins with potential to crash '
+ 'the remote services'
),
},
'scanner_plugins_timeout': {
'type': 'integer',
Expand All @@ -137,8 +147,10 @@
'default': 0,
'mandatory': 0,
'visible_for_client': 1,
'description': 'Allow to set a wait time between two actions '
'(open, send, close).',
'description': (
'Allow to set a wait time between two actions '
+ '(open, send, close).'
),
},
'unscanned_closed': {
'type': 'boolean',
Expand Down Expand Up @@ -184,11 +196,11 @@
'mandatory': 0,
'visible_for_client': 0,
'description': (
'Is maximum number of hosts to test at the same time which'
+ 'should be given to the client (which can override it).'
+ 'This value must be computed given your bandwidth,'
+ 'the number of hosts you want to test, your amount of'
+ 'memory and the horsepower of your processor(s).'
'The maximum number of hosts to test at the same time which '
+ 'should be given to the client (which can override it). '
+ 'This value must be computed given your bandwidth, '
+ 'the number of hosts you want to test, your amount of '
+ 'memory and the performance of your processor(s).'
),
},
'max_checks': {
Expand All @@ -198,14 +210,14 @@
'mandatory': 0,
'visible_for_client': 0,
'description': (
'is the number of plugins that will run against each host being'
+ ' tested. Note that the total number of process will be max'
+ ' checks x max_hosts so you need to find a balance between'
+ ' these two options. Note that launching too many plugins at'
+ ' the same time may disable the remote host, either temporarily'
+ ' (ie: inetd closes its ports) or definitely (the remote host'
+ ' crash because it is asked to do too many things at the'
+ ' same time), so be careful.'
'The number of plugins that will run against each host being '
+ 'tested. Note that the total number of process will be max '
+ 'checks x max_hosts so you need to find a balance between '
+ 'these two options. Note that launching too many plugins at '
+ 'the same time may disable the remote host, either temporarily '
+ '(ie: inetd closes its ports) or definitely (the remote host '
+ 'crash because it is asked to do too many things at the '
+ 'same time), so be careful.'
),
},
'port_range': {
Expand All @@ -221,7 +233,7 @@
+ 'ranges of ports ("1-1500,32000-33000"). Note that you can '
+ 'specify UDP and TCP ports by prefixing each range by T or U. '
+ 'For instance, the following range will make openvas scan UDP '
+ ' ports 1 to 1024 and TCP ports 1 to 65535 : '
+ 'ports 1 to 1024 and TCP ports 1 to 65535 : '
+ '"T:1-65535,U:1-1024".'
),
},
Expand All @@ -247,7 +259,7 @@
'visible_for_client': 0,
'description': (
'Name of the network interface that will be used as the source '
+ 'of connections established by OpenVAS. The scan won\'t be '
+ 'of connections established by openvas. The scan won\'t be '
+ 'launched if the value isn\'t authorized according to '
+ '(sys_)ifaces_allow / (sys_)ifaces_deny if present.'
),
Expand Down Expand Up @@ -309,7 +321,7 @@ class TestOspdOpenvas(TestCase):
@patch('ospd_openvas.daemon.Openvas')
def test_set_params_from_openvas_settings(self, mock_openvas: Openvas):
mock_openvas.get_settings.return_value = {
'non_simult_ports': '22',
'non_simult_ports': '139, 445, 3389, Services/irc',
'plugins_folder': '/foo/bar',
}
w = DummyDaemon()
Expand Down

0 comments on commit 6e5eb50

Please sign in to comment.