Skip to content

Commit 6889fa8

Browse files
authored
Merge pull request #73 from BloodHoundAD/BED-4262--az-panic-recovery
Bed 4262 az panic recovery
2 parents 937a90a + 6c5e745 commit 6889fa8

File tree

85 files changed

+291
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+291
-1
lines changed

client/app_role_assignments.go

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/bloodhoundad/azurehound/v2/client/rest"
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/models/azure"
30+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3031
"github.com/bloodhoundad/azurehound/v2/pipeline"
3132
)
3233

@@ -56,6 +57,7 @@ func (s *azureClient) ListAzureADAppRoleAssignments(ctx context.Context, service
5657
out := make(chan azure.AppRoleAssignmentResult)
5758

5859
go func() {
60+
defer panicrecovery.PanicRecovery()
5961
defer close(out)
6062

6163
var (

client/apps.go

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/enums"
3030
"github.com/bloodhoundad/azurehound/v2/models/azure"
31+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3132
"github.com/bloodhoundad/azurehound/v2/pipeline"
3233
)
3334

@@ -105,6 +106,7 @@ func (s *azureClient) ListAzureADApps(ctx context.Context, filter, search, order
105106
out := make(chan azure.ApplicationResult)
106107

107108
go func() {
109+
defer panicrecovery.PanicRecovery()
108110
defer close(out)
109111

110112
var (
@@ -169,6 +171,7 @@ func (s *azureClient) ListAzureADAppOwners(ctx context.Context, objectId string,
169171
out := make(chan azure.AppOwnerResult)
170172

171173
go func() {
174+
defer panicrecovery.PanicRecovery()
172175
defer close(out)
173176

174177
var (
@@ -239,6 +242,7 @@ func (s *azureClient) ListAzureADAppMemberObjects(ctx context.Context, objectId
239242
out := make(chan azure.MemberObjectResult)
240243

241244
go func() {
245+
defer panicrecovery.PanicRecovery()
242246
defer close(out)
243247

244248
var (

client/automation_accounts.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureAutomationAccounts(ctx context.Context, subscript
6566
out := make(chan azure.AutomationAccountResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/container_registries.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureContainerRegistries(ctx context.Context, subscrip
6566
out := make(chan azure.ContainerRegistryResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/devices.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/bloodhoundad/azurehound/v2/client/rest"
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/models/azure"
30+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3031
"github.com/bloodhoundad/azurehound/v2/pipeline"
3132
)
3233

@@ -86,6 +87,7 @@ func (s *azureClient) ListAzureDevices(ctx context.Context, filter, search, orde
8687
out := make(chan azure.DeviceResult)
8788

8889
go func() {
90+
defer panicrecovery.PanicRecovery()
8991
defer close(out)
9092

9193
var (
@@ -150,6 +152,7 @@ func (s *azureClient) ListAzureDeviceRegisteredOwners(ctx context.Context, objec
150152
out := make(chan azure.DeviceRegisteredOwnerResult)
151153

152154
go func() {
155+
defer panicrecovery.PanicRecovery()
153156
defer close(out)
154157

155158
var (

client/function_apps.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureFunctionApps(ctx context.Context, subscriptionId
6566
out := make(chan azure.FunctionAppResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/groups.go

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/enums"
3030
"github.com/bloodhoundad/azurehound/v2/models/azure"
31+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3132
"github.com/bloodhoundad/azurehound/v2/pipeline"
3233
)
3334

@@ -102,6 +103,7 @@ func (s *azureClient) ListAzureADGroups(ctx context.Context, filter, search, ord
102103
out := make(chan azure.GroupResult)
103104

104105
go func() {
106+
defer panicrecovery.PanicRecovery()
105107
defer close(out)
106108

107109
var (
@@ -166,6 +168,7 @@ func (s *azureClient) ListAzureADGroupOwners(ctx context.Context, objectId strin
166168
out := make(chan azure.GroupOwnerResult)
167169

168170
go func() {
171+
defer panicrecovery.PanicRecovery()
169172
defer close(out)
170173

171174
var (
@@ -236,6 +239,7 @@ func (s *azureClient) ListAzureADGroupMembers(ctx context.Context, objectId stri
236239
out := make(chan azure.MemberObjectResult)
237240

238241
go func() {
242+
defer panicrecovery.PanicRecovery()
239243
defer close(out)
240244

241245
var (

client/keyvaults.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureKeyVaults(ctx context.Context, subscriptionId str
6566
out := make(chan azure.KeyVaultResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/logic_apps.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureLogicApps(ctx context.Context, subscriptionId str
6566
out := make(chan azure.LogicAppResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/managed_clusters.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureManagedClusters(ctx context.Context, subscription
6566
out := make(chan azure.ManagedClusterResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/management_groups.go

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -82,6 +83,7 @@ func (s *azureClient) ListAzureManagementGroups(ctx context.Context) <-chan azur
8283
out := make(chan azure.ManagementGroupResult)
8384

8485
go func() {
86+
defer panicrecovery.PanicRecovery()
8587
defer close(out)
8688

8789
var (
@@ -146,6 +148,7 @@ func (s *azureClient) ListAzureManagementGroupDescendants(ctx context.Context, g
146148
out := make(chan azure.DescendantInfoResult)
147149

148150
go func() {
151+
defer panicrecovery.PanicRecovery()
149152
defer close(out)
150153

151154
var (

client/resource_groups.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureResourceGroups(ctx context.Context, subscriptionI
6566
out := make(chan azure.ResourceGroupResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/role_assignments.go

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/bloodhoundad/azurehound/v2/client/rest"
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/models/azure"
30+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3031
"github.com/bloodhoundad/azurehound/v2/pipeline"
3132
)
3233

@@ -71,6 +72,7 @@ func (s *azureClient) ListAzureADRoleAssignments(ctx context.Context, filter, se
7172
out := make(chan azure.UnifiedRoleAssignmentResult)
7273

7374
go func() {
75+
defer panicrecovery.PanicRecovery()
7476
defer close(out)
7577

7678
var (
@@ -153,6 +155,7 @@ func (s *azureClient) ListRoleAssignmentsForResource(ctx context.Context, resour
153155
out := make(chan azure.RoleAssignmentResult)
154156

155157
go func() {
158+
defer panicrecovery.PanicRecovery()
156159
defer close(out)
157160

158161
var (
@@ -240,6 +243,7 @@ func (s *azureClient) ListResourceRoleAssignments(ctx context.Context, subscript
240243
out := make(chan azure.RoleAssignmentResult)
241244

242245
go func() {
246+
defer panicrecovery.PanicRecovery()
243247
defer close(out)
244248

245249
var (

client/roles.go

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/constants"
2828
"github.com/bloodhoundad/azurehound/v2/models/azure"
29+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2930
"github.com/bloodhoundad/azurehound/v2/pipeline"
3031
)
3132

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureADRoles(ctx context.Context, filter, expand strin
6566
out := make(chan azure.RoleResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/service_principals.go

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/bloodhoundad/azurehound/v2/client/rest"
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/models/azure"
30+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3031
"github.com/bloodhoundad/azurehound/v2/pipeline"
3132
)
3233

@@ -86,6 +87,7 @@ func (s *azureClient) ListAzureADServicePrincipals(ctx context.Context, filter,
8687
out := make(chan azure.ServicePrincipalResult)
8788

8889
go func() {
90+
defer panicrecovery.PanicRecovery()
8991
defer close(out)
9092

9193
var (
@@ -150,6 +152,7 @@ func (s *azureClient) ListAzureADServicePrincipalOwners(ctx context.Context, obj
150152
out := make(chan azure.ServicePrincipalOwnerResult)
151153

152154
go func() {
155+
defer panicrecovery.PanicRecovery()
153156
defer close(out)
154157

155158
var (

client/storage_accounts.go

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -64,6 +65,7 @@ func (s *azureClient) ListAzureStorageAccounts(ctx context.Context, subscription
6465
out := make(chan azure.StorageAccountResult)
6566

6667
go func() {
68+
defer panicrecovery.PanicRecovery()
6769
defer close(out)
6870

6971
var (
@@ -169,6 +171,7 @@ func (s *azureClient) ListAzureStorageContainers(ctx context.Context, subscripti
169171
out := make(chan azure.StorageContainerResult)
170172

171173
go func() {
174+
defer panicrecovery.PanicRecovery()
172175
defer close(out)
173176

174177
var (

client/subscriptions.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureSubscriptions(ctx context.Context) <-chan azure.S
6566
out := make(chan azure.SubscriptionResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/tenants.go

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/constants"
2828
"github.com/bloodhoundad/azurehound/v2/models/azure"
29+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2930
"github.com/bloodhoundad/azurehound/v2/pipeline"
3031
)
3132

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureADTenants(ctx context.Context, includeAllTenantCa
6566
out := make(chan azure.TenantResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

client/users.go

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/bloodhoundad/azurehound/v2/client/rest"
2828
"github.com/bloodhoundad/azurehound/v2/constants"
2929
"github.com/bloodhoundad/azurehound/v2/models/azure"
30+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
3031
"github.com/bloodhoundad/azurehound/v2/pipeline"
3132
)
3233

@@ -71,6 +72,7 @@ func (s *azureClient) ListAzureADUsers(ctx context.Context, filter string, searc
7172
out := make(chan azure.UserResult)
7273

7374
go func() {
75+
defer panicrecovery.PanicRecovery()
7476
defer close(out)
7577

7678
var (

client/virtual_machines.go

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/bloodhoundad/azurehound/v2/client/query"
2626
"github.com/bloodhoundad/azurehound/v2/client/rest"
2727
"github.com/bloodhoundad/azurehound/v2/models/azure"
28+
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
2829
"github.com/bloodhoundad/azurehound/v2/pipeline"
2930
)
3031

@@ -65,6 +66,7 @@ func (s *azureClient) ListAzureVirtualMachines(ctx context.Context, subscription
6566
out := make(chan azure.VirtualMachineResult)
6667

6768
go func() {
69+
defer panicrecovery.PanicRecovery()
6870
defer close(out)
6971

7072
var (

0 commit comments

Comments
 (0)