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

✨ Add basic support for scanning windows disk drives via device conn. #4208

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

preslavgerchev
Copy link
Contributor

@preslavgerchev preslavgerchev commented Jun 7, 2024

Add support for identifying the drive letter where the windows partition is located by only specifying the LUN (logical unit number) or the serial number of the disk.

./cnquery.exe shell device --serial-number 123455
./cnquery.exe shell device --lun 2

There's also support for setting a disk online if it's found to be offline. This only happens if we that this is the target disk that we're searching for. Once scanning is done, the disk is set back to offline.

Copy link
Contributor

github-actions bot commented Jun 7, 2024

Test Results

3 071 tests  +13   3 070 ✅ +13   1m 31s ⏱️ +5s
  362 suites + 1       1 💤 ± 0 
   27 files   ± 0       0 ❌ ± 0 

Results for commit 7a7872f. ± Comparison against base commit f269cc1.

♻️ This comment has been updated with latest results.

@vjeffrey vjeffrey requested a review from afiune June 10, 2024 17:23
Copy link
Contributor

@afiune afiune left a comment

Choose a reason for hiding this comment

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

About to test this!

@preslavgerchev preslavgerchev force-pushed the preslav/device-conn-windows branch 5 times, most recently from 8260b0c to 6ec9646 Compare June 12, 2024 20:00
preslavgerchev and others added 6 commits June 13, 2024 19:57
Signed-off-by: Preslav <preslav@mondoo.com>
Signed-off-by: Preslav <preslav@mondoo.com>
Proof-of-concept that we can use the `reg` command instead of the
syscall that doesn't seem to work when running with `SYSTEM` user.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/reg

Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
@preslavgerchev preslavgerchev force-pushed the preslav/device-conn-windows branch from 12337a3 to 0fd2301 Compare June 13, 2024 16:57
Copy link
Contributor

@afiune afiune left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Preslav <preslav@mondoo.com>
@preslavgerchev preslavgerchev merged commit 77c0081 into main Jun 13, 2024
15 checks passed
@preslavgerchev preslavgerchev deleted the preslav/device-conn-windows branch June 13, 2024 18:20
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants