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

Added validation, error handling and some debug messages for credentials #416

Merged
merged 3 commits into from
May 12, 2021

Conversation

Kraemii
Copy link
Member

@Kraemii Kraemii commented May 6, 2021

What:
Added validation, error handling and some debug messages for credentials

Why:
Validation was missing on the ospd-openvas side. Also added some error messages to know exactly what was wrong.

How:
I tested each validation and error messages and also tested some proper scans with gvm-cli and also GSA, to know that we don't get errors when everything should be fine.
Template script for testing with gvm-cli:

<start_scan scan_id='97079ee9-8917-49da-aa4f-4ef95f757ac1'>
  <vt_selection>
    <vt_single id='1.3.6.1.4.1.25623.1.0.100315'>
      <vt_value id='9'>1</vt_value>
      <vt_value id='6'>1</vt_value>
      <vt_value id='3'>1</vt_value>
    </vt_single>
  </vt_selection>
  <targets>
    <target>
      <hosts>127.0.0.1</hosts>
      <ports>80,8080,443,22</ports>
      <exclude_hosts></exclude_hosts>
      <credentials>
        <credential service="ssh" type="up" port="22">
          <username>user</username>
          <password>pw</password>
        </credential>
      </credentials>
    </target>
  </targets>
  <scanner_params>
  </scanner_params>
</start_scan>

Checklist:

@Kraemii Kraemii requested a review from a team as a code owner May 6, 2021 14:50
@codecov
Copy link

codecov bot commented May 7, 2021

Codecov Report

Merging #416 (ae4ae2d) into master (a77d367) will decrease coverage by 0.11%.
The diff coverage is 79.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
- Coverage   84.21%   84.09%   -0.12%     
==========================================
  Files           9        9              
  Lines        1539     1584      +45     
==========================================
+ Hits         1296     1332      +36     
- Misses        243      252       +9     
Impacted Files Coverage Δ
ospd_openvas/daemon.py 66.78% <0.00%> (-0.75%) ⬇️
ospd_openvas/preferencehandler.py 89.85% <91.48%> (+0.30%) ⬆️

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 a77d367...ae4ae2d. Read the comment docs.

@jjnicola jjnicola merged commit 8a359e5 into greenbone:master May 12, 2021
@Kraemii Kraemii deleted the better-credential-validation branch May 12, 2021 13:47
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