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

Get results from main kb. #285

Merged
merged 16 commits into from
Jul 15, 2020
Merged

Conversation

jjnicola
Copy link
Member

OpenVAS stores now the results in the main task DB and all results are stored in the same internal/results kb in the main kb.
This allows to get all results stored in redis for all target's hosts at once. Also, avoid to loop looking for results in each single host kb.
Because it does not check the host kbs, ospd-openvas does not release them anymore and this is done by OpenVAS, unless in edge cases in which a scan is stopped or OpenVAS dies unexpectedly, ospd-openvas does the redis cleanup.

@jjnicola jjnicola requested a review from bjoernricks as a code owner July 10, 2020 10:33
@jjnicola jjnicola marked this pull request as draft July 10, 2020 10:33
@jjnicola jjnicola force-pushed the results-main-kb-only branch from 57e909f to 11001c0 Compare July 10, 2020 14:58
jjnicola added 16 commits July 14, 2020 08:23
The host progress is stored by openvas in the scan main kb now.
The host status are all under the same key and to differentiate them,
are prefixed with the host ip.
All hosts status are fetched at once.
There is no need to get current_host from redis.
This is so because the results are stored all under the same key in the main kb.
This reduce significantly the redis queries and kb select/change.
The log messages are under the internal/results in the main kb and
are fetch as the other results.
This reduces the access to the scan table which speeds up the scan.
Removes unnecessary methods which were used to check the host process.
Now the results are in the main kb and host are controled/check/finished by openvas
@jjnicola jjnicola force-pushed the results-main-kb-only branch from 8b6d305 to 7d06eb9 Compare July 14, 2020 06:23
@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #285 into master will increase coverage by 2.46%.
The diff coverage is 87.03%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
+ Coverage   81.94%   84.41%   +2.46%     
==========================================
  Files           9        9              
  Lines        1501     1469      -32     
==========================================
+ Hits         1230     1240      +10     
+ Misses        271      229      -42     
Impacted Files Coverage Δ
ospd_openvas/daemon.py 67.39% <84.44%> (+4.98%) ⬆️
ospd_openvas/db.py 98.82% <100.00%> (+2.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 351cbc4...7d06eb9. Read the comment docs.

@jjnicola jjnicola marked this pull request as ready for review July 14, 2020 06:30
@jjnicola
Copy link
Member Author

Depends on PR greenbone/openvas-scanner#550 and PR greenbone/gvm-libs#376

@bjoernricks bjoernricks merged commit 3c62384 into greenbone:master Jul 15, 2020
@jjnicola jjnicola deleted the results-main-kb-only branch August 25, 2020 09:15
ArnoStiefvater pushed a commit to ArnoStiefvater/ospd-openvas that referenced this pull request Oct 25, 2021
Allow a client to request start_scan during feed update
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.

2 participants