Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle addition of ID to NVT preferences. #413

Merged
merged 7 commits into from
Mar 19, 2019

Conversation

kroosec
Copy link
Contributor

@kroosec kroosec commented Mar 4, 2019

No description provided.

@kroosec kroosec added the work in progress This pull request should not be merged yet, more commits are expected label Mar 4, 2019
@kroosec kroosec requested review from mattmundell, timopollmeier and a team March 4, 2019 08:17
Copy link
Member

@cfi-gb cfi-gb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that the following two files are using preferences of ping_host.nasl as well:

https://github.com/greenbone/gvmd/blob/b6d078e6d2da0b3eb95a415ad34ca392b394f043/src/manage_config_host_discovery.c

https://github.com/greenbone/gvmd/blob/b6d078e6d2da0b3eb95a415ad34ca392b394f043/src/manage_config_discovery.c

Those ids where not added to the ping_host.nasl file yet.

@@ -2139,7 +2127,7 @@ send_alive_test_preferences (target_t target)
if (alive_test == ALIVE_TEST_CONSIDER_ALIVE)
{
/* Also select a method, otherwise Ping Host logs a warning. */
if (sendf_to_server (OID_PING_HOST ":checkbox:Do a TCP ping <|> yes\n"))
if (sendf_to_server (OID_PING_HOST ":1:checkbox:Do a TCP ping <|> yes\n"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids where added to ping_host.nasl today.

@@ -5393,7 +5382,7 @@ run_otp_task (task_t task, scanner_t scanner, int from, char **report_id)
(gpointer) g_strdup (credential_iterator_private_key
(&credentials)));

if (sendf_to_server (OID_SSH_AUTH ":file:SSH private key:"
if (sendf_to_server (OID_SSH_AUTH ":4:file:SSH private key:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids where added to ssh_authorization_init.nasl today.

user ? user : "")
|| sendf_to_server (OID_SMB_AUTH ":password:SMB password:"
|| sendf_to_server (OID_SMB_AUTH ":2:password:SMB password:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids where added to smb_authorization.nasl today.

" <|> %s\n",
user ? user : "")
|| sendf_to_server (OID_ESXI_AUTH ":password:ESXi login password:"
|| sendf_to_server (OID_ESXI_AUTH ":2:password:ESXi login password:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids where added to gb_esxi_authorization.nasl today.

"SNMPv3 Privacy Password:"
" <|> %s\n",
privacy_password ? privacy_password : "")
|| sendf_to_server (OID_SNMP_AUTH ":radio:"
|| sendf_to_server (OID_SNMP_AUTH ":6:radio:"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ids where added to gb_snmp_authorization.nasl today.

@kroosec kroosec removed the work in progress This pull request should not be merged yet, more commits are expected label Mar 10, 2019
Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm keen to get this in but would like to see the GMP doc updated with the ID, and also a check of why the OID_PING_HOST preference was removed.

src/gmp.c Show resolved Hide resolved
src/gmp.c Outdated Show resolved Hide resolved
src/manage_sql_nvts.c Show resolved Hide resolved
src/manage.c Show resolved Hide resolved
src/gmp.c Show resolved Hide resolved
src/gmp.c Show resolved Hide resolved
@kroosec
Copy link
Contributor Author

kroosec commented Mar 14, 2019

I'm keen to get this in but would like to see the GMP doc updated with the ID, and also a check of why the OID_PING_HOST preference was removed.

Fixed all issues. Also added to the PR a routine to update old-style preferences in config_preferences.

" <|> %s\n",
((alive_test & ALIVE_TEST_TCP_SYN_SERVICE)
&& (alive_test & ALIVE_TEST_TCP_ACK_SERVICE))
? "yes"
: "no"))
return -1;

if (sendf_to_server (OID_PING_HOST ":checkbox:TCP ping tries only TCP-SYN ping"
if (sendf_to_server (OID_PING_HOST ":7:checkbox:TCP ping tries only TCP-SYN ping"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id:7 for this preference was added to ping_host.nasl today.

uuid)
== 0)
{
sql ("INSERT INTO config_preferences (config, type, name, value)"
" VALUES ((SELECT id FROM configs WHERE uuid = '%s'),"
" 'PLUGINS_PREFS',"
" '" OID_GLOBAL_SETTINGS ":checkbox:Strictly unauthenticated',"
" '" OID_GLOBAL_SETTINGS ":1:checkbox:Strictly unauthenticated',"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id:1 for this preference was added to global_settings.nasl today.

Copy link
Contributor

@mattmundell mattmundell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great, just one ID case missing in the docs. Can confirm updating old prefs works for me.

src/schema_formats/XML/GMP.xml.in Show resolved Hide resolved
@mattmundell mattmundell merged commit 9dba90b into greenbone:master Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants