-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathintune_devices.go
More file actions
62 lines (49 loc) · 2.27 KB
/
Copy pathintune_devices.go
File metadata and controls
62 lines (49 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// File: client/intune_devices.go
// Copyright (C) 2022 SpecterOps
// Implementation of Intune device management API calls
package client
import (
"context"
"fmt"
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/intune"
)
func setDefaultParams(params *query.GraphParams) {
if params.Top == 0 {
params.Top = 999
}
}
// ListIntuneManagedDevices retrieves all managed devices from Intune
// GET /deviceManagement/managedDevices
func (s *azureClient) ListIntuneManagedDevices(ctx context.Context, params query.GraphParams) <-chan AzureResult[intune.ManagedDevice] {
var (
out = make(chan AzureResult[intune.ManagedDevice])
path = fmt.Sprintf("/%s/deviceManagement/managedDevices", constants.GraphApiVersion)
)
setDefaultParams(¶ms)
go getAzureObjectList[intune.ManagedDevice](s.msgraph, ctx, path, params, out)
return out
}
// GetIntuneDeviceCompliance retrieves compliance information for a specific device
// GET /deviceManagement/managedDevices/{id}/deviceCompliancePolicyStates
func (s *azureClient) GetIntuneDeviceCompliance(ctx context.Context, deviceId string, params query.GraphParams) <-chan AzureResult[intune.ComplianceState] {
var (
out = make(chan AzureResult[intune.ComplianceState])
path = fmt.Sprintf("/%s/deviceManagement/managedDevices/%s/deviceCompliancePolicyStates", constants.GraphApiVersion, deviceId)
)
setDefaultParams(¶ms)
go getAzureObjectList[intune.ComplianceState](s.msgraph, ctx, path, params, out)
return out
}
// GetIntuneDeviceConfiguration retrieves configuration information for a specific device
// GET /deviceManagement/managedDevices/{id}/deviceConfigurationStates
func (s *azureClient) GetIntuneDeviceConfiguration(ctx context.Context, deviceId string, params query.GraphParams) <-chan AzureResult[intune.ConfigurationState] {
var (
out = make(chan AzureResult[intune.ConfigurationState])
path = fmt.Sprintf("/%s/deviceManagement/managedDevices/%s/deviceConfigurationStates", constants.GraphApiVersion, deviceId)
)
setDefaultParams(¶ms)
go getAzureObjectList[intune.ConfigurationState](s.msgraph, ctx, path, params, out)
return out
}