Skip to content

Conversation

@irvingoujAtDevolution
Copy link
Contributor

@irvingoujAtDevolution irvingoujAtDevolution commented Apr 9, 2025

Improve on network scanner

  1. It will now take three extra query params
    a. ports[] (the port to scan, will use default one if nothing provided)
    b. ranges[] (the range to ping, will use local subnet if not provided)
    format will be lower-higher, you can sepicify multiple ranges
    c. disable_ping_event

  2. It will now send two ping event other than just scan entries, this behavior could be toggled off by set disable_ping_event to true
    a. pingstart
    b. pingfailed

theh original search entry will move into the top level attribute 'entry'
{"entry":{"ip":"10.10.0.2","hostname":null,"protocol":"ssh"}}
and event will be in the following format
{"event":{"pingstart":{"ip_addr":"10.10.0.5"}}}

image

@github-actions
Copy link

github-actions bot commented Apr 9, 2025

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

crates/network-scanner/src/task_utils.rs:43

  • Consider renaming 'boardcast_subnet' to 'broadcast_subnet' to correct the spelling and improve clarity.
pub(crate) boardcast_subnet: Vec<Subnet>, // The subnet that have a broadcast address

devolutions-gateway/src/api/net.rs:149

  • [nitpick] Consider using a consistent name (e.g., 'disable_ping_event') across the query parameters and downstream configuration to avoid confusion.
pub disable_ping_events: bool,

@irvingoujAtDevolution irvingoujAtDevolution changed the title scanner redo feat: improvement on net scanner Apr 9, 2025
struct TokenQueryParam<'a> {
token: &'a str,
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Unrelated modification.

Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you addressed the comments, can you show me how query and results look like in their serialized form?

@irvingoujAtDevolution
Copy link
Contributor Author

@CBenoit After discussing with @pauldumais

We come to an conclusion to implement the network scan interface like this

https://devolutions.atlassian.net/wiki/spaces/~712020171b88e204194361b12ff01b4147b69e/pages/4627988907/Devolutions+Gateway+Networks+Scan+New+API

So I rebased master, and re-implemented part of the logic. Please take a look and let you know your thoughts

@irvingoujAtDevolution
Copy link
Contributor Author

example result
image

Comment on lines 36 to 38
// Use serde_qs to parse array parameters
// As suggested by serde_urlencoded author https://github.com/nox/serde_urlencoded/issues/85
let query_params = match from_str::<NetworkScanQueryParams>(&query, ParseMode::Duplicate) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Outdated comment. Please update.


/// Disable the execution of broadcast scan
#[serde(default)]
pub disable_boardcast: bool,
Copy link
Member

@CBenoit CBenoit Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: typo in API boundaries. Search and replace all boardcast to broadcast.

@CBenoit
Copy link
Member

CBenoit commented Apr 11, 2025

example result image

It seems you are using ranges[] in the query params. I guess this is an outdated screenshot?

@CBenoit CBenoit changed the title refractor(dgw): refractor and improve on net scanner feat(dgw): extend net scanner capabilities Apr 17, 2025
@irvingoujAtDevolution irvingoujAtDevolution enabled auto-merge (squash) April 17, 2025 16:15
@irvingoujAtDevolution irvingoujAtDevolution merged commit 7518a4e into master Apr 17, 2025
38 checks passed
@irvingoujAtDevolution irvingoujAtDevolution deleted the scanner-redo branch April 17, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants