Skip to content

Commit 0375a33

Browse files
refactor: replace e.logger with dbLogger in bounty engine logging statements
1 parent f20f14b commit 0375a33

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

internal/orchestrator/bounty_engine.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
17991799
// Check context status before each scan
18001800
select {
18011801
case <-ctx.Done():
1802-
e.logger.Errorw(" CRITICAL: Context cancelled before Nuclei scan",
1802+
dbLogger.Errorw(" CRITICAL: Context cancelled before Nuclei scan",
18031803
"error", ctx.Err(),
18041804
"target", asset.Asset.Value,
18051805
"progress", progress,
@@ -1812,7 +1812,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
18121812
default:
18131813
if deadline, ok := ctx.Deadline(); ok {
18141814
remaining := time.Until(deadline)
1815-
e.logger.Debugw(" Context valid before Nuclei scan",
1815+
dbLogger.Debugw(" Context valid before Nuclei scan",
18161816
"target", asset.Asset.Value,
18171817
"remaining_time", remaining.String(),
18181818
"component", "nuclei_scanner",
@@ -1825,7 +1825,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
18251825
scanDuration := time.Since(scanStart)
18261826

18271827
if err != nil {
1828-
e.logger.Errorw(" Nuclei scan failed",
1828+
dbLogger.Errorw(" Nuclei scan failed",
18291829
"error", err,
18301830
"target", asset.Asset.Value,
18311831
"scan_duration", scanDuration.String(),
@@ -1835,7 +1835,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
18351835

18361836
// Check if error was due to context cancellation
18371837
if ctx.Err() != nil {
1838-
e.logger.Errorw(" Nuclei scan failed due to context cancellation",
1838+
dbLogger.Errorw(" Nuclei scan failed due to context cancellation",
18391839
"context_error", ctx.Err(),
18401840
"scan_error", err,
18411841
"target", asset.Asset.Value,
@@ -1848,7 +1848,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
18481848
// Convert results to findings
18491849
findings = append(findings, results...)
18501850

1851-
e.logger.Infow(" Nuclei scan completed",
1851+
dbLogger.Infow(" Nuclei scan completed",
18521852
"target", asset.Asset.Value,
18531853
"findings", len(results),
18541854
"scan_duration", scanDuration.String(),
@@ -1868,7 +1868,7 @@ func (e *BugBountyEngine) runNucleiScans(ctx context.Context, assets []*AssetPri
18681868
avgScanTime = fmt.Sprintf("%.2fs", phase.Duration.Seconds()/float64(totalAssets))
18691869
}
18701870

1871-
e.logger.Infow(" Nuclei scanning phase completed",
1871+
dbLogger.Infow(" Nuclei scanning phase completed",
18721872
"total_findings", len(findings),
18731873
"phase_duration", phase.Duration.String(),
18741874
"targets_scanned", totalAssets,
@@ -1995,7 +1995,7 @@ func (e *BugBountyEngine) runIDORTests(ctx context.Context, assets []*AssetPrior
19951995
StartTime: time.Now(),
19961996
}
19971997

1998-
e.logger.Infow("Running IDOR vulnerability tests")
1998+
dbLogger.Infow("Running IDOR vulnerability tests")
19991999

20002000
var findings []types.Finding
20012001

@@ -2010,22 +2010,22 @@ func (e *BugBountyEngine) runIDORTests(ctx context.Context, assets []*AssetPrior
20102010
}
20112011

20122012
if len(idorEndpoints) == 0 {
2013-
e.logger.Infow("No IDOR candidates found", "component", "idor_scanner")
2013+
dbLogger.Infow("No IDOR candidates found", "component", "idor_scanner")
20142014
phase.EndTime = time.Now()
20152015
phase.Duration = phase.EndTime.Sub(phase.StartTime)
20162016
phase.Status = "completed"
20172017
phase.Findings = 0
20182018
return findings, phase
20192019
}
20202020

2021-
e.logger.Infow("IDOR candidates identified",
2021+
dbLogger.Infow("IDOR candidates identified",
20222022
"count", len(idorEndpoints),
20232023
"component", "idor_scanner",
20242024
)
20252025

20262026
// Run IDOR scans
20272027
for _, endpoint := range idorEndpoints {
2028-
e.logger.Debugw("Testing IDOR endpoint",
2028+
dbLogger.Debugw("Testing IDOR endpoint",
20292029
"endpoint", endpoint,
20302030
"component", "idor_scanner",
20312031
)
@@ -2035,7 +2035,7 @@ func (e *BugBountyEngine) runIDORTests(ctx context.Context, assets []*AssetPrior
20352035
tokens := []string{} // TODO: Extract from credential manager or user input
20362036
jobStatus, err := e.pythonWorkers.ScanIDORSync(ctx, endpoint, tokens, 1, 100)
20372037
if err != nil {
2038-
e.logger.Errorw("IDOR scan failed",
2038+
dbLogger.Errorw("IDOR scan failed",
20392039
"error", err,
20402040
"endpoint", endpoint,
20412041
"component", "idor_scanner",
@@ -2048,7 +2048,7 @@ func (e *BugBountyEngine) runIDORTests(ctx context.Context, assets []*AssetPrior
20482048
idorFindings := convertPythonIDORToFindings(jobStatus.Result, endpoint)
20492049
findings = append(findings, idorFindings...)
20502050

2051-
e.logger.Infow("IDOR scan completed",
2051+
dbLogger.Infow("IDOR scan completed",
20522052
"endpoint", endpoint,
20532053
"findings", len(idorFindings),
20542054
"component", "idor_scanner",
@@ -2061,7 +2061,7 @@ func (e *BugBountyEngine) runIDORTests(ctx context.Context, assets []*AssetPrior
20612061
phase.Status = "completed"
20622062
phase.Findings = len(findings)
20632063

2064-
e.logger.Infow("IDOR testing completed",
2064+
dbLogger.Infow("IDOR testing completed",
20652065
"findings", len(findings),
20662066
"duration", phase.Duration,
20672067
"endpoints_tested", len(idorEndpoints),

0 commit comments

Comments
 (0)