165 Commits

Author SHA1 Message Date
Matt LaPlante
fbc2ec4cd2 Add Offline & Online to partition.
PiperOrigin-RevId: 385849677
2021-07-20 12:47:58 -07:00
Matt LaPlante
951269a048 Add Offline, Online, & Refresh to disk.
PiperOrigin-RevId: 385848928
2021-07-20 12:44:53 -07:00
Matt LaPlante
c6600b290c Remove PowerShell-based storage methods.
PiperOrigin-RevId: 385848871
2021-07-20 12:44:07 -07:00
Matt LaPlante
ea1d25021a Type & null fixes for Volume.Format.
Add nil checks for handle in Query and Close.

PiperOrigin-RevId: 385604384
2021-07-19 11:40:12 -07:00
Matt LaPlante
ad790f20fd Make Partition objects individually refreshable and closable.
Add return values to method calls to fully mimic the backend API.

PiperOrigin-RevId: 385595951
2021-07-19 11:05:27 -07:00
Matt LaPlante
bd3aa53476 Make Volume objects individually refreshable and closable.
Add return values to method calls to fully mimic the backend API.

PiperOrigin-RevId: 385591762
2021-07-19 10:50:26 -07:00
Matt LaPlante
9a4ca9d561 Make Disk objects individually refreshable and closable.
Add return values to method calls to fully mimic the backend API.

PiperOrigin-RevId: 385589504
2021-07-19 10:41:45 -07:00
Matthew Oliver
c4b6aacd39 Convert DriveLetter from Char16 (Ascii) to String
Remove Dupe DriveLetter conversion

PiperOrigin-RevId: 385572478
2021-07-19 09:29:08 -07:00
Matt LaPlante
1c06fb3923 Hold MBR and GPT types inside container structures to avoid name collisions.
PiperOrigin-RevId: 385563055
2021-07-19 08:44:10 -07:00
Matt LaPlante
821a84f920 Add Volume.Format.
PiperOrigin-RevId: 385553621
2021-07-19 07:54:47 -07:00
Matt LaPlante
797d7f3fdb Add support for volumes.
PiperOrigin-RevId: 385552376
2021-07-19 07:46:37 -07:00
Matt LaPlante
653af69be2 Add Disk.CreatePartition.
PiperOrigin-RevId: 385550913
2021-07-19 07:37:47 -07:00
Dan Tsekhanskiy
4a929f781b refactor: Remove logic that checks for stopped osquery process(es)
PiperOrigin-RevId: 385506786
2021-07-19 02:09:36 -07:00
Matt LaPlante
0d0dd126ce Add Disk.Clear and Disk.Initialize.
PiperOrigin-RevId: 385212078
2021-07-16 13:25:36 -07:00
Matt LaPlante
157747f127 Add Partition.Resize and Partition.Delete.
PiperOrigin-RevId: 385210383
2021-07-16 13:16:46 -07:00
Matt LaPlante
7b524576b5 Add DiskSet and PartitionSet, and store a handle to each Disk and Partition.
These handles are needed to make function calls against disks and partitions.

PiperOrigin-RevId: 385150018
2021-07-16 08:18:04 -07:00
Matt LaPlante
edbb35a4f0 Support filtering in GetDisks.
PiperOrigin-RevId: 385147410
2021-07-16 08:01:21 -07:00
Matt LaPlante
7a57fa512c Add support for MSFT_Partition.
PiperOrigin-RevId: 385146260
2021-07-16 07:53:12 -07:00
Matt LaPlante
8fc21c5e7d Add support for enumerating disks via COM.
PiperOrigin-RevId: 385135985
2021-07-16 06:41:23 -07:00
Matt LaPlante
a02b2fff18 Support custom platform validation profile in ProtectWithTPM.
PiperOrigin-RevId: 384914431
2021-07-15 06:39:29 -07:00
Dan Tsekhanskiy
8b31c97818 refactor: Increase osquery timeout
PiperOrigin-RevId: 384305073
2021-07-12 13:29:36 -07:00
Dan Tsekhanskiy
4dc2368686 refactor: Slight rewording nit, as the execution is not always a command
PiperOrigin-RevId: 383908180
2021-07-09 13:09:28 -07:00
Dan Tsekhanskiy
ebf19184be refactor: Set s.State to "Unknown" when the registry key doesn't exist.
PiperOrigin-RevId: 383895100
2021-07-09 12:07:57 -07:00
Matt LaPlante
b4a2b6dcc5 Fix ProtectWithNumericalPassword
PiperOrigin-RevId: 382094653
2021-06-29 08:52:38 -07:00
Matt LaPlante
b63f89f9c5 Add service names to error messages.
PiperOrigin-RevId: 380866407
2021-06-22 12:24:46 -07:00
Dan Tsekhanskiy
73b5225d6f chore: Add example for taskmaster.Trigger
PiperOrigin-RevId: 380812548
2021-06-22 08:31:05 -07:00
Matt LaPlante
78971baf61 Add test for googet.Installed
PiperOrigin-RevId: 380806158
2021-06-22 07:53:27 -07:00
Matt LaPlante
0e0e2c3cf8 Internal Change
PiperOrigin-RevId: 380797136
2021-06-22 06:51:52 -07:00
Dan Tsekhanskiy
bf91b619f5 refactor: Open source tasks.Create
PiperOrigin-RevId: 380039069
2021-06-17 13:59:46 -07:00
Matt LaPlante
0342dac770 Add googet.Installed.
PiperOrigin-RevId: 380007880
2021-06-17 11:37:55 -07:00
Matt LaPlante
b5cded3403 Refactor the Bitlocker package for greater flexibility.
* Create a Volume that can hold an ongoing connection to a volume to be created.
* Move each individual operation to a separate function.
* Add ProtectKeyWithPassphrase support.
* Add ProtectKeyWithNumericalPassword support.
* Add PrepareVolume.
* Add a few custom types for validating arguments.

