Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package datapipe
package analysis

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package datapipe
package analysis

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//go:build integration

package datapipe
package analysis

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package datapipe
package analysis

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions cmd/api/src/api/v2/assetgrouptags.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ import (
"github.com/gofrs/uuid"
"github.com/gorilla/mux"
"github.com/lib/pq"
"github.com/specterops/bloodhound/cmd/api/src/analysis"
"github.com/specterops/bloodhound/cmd/api/src/api"
"github.com/specterops/bloodhound/cmd/api/src/auth"
"github.com/specterops/bloodhound/cmd/api/src/ctx"
"github.com/specterops/bloodhound/cmd/api/src/daemons/datapipe"
"github.com/specterops/bloodhound/cmd/api/src/database"
"github.com/specterops/bloodhound/cmd/api/src/database/types/null"
"github.com/specterops/bloodhound/cmd/api/src/model"
Expand Down Expand Up @@ -1033,7 +1033,7 @@ func (s *Resources) PreviewSelectors(response http.ResponseWriter, request *http
} else if expansion, err := validateAssetGroupExpansionMethodWithFallback(body.Expansion); err != nil {
api.WriteErrorResponse(request.Context(), api.BuildErrorResponse(http.StatusBadRequest, err.Error(), request), response)
} else {
nodes := datapipe.FetchNodesFromSeeds(request.Context(), s.Graph, body.Seeds, expansion, limit)
nodes := analysis.FetchNodesFromSeeds(request.Context(), s.Graph, body.Seeds, expansion, limit)
for _, node := range nodes {
if node.Node != nil {
members = append(members, nodeToAssetGroupMember(node.Node, excludeProperties))
Expand Down
7 changes: 4 additions & 3 deletions cmd/api/src/daemons/datapipe/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"log/slog"

"github.com/specterops/bloodhound/cmd/api/src/analysis"
"github.com/specterops/bloodhound/cmd/api/src/config"
"github.com/specterops/bloodhound/cmd/api/src/daemons/changelog"
"github.com/specterops/bloodhound/cmd/api/src/database"
Expand Down Expand Up @@ -236,10 +237,10 @@ func (s *BHCEPipeline) Analyze(ctx context.Context) error {
return fmt.Errorf("update last analysis start time: %v", err)
}

if err := RunAnalysisOperations(ctx, s.db, s.graphdb, s.cfg); err != nil {
if errors.Is(err, ErrAnalysisFailed) {
if err := analysis.RunAnalysisOperations(ctx, s.db, s.graphdb, s.cfg); err != nil {
if errors.Is(err, analysis.ErrAnalysisFailed) {
s.jobService.FailAnalyzedIngestJobs()
} else if errors.Is(err, ErrAnalysisPartiallyCompleted) {
} else if errors.Is(err, analysis.ErrAnalysisPartiallyCompleted) {
s.jobService.PartialCompleteIngestJobs()
}
return fmt.Errorf("analysis failure: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions packages/go/analysis/ad/esc3.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ func isStartCertTemplateValidESC3(template *graph.Node) bool {
}
return false
}

if schemaVersion == 1 {
return true
}

if schemaVersion > 1 {
authorizedSignatures, err := template.Properties.Get(ad.AuthorizedSignatures.String()).Float64()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions packages/go/graphify/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import (
"strings"
"time"

"github.com/specterops/bloodhound/cmd/api/src/analysis"
"github.com/specterops/bloodhound/cmd/api/src/auth"
"github.com/specterops/bloodhound/cmd/api/src/config"
"github.com/specterops/bloodhound/cmd/api/src/daemons/datapipe"
"github.com/specterops/bloodhound/cmd/api/src/database"
"github.com/specterops/bloodhound/cmd/api/src/migrations"
"github.com/specterops/bloodhound/cmd/api/src/model"
Expand Down Expand Up @@ -189,7 +189,7 @@ func (s *CommunityGraphService) Ingest(ctx context.Context, batch *graphify.Inge
}

func (s *CommunityGraphService) RunAnalysis(ctx context.Context, graphDB graph.Database) error {
return datapipe.RunAnalysisOperations(ctx, s.db, graphDB, config.Configuration{})
return analysis.RunAnalysisOperations(ctx, s.db, graphDB, config.Configuration{})
}

// Run generate command
Expand Down