Skip to content

Commit

Permalink
Merge pull request #73 from BloodHoundAD/BED-4262--az-panic-recovery
Browse files Browse the repository at this point in the history
Bed 4262  az panic recovery
  • Loading branch information
urangel authored Mar 21, 2024
2 parents 937a90a + 6c5e745 commit 6889fa8
Show file tree
Hide file tree
Showing 85 changed files with 291 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/app_role_assignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
4 changes: 4 additions & 0 deletions client/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/enums"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/automation_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/container_registries.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
3 changes: 3 additions & 0 deletions client/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/function_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
4 changes: 4 additions & 0 deletions client/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/enums"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/keyvaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/logic_apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/managed_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
3 changes: 3 additions & 0 deletions client/management_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/resource_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
4 changes: 4 additions & 0 deletions client/role_assignments.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
3 changes: 3 additions & 0 deletions client/service_principals.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
3 changes: 3 additions & 0 deletions client/storage_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/tenants.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/constants"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
2 changes: 2 additions & 0 deletions client/virtual_machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/bloodhoundad/azurehound/v2/client/query"
"github.com/bloodhoundad/azurehound/v2/client/rest"
"github.com/bloodhoundad/azurehound/v2/models/azure"
"github.com/bloodhoundad/azurehound/v2/panicrecovery"
"github.com/bloodhoundad/azurehound/v2/pipeline"
)

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

go func() {
defer panicrecovery.PanicRecovery()
defer close(out)

var (
Expand Down
Loading

0 comments on commit 6889fa8

Please sign in to comment.