Skip to content

Commit

Permalink
Merge branch 'main' into rs-network-functions2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kraemii authored Nov 7, 2024
2 parents 2b58f2f + 771eeab commit e98e23a
Show file tree
Hide file tree
Showing 15 changed files with 572 additions and 305 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message ("-- Configuring the Scanner...")

# VERSION: Always include major, minor and patch level.
project (openvas
VERSION 23.10.0
VERSION 23.10.1
LANGUAGES C)

if (POLICY CMP0005)
Expand Down
2 changes: 1 addition & 1 deletion charts/openvasd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "23.10.0"
appVersion: "23.10.1"
1 change: 0 additions & 1 deletion rust/doc/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ paths:
description: "Schema of a list of results response"
get results 0-3:
$ref: "#/components/examples/scan_results"

"400":
description: "Bad range format"
"404":
Expand Down
187 changes: 0 additions & 187 deletions rust/src/nasl/syntax/tests/parsing.rs

This file was deleted.

69 changes: 18 additions & 51 deletions rust/src/openvas/result_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
};

use crate::openvas::openvas_redis::{KbAccess, VtHelper};
use crate::osp::{OspResultType, OspScanResult, StringF32};
use crate::osp::{OspResultType, OspScanResult};
use crate::storage::redis::RedisStorageResult;

/// Structure to hold the results retrieve from redis main kb
Expand Down Expand Up @@ -111,62 +111,29 @@ where
}
};
}

if error_msg {
let mut push_result = |x| {
scan_results.push(OspScanResult {
result_type: OspResultType::Error,
host: current_host,
hostname: host_name,
port,
test_id: roid.to_string(),
description: value,
severity: StringF32::from(0.0),
name: rname,
result_type: x,
host: Some(current_host.clone()),
hostname: Some(host_name.clone()),
port: Some(port.clone()),
test_id: Some(roid.to_string()),
description: value.clone(),
severity: None,
name: rname.clone(),
});
};

if error_msg {
push_result(OspResultType::Error);
} else if result_type == "LOG" {
scan_results.push(OspScanResult {
result_type: OspResultType::Log,
host: current_host,
hostname: host_name,
port,
test_id: roid.to_string(),
description: value,
severity: StringF32::from(0.0),
name: rname,
});
push_result(OspResultType::Log);
} else if result_type == "HOST_START" {
scan_results.push(OspScanResult {
result_type: OspResultType::HostStart,
host: current_host,
hostname: host_name,
port,
test_id: roid.to_string(),
description: value,
severity: StringF32::from(0.0),
name: rname,
});
push_result(OspResultType::HostStart);
} else if result_type == "HOST_END" {
scan_results.push(OspScanResult {
result_type: OspResultType::HostEnd,
host: current_host,
hostname: host_name,
port,
test_id: roid.to_string(),
description: value,
severity: StringF32::from(0.0),
name: rname,
});
push_result(OspResultType::HostEnd);
} else if result_type == "ALARM" {
scan_results.push(OspScanResult {
result_type: OspResultType::Alarm,
host: current_host,
hostname: host_name,
port,
test_id: roid.to_string(),
description: value,
severity: StringF32::from(0.0),
name: rname,
});
push_result(OspResultType::Alarm);
} else if result_type == "DEADHOST" {
new_dead += i64::from_str(&value).expect("Valid amount of dead hosts");
} else if host_count {
Expand Down
4 changes: 2 additions & 2 deletions rust/src/openvasd/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub struct OspdWrapper {
impl Default for OspdWrapper {
fn default() -> Self {
OspdWrapper {
socket: PathBuf::from("/var/run/ospd/ospd.sock"),
socket: PathBuf::from("/var/run/ospd/ospd-openvas.sock"),
read_timeout: None,
}
}
Expand Down Expand Up @@ -655,7 +655,7 @@ mod tests {
assert_eq!(config.scheduler.check_interval, Duration::from_millis(500));
assert_eq!(
config.scanner.ospd.socket,
PathBuf::from("/var/run/ospd/ospd.sock")
PathBuf::from("/var/run/ospd/ospd-openvas.sock")
);
assert!(config.scanner.ospd.read_timeout.is_none());

Expand Down
Loading

0 comments on commit e98e23a

Please sign in to comment.