Skip to content

Commit 5d8ec66

Browse files
authored
⭐️ query usb devices on macOS (#5414)
1 parent b6942c3 commit 5d8ec66

File tree

8 files changed

+1033
-2
lines changed

8 files changed

+1033
-2
lines changed

.github/actions/spelling/expect.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ messagestoragepolicy
6161
mfs
6262
mgroup
6363
Mpim
64+
mkey
6465
natgateway
6566
networkinterface
6667
nmap
@@ -70,6 +71,7 @@ notebookinstancedetails
7071
nsrecord
7172
nullgroup
7273
nullstring
74+
nodekey
7375
opcplc
7476
openssl
7577
orstatement
@@ -108,8 +110,7 @@ timestream
108110
toplevel
109111
tpu
110112
tailscale
111-
nodekey
112-
mkey
113+
usb
113114
vdcs
114115
virtualmachine
115116
Vtpm

providers/os/resources/os.lr

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,3 +1754,37 @@ private networkInterface @defaults("name mac active") {
17541754
// Whether a network interface is virtual of not
17551755
virtual bool
17561756
}
1757+
1758+
// Experimental: USB resource
1759+
usb {
1760+
// List of USB devices
1761+
devices() []usb.device
1762+
}
1763+
1764+
// Experimental: USB device
1765+
private usb.device @defaults("manufacturer name") {
1766+
// USB device vendor id
1767+
vendorId string
1768+
// USB manufacturer
1769+
manufacturer string
1770+
// USB device product id
1771+
productId string
1772+
// USB device serial number
1773+
serial string
1774+
// USB device name
1775+
name string
1776+
// USB device version
1777+
version string
1778+
// USB speed
1779+
speed string
1780+
// USB device class
1781+
class string
1782+
// USB device class name
1783+
className string
1784+
// USB device subclass
1785+
subclass string
1786+
// Protocol
1787+
protocol string
1788+
// Removable device
1789+
isRemovable bool
1790+
}

providers/os/resources/os.lr.go

Lines changed: 262 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/os/resources/os.lr.manifest.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,29 @@ resources:
997997
params: {}
998998
is_private: true
999999
min_mondoo_version: latest
1000+
usb:
1001+
fields:
1002+
devices: {}
1003+
min_mondoo_version: 9.0.0
1004+
usb.device:
1005+
fields:
1006+
class: {}
1007+
className: {}
1008+
isRemovable: {}
1009+
manufacturer: {}
1010+
name: {}
1011+
product: {}
1012+
productId: {}
1013+
protocol: {}
1014+
removable: {}
1015+
serial: {}
1016+
speed: {}
1017+
subclass: {}
1018+
vendor: {}
1019+
vendorId: {}
1020+
version: {}
1021+
is_private: true
1022+
min_mondoo_version: 9.0.0
10001023
user:
10011024
fields:
10021025
authorizedkeys: {}

0 commit comments

Comments
 (0)