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

Consider individually supplied alive test methods #331

Merged
merged 11 commits into from
Oct 14, 2020

Conversation

ArnoStiefvater
Copy link
Member

@ArnoStiefvater ArnoStiefvater commented Aug 31, 2020

What:

Alive test methods can now be specified not only via bit field but also via single xml elements for every method. This PR allows the use of these single elements.

Alive test supplied via <alive_test> takes precedence over alive test methods supplied vi <alive_test_methods> element.

PR also fixes stack trace when invalid alive test is supplied.

Dependend on:
greenbone/ospd#329

Why:

Better usability.

How:

Tested with python-gvm and following target description with different configurations.

<target>
    <alive_test_methods>
        <icmp>0</icmp>
        <tcp_ack>0</tcp_ack>
        <tcp_syn>0</tcp_syn>
        <arp>0</arp>
        <consider_alive>0</consider_alive>
    </alive_test_methods>
    <hosts>127.0.0.1</hosts>
</target>

Checklist:

@bjoernricks
Copy link
Contributor

@ArnoStiefvater what about this PR?

@ArnoStiefvater
Copy link
Member Author

@ArnoStiefvater what about this PR?

This PR will be updated and marked for review soon.

Alive test methods can now be specified not only
via bit flag but also via single xml elements for
evert method. This commit allows the use of these
single elements.
Transform the specified alive test methods into
a bit field as used in most of the gvm components
via a seperate function.
Use fallback icmp ping method for boreas if no
valid method was provided.
We use icmp ping as fallback now when an invalid
alive test was provided.
Alive test methods are supplied via seperate
elements. E.g.
<alive_test_methods>
    <icmp>1</icmp>
    <arp>1</arp>
</alive_test_methods>
Alive test as enum as precedence over indivually
supplied methods.
Add more tests for teting when alive test methods
were supplied indivually.
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #331 into master will increase coverage by 0.23%.
The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #331      +/-   ##
==========================================
+ Coverage   84.16%   84.39%   +0.23%     
==========================================
  Files           9        9              
  Lines        1471     1493      +22     
==========================================
+ Hits         1238     1260      +22     
  Misses        233      233              
Impacted Files Coverage Δ
ospd_openvas/preferencehandler.py 88.78% <97.05%> (+0.85%) ⬆️

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 e1be225...2762801. Read the comment docs.

Handle the case when the alive test was supplied
via seperate elements.
Also fix traceback when no valid alive test was
supplied by checking if alive_test_opt is empty
before trying to add them to the preferences.
Add test for invalid alive test.
Add test for alive test supplied via seperete
elements.
Add test for empty alive test elements.
@ArnoStiefvater ArnoStiefvater marked this pull request as ready for review October 13, 2020 11:20
@jjnicola jjnicola merged commit c2292d6 into greenbone:master Oct 14, 2020
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.

3 participants