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

Improve logging for unsatisfied vts dependencies #336

Merged
merged 4 commits into from
Sep 16, 2020

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Sep 15, 2020

What:
Log the file name of the missing dependency.

Why:
Because it is currently log only the OID of the problematic VT, but not the name of the missing dependency.

How:
Modify a nasl script, adding a typo to an existing dependency. Run openvas -u to update the Redis cache. Run <get_vts/> command. You will see in the logs, the name of the missing deps for the modified nasl plugin.

Checklist:

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #336 into ospd-openvas-20.08 will decrease coverage by 0.88%.
The diff coverage is n/a.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           ospd-openvas-20.08     #336      +/-   ##
======================================================
- Coverage               82.71%   81.83%   -0.89%     
======================================================
  Files                       9        9              
  Lines                    1481     1519      +38     
======================================================
+ Hits                     1225     1243      +18     
- Misses                    256      276      +20     
Impacted Files Coverage Δ
ospd_openvas/__version__.py 100.00% <ø> (ø)
ospd_openvas/daemon.py 62.01% <ø> (-0.90%) ⬇️
ospd_openvas/db.py 96.24% <ø> (-3.36%) ⬇️
ospd_openvas/lock.py 85.96% <ø> (+0.25%) ⬆️
ospd_openvas/nvticache.py 98.49% <ø> (+0.01%) ⬆️
ospd_openvas/openvas.py 100.00% <ø> (ø)
ospd_openvas/preferencehandler.py 87.88% <ø> (+0.78%) ⬆️
ospd_openvas/vthelper.py 86.61% <ø> (-2.10%) ⬇️
... and 5 more

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 9e04941...03ae3d9. Read the comment docs.

@@ -717,9 +717,9 @@ def get_dependencies_vt_as_xml_str(
vt_deps_xml = Element('dependencies')
for dep in vt_dependencies:
_vt_dep = Element('dependency')
try:
if "1.3.6.1.4.1.25623." in dep:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a global constant for this OID value. From the outside this value is very difficult to understand.

@jjnicola jjnicola merged commit c12f15c into greenbone:ospd-openvas-20.08 Sep 16, 2020
@jjnicola jjnicola deleted the improve-log-deps branch September 16, 2020 08:12
ArnoStiefvater pushed a commit to ArnoStiefvater/ospd-openvas that referenced this pull request Oct 25, 2021
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