Skip to content

Commit 7d2a0bc

Browse files
committed
Minor detection change
1 parent 7d513bf commit 7d2a0bc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

detection.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ func HandleDetectionAutoConnect(resp http.ResponseWriter, request *http.Request)
601601
ctx := GetContext(request)
602602
workflow, err = ConfigureDetectionWorkflow(ctx, user.ActiveOrg.Id, "TENZIR-SIGMA")
603603
if err != nil {
604-
log.Printf("\n\n\n[ERROR] Failed to create Sigma handling workflow: %s\n\n\n", err)
604+
log.Printf("[ERROR] Failed to create Sigma handling workflow: %s", err)
605605
}
606606

607607
log.Printf("[DEBUG] Sending orborus request to start Sigma handling workflow")
@@ -654,16 +654,17 @@ func HandleDetectionAutoConnect(resp http.ResponseWriter, request *http.Request)
654654
success := true
655655
if len(workflow.ID) == 0 {
656656
success = false
657+
} else {
658+
log.Printf("[INFO] '%s' detection workflow in org '%s' ID: %s", detectionType, workflow.OrgId, workflow.ID)
657659
}
658660

659-
log.Printf("[INFO] '%s' detection workflow in org '%s' ID: %s", detectionType, workflow.OrgId, workflow.ID)
660-
661661
resp.WriteHeader(200)
662662
resp.Write([]byte(fmt.Sprintf(`{"success": %v, "workflow_id": "%s", "workflow_valid": %v}`, success, workflow.ID, workflow.Validation.Valid)))
663663
}
664664

665665
func SetDetectionOrborusRequest(ctx context.Context, orgId, execType, fileName, executionSource, environmentName string) error {
666666
if len(orgId) == 0 {
667+
log.Printf("[ERROR] No org ID provided for Orborus")
667668
return fmt.Errorf("No org ID provided")
668669
}
669670

@@ -707,7 +708,7 @@ func SetDetectionOrborusRequest(ctx context.Context, orgId, execType, fileName,
707708

708709
if len(selectedEnvironments) == 0 {
709710
if lakeNodes > 0 {
710-
//log.Printf("[ERROR] No environments needing a lake. Found lake nodes: %d", lakeNodes)
711+
log.Printf("[ERROR] No environments needing a lake. Found lake nodes: %d", lakeNodes)
711712
return nil
712713
} else {
713714
return fmt.Errorf("No valid environments found")
@@ -779,8 +780,9 @@ func HandleListDetectionCategories(resp http.ResponseWriter, request *http.Reque
779780
resp.Write(data)
780781
}
781782

783+
// FIXME: This is not ready - just a starting point
782784
func ConfigureDetectionWorkflow(ctx context.Context, orgId, workflowType string) (Workflow, error) {
783-
log.Printf("\n\n[DEBUG] Creating detection workflow for org %s (not implemented)\n\n", orgId)
785+
log.Printf("[ERROR] Creating detection workflow for org %s (not implemented for all types). Type: %s", orgId, workflowType)
784786
/*
785787
// FIXME: Use Org to find the correct tools according to the Usecase
786788
// SHOULD map usecase from workflowType -> actual Usecase in blobs
@@ -835,6 +837,9 @@ func ConfigureDetectionWorkflow(ctx context.Context, orgId, workflowType string)
835837
usecaseNames := []string{}
836838
if workflowType == "TENZIR-SIGMA" {
837839
log.Printf("[INFO] Creating SIEM handling workflow for org %s", orgId)
840+
841+
// FIXME: Add a cloud workflow id here
842+
838843
} else if workflowType == "EMAIL-DETECTION" {
839844
// How do we check what email tool they use?
840845
//log.Printf("[INFO] Creating email handling workflow for org %s", orgId)

0 commit comments

Comments
 (0)