-
Notifications
You must be signed in to change notification settings - Fork 24
feat(dgw): extend net scanner capabilities #1303
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
Conversation
Let maintainers know that an action is required on their side
|
There was a problem hiding this 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,
| struct TokenQueryParam<'a> { | ||
| token: &'a str, | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Unrelated modification.
There was a problem hiding this 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?
9262b12 to
b7e742c
Compare
|
@CBenoit After discussing with @pauldumais We come to an conclusion to implement the network scan interface like this So I rebased master, and re-implemented part of the logic. Please take a look and let you know your thoughts |
devolutions-gateway/src/api/net.rs
Outdated
| // 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) { |
There was a problem hiding this comment.
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.
devolutions-gateway/src/api/net.rs
Outdated
|
|
||
| /// Disable the execution of broadcast scan | ||
| #[serde(default)] | ||
| pub disable_boardcast: bool, |
There was a problem hiding this comment.
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.
Co-authored-by: Benoît Cortier <3809077+CBenoit@users.noreply.github.com>
a7f9cfa to
8bcf5eb
Compare


Improve on network scanner
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
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"}}}