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

Port list validation #411

Merged
merged 3 commits into from
Apr 27, 2021
Merged

Conversation

jjnicola
Copy link
Member

What:
Perform port list validation before starting OpenVAS

Why:
To ensure it is a valid port

How:
Start a scan with an invalid port list with gvm-cli:

gvm-cli --protocol OSP --timeout 120 socket --socketpath=/home/juan/install/var/run/ospd/openvas.sock --xml "<start_scan scan_id='829097a9-85d5-4bb8-bac0-e64c362b2836'><targets><target><hosts>localhost</hosts><exclude_hosts></exclude_hosts><finished_hosts/><ports>2,-9,3</ports><credentials><credential port='22' service='ssh' type='up'><username>test</username><password>test</password></credential></credentials></target></targets><scanner_params><test_alive_hosts_only>0</test_alive_hosts_only></scanner_params><vt_selection><vt_single id='1.3.6.1.4.1.25623.1.0.14259'/></vt_selection></start_scan>" |xmlstarlet fo

Checklist:

Validate the port list to be sent to openvas.
If it is not a valid port list, it logs an error and send a error message to the client
@jjnicola jjnicola requested a review from a team as a code owner April 26, 2021 13:08
@jjnicola
Copy link
Member Author

Depends on greenbone/ospd#393

@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #411 (2f27fef) into master (f5e388d) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #411      +/-   ##
==========================================
+ Coverage   84.17%   84.21%   +0.03%     
==========================================
  Files           9        9              
  Lines        1536     1539       +3     
==========================================
+ Hits         1293     1296       +3     
  Misses        243      243              
Impacted Files Coverage Δ
ospd_openvas/daemon.py 67.53% <ø> (ø)
ospd_openvas/preferencehandler.py 89.55% <100.00%> (+0.10%) ⬆️

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 f5e388d...2f27fef. Read the comment docs.

@ArnoStiefvater ArnoStiefvater merged commit 5f2bedf into greenbone:master Apr 27, 2021
@jjnicola jjnicola deleted the port-list-validation branch April 27, 2021 13:55
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