Skip to content

Commit

Permalink
log missing azure tenant ids during analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadaj committed Oct 20, 2023
1 parent fbec5ee commit 6c0f51e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
7 changes: 7 additions & 0 deletions cmd/api/src/daemons/datapipe/agi.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ func ParallelTagAzureTierZero(ctx context.Context, db graph.Database) error {
readerWG = &sync.WaitGroup{}
)

// log missing tenant IDs for easier debugging
for _, tenant := range tenants {
if _, err = tenant.Properties.Get(azure.TenantID.String()).String(); err != nil {
log.Errorf("Error getting tenant id for tenant %d: %v", tenant.ID, err)
}
}

readerWG.Add(1)

go func() {
Expand Down
18 changes: 9 additions & 9 deletions cmd/api/src/daemons/datapipe/analysis.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Copyright 2023 Specter Ops, Inc.
//
//
// Licensed under the Apache License, Version 2.0
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
// SPDX-License-Identifier: Apache-2.0

package datapipe
Expand All @@ -20,19 +20,19 @@ import (
"context"
"fmt"

"github.com/specterops/bloodhound/analysis"
adAnalysis "github.com/specterops/bloodhound/analysis/ad"
"github.com/specterops/bloodhound/dawgs/graph"
"github.com/specterops/bloodhound/errors"
"github.com/specterops/bloodhound/src/analysis/ad"
"github.com/specterops/bloodhound/src/analysis/azure"
"github.com/specterops/bloodhound/src/config"
"github.com/specterops/bloodhound/src/database"
"github.com/specterops/bloodhound/src/services/agi"
"github.com/specterops/bloodhound/src/services/dataquality"
"github.com/specterops/bloodhound/analysis"
adAnalysis "github.com/specterops/bloodhound/analysis/ad"
"github.com/specterops/bloodhound/dawgs/graph"
"github.com/specterops/bloodhound/errors"
)

func RunAnalysisOperations(ctx context.Context, db database.Database, graphDB graph.Database, cfg config.Configuration) error {
func RunAnalysisOperations(ctx context.Context, db database.Database, graphDB graph.Database, _ config.Configuration) error {
var (
collector = &errors.ErrorCollector{}
)
Expand Down

0 comments on commit 6c0f51e

Please sign in to comment.