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

Add --rebuild #998

Merged
merged 11 commits into from
Mar 5, 2020
Merged

Add --rebuild #998

merged 11 commits into from
Mar 5, 2020

Conversation

mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Mar 3, 2020

This adds back the --rebuild option.

This option should not be required in normal operation, and is added only to force a rebuild when errors have resulted in mismatches between the gvmd and ospd-openvas NVTs.

--rebuild will remove all the gvmd NVTs, then add all NVTs from the scanner.

Note that this option is different from gvmd's automatic sync of NVTs, which will only consider NVTs that have been created/modified since the last sync.

Checklist:

@mattmundell mattmundell marked this pull request as ready for review March 3, 2020 15:29
Copy link
Member

@timopollmeier timopollmeier left a comment

Choose a reason for hiding this comment

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

The changes look okay so far, but I think rebuilding the NVTs should also rebuild the
result_nvts table (maybe using the cleanup_result_nvts function) while the update option could also run the cleanup.

@bjoernricks
Copy link
Contributor

Shouldn't we just use one command? I don't know why we should not clean up the db before requesting all nvts. I am really sure we always want to clear the db if the command is issues in GOS.

@mattmundell
Copy link
Contributor Author

The changes look okay so far, but I think rebuilding the NVTs should also rebuild the
result_nvts table (maybe using the cleanup_result_nvts function) while the update option could also run the cleanup.

I'm not sure why rebuilding result_nvts would be necessary. result_nvts associates IDs with all the NVT OIDs that occurr in results, to improve performance, regardless of whether the OIDs appear in the nvts table.

And we already have cleanup_result_nvts, so the user could call that after --rebuild/update if they needed to.

@mattmundell
Copy link
Contributor Author

Shouldn't we just use one command? I don't know why we should not clean up the db before requesting all nvts. I am really sure we always want to clear the db if the command is issues in GOS.

Done in a369c3a.

@bjoernricks
Copy link
Contributor

Thanks a lot!

@mattmundell mattmundell merged commit 90dd913 into greenbone:master Mar 5, 2020
@mattmundell mattmundell deleted the update-rebuild branch March 5, 2020 08:34
@mattmundell mattmundell changed the title Add --rebuild and --update Add --rebuild Mar 18, 2020
@mattmundell mattmundell mentioned this pull request Mar 18, 2020
2 tasks
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