Conversation
…d scripts for each running host, instead of the host scan progress percentage
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files |
rust/doc/openapi.yml
Outdated
| description: "Additional information about the scanned host", | ||
| properties: { | ||
| finished_tests: { | ||
| description: "The number of vulnerability test alredy run for the host", |
There was a problem hiding this comment.
| description: "The number of vulnerability test alredy run for the host", | |
| description: "The number of vulnerability tests already run for the host", |
rust/doc/openapi.yml
Outdated
| format: "int32" | ||
| }, | ||
| total_tests: { | ||
| description: "The total amount of vulnerability test to be run for the host", |
There was a problem hiding this comment.
| description: "The total amount of vulnerability test to be run for the host", | |
| description: "The total amount of vulnerability tests to be run for the host", |
rust/src/models/host_info.rs
Outdated
| if progress.finished_tests() == progress.total_tests() | ||
| || progress.total_tests == ScanProgress::DeadHost as i32 |
There was a problem hiding this comment.
Since we already have the SingleHostScanInfo (which I like), I think we could move this logic to some sort of is_finished on the type.
Also I'm not sure I fully understand the ScanProgress enum. Are we expecting further variants to be added to that at some point? Maybe a clearer way to express the intent (at least as I understand it) would be to make total_tests some sort of
enum TotalTests {
Num(i32),
DeadHost,
}and to parse that from the given i32 upon creation?
rust/src/openvas/result_collector.rs
Outdated
| } | ||
| }; | ||
|
|
||
| let launched = i32::from_str(launched).expect("Integer"); |
There was a problem hiding this comment.
Note that .expect is (imo) the worst-named function in the std lib, since it is so intuitive to write the code exactly as you did, yet this results in an error like
thread 'main' panicked at src/main.rs:2:32:
Integer: ParseIntError { kind: InvalidDigit }
If you unwrap, you get
thread 'main' panicked at src/main.rs:2:32:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
which is almost more informative ... I think the better thing is to either .unwrap(), or provide the actual error message via .expect("Expected an integer") or something similar.
There was a problem hiding this comment.
Why do we even unwrap here? It is returning a RedisStorageResult so it could be i32::from_str(launched).map_err(|x|...)?;.
c9d6b49 to
b41fc43
Compare
🔍 Vulnerabilities of
|
| digest | sha256:05e0a92e2e27f9e36d19b6a2b62088e966a3e41f98254bb06191d19c875e036d |
| vulnerabilities | |
| size | 144 MB |
| packages | 261 |
📦 Base Image debian:stable-20250113-slim
| also known as |
|
| digest | sha256:9dfddad9f09eadd2541a567e0865bd223387cf490b1c8d9d1f08d3b413766841 |
| vulnerabilities |
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
Description
Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
b41fc43 to
cc684f2
Compare
ArnoStiefvater
left a comment
There was a problem hiding this comment.
Making sure to not merge accidentally.
What:
Change the scan status information returns the total scripts and finished scripts for each running host, instead of the host scan progress percentage
Jira: SC-1226
Why:
How:
Checklist: