-
Notifications
You must be signed in to change notification settings - Fork 158
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
Consider new vt refs in SQL data model. #553
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This prepare to use the table for storing references in a dedicated table rather than in the VTs.
This always removes all refs for the vt first to ensure a remove vt is indeed removed. This routine is a bit slow and there might be options to improve performance.
The respective fields will not be filled in the table "nvts" anymore.
The list of CVEs referring to a NVT can now be retrieved via the new vt_refs table. Essentially these commands are equivalent: gvmd=> select ref_id from vt_refs where vt_oid = '1.3.6.1.4.1.25623.1.0.808066' and type = 'cve'; ref_id --------------- CVE-2015-3152 gvmd=> select cve_name from nvt_cves where oid = '1.3.6.1.4.1.25623.1.0.808066'; cve_name --------------- CVE-2015-3152
A recent commit was going to far for now. Several functionalities still require the cve in its old location. Eventually this commit can finally be reverted for a clean situation.
This table is not used anymore because the table vt_refs is now used in all places.
These two fields are not used anywhere anymore. The table vt_refs is used now to store and access bid and xref references.
It is not used anymore since recent commit.
Since two columns were removed, the count for the following ones need to be decreased by 2.
This dramatically speeds up the loading of the nvt cache by at least a factor of 1000.
40df2cd
to
f5ad18c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: A sequence of smaller PRs established this functionality, so this PR is void
and was therefore closed without merge.
Essentially the columns "bid", "xrefs" and "cve" are removed from table "nvts".
These fields contained comma-separated lists of references where xref
hat a addtional colon-separation to define a type.
A new table "vt_refs" will store all these references with one reference per entry.
This removes the internal syntax of comma/colon-separation and the respective parsing.
Subsequently many places are changed because actually the access to the
references is now simpler. Even some some helper tables can be removed.
"bid" and "xref" are relatively easy to resolve. But for "cve" many internal logic
algorithms need adjustments.
The changes are not applied for the sqlite3 case, only for PostgreSQL.
Required:
greenbone/gvm-libs#232