PiperOrigin-RevId: 379708267
2021-06-16 06:42:51 -07:00
Matt LaPlante
da45798d83 Add a bit more decoration to return code error handling.
PiperOrigin-RevId: 379326481
2021-06-14 12:12:36 -07:00
Matt LaPlante
8915ebce3e Add dism.AddCapability and dism.RemoveCapability
PiperOrigin-RevId: 379313504
2021-06-14 11:04:47 -07:00
Matt LaPlante
cf56e01ff0 Add Session.AddPackage and Session.RemovePackage
PiperOrigin-RevId: 377544334
2021-06-04 10:50:00 -07:00
Matt LaPlante
b258b79b63 Add DismAdd/DismRemove functions for capabilities, drivers, and packages.
Add DismApplyUnattend.

PiperOrigin-RevId: 377323166
2021-06-03 10:43:50 -07:00
Matt LaPlante
1a4a07ba2c Add a dism API library.
PiperOrigin-RevId: 377294112
2021-06-03 08:33:21 -07:00
Matt LaPlante
b39b676599 Add ERROR_IO_DEVICE to known bitlocker errors.
PiperOrigin-RevId: 377287910
2021-06-03 07:56:15 -07:00
Matt LaPlante
58ce1537ba Default to UTC for timer values.
PiperOrigin-RevId: 375781045
2021-05-25 13:21:37 -07:00
Matt LaPlante
2af76a91ee Log stderr/stdout when googet operations fail.
Modify googet.Config to take a full ExecConfig for better execution flexibility.

PiperOrigin-RevId: 375757495
2021-05-25 11:44:41 -07:00
Dan Tsekhanskiy
6caaa55bb2 refactor: Expose TODO info
PiperOrigin-RevId: 374638602
2021-05-19 07:10:37 -07:00
Matt LaPlante
1baf92d502 Fix test table loop.
PiperOrigin-RevId: 374475551
2021-05-18 12:15:28 -07:00
Matt LaPlante
a00964a46d Open source the identity library.
PiperOrigin-RevId: 374271792
2021-05-17 13:46:00 -07:00
Matt LaPlante
1e931e9218 adding googet.AddRepo
PiperOrigin-RevId: 374220145
2021-05-17 10:00:25 -07:00
Dan Tsekhanskiy
8b49468e75 feat: Add Stage struct and functions
- Refactor GetTimes library to return both start and end times
- Replace registry library

PiperOrigin-RevId: 373663580
2021-05-13 14:52:21 -07:00
Matt LaPlante
27a0351d03 Add googet.RemoveRepo()
PiperOrigin-RevId: 373580979
2021-05-13 08:22:17 -07:00
Matt LaPlante
4f0538a33c Add retry handling to helpers.Exec.
PiperOrigin-RevId: 373248489
2021-05-11 15:44:27 -07:00
Matt LaPlante
5356bd2c2b Rework TaskExists and setEnabled.
The previous GetTask setup didn't work properly, likely due to the way the RegisteredTaskCollection is released. Releasing the tasks inside GetTask appears to have had the effect of also releasing the task it was returning, causing potentially undesirable behavior when the task was referenced later.

PiperOrigin-RevId: 373202470
2021-05-11 11:59:28 -07:00
Matt LaPlante
bf0e57aeb5 Restructure Exec helpers to take and pass flexible configuration struct.
PiperOrigin-RevId: 372597881
2021-05-07 11:50:21 -07:00
Matt LaPlante
c75563225e Expand sanity checks on a couple helpers.
PiperOrigin-RevId: 372417503
2021-05-06 13:47:31 -07:00
Matt LaPlante
f89e7fda0a Return Type rather than the type's string value.
PiperOrigin-RevId: 372377651
2021-05-06 10:50:36 -07:00