3 Commits

Author SHA1 Message Date
Morten Olsen
6969f13fa7 multiarch build 2025-12-25 21:07:25 +01:00
Morten Olsen
7c014b9898 set defaults in docker instead of scanner 2025-12-13 08:21:40 +01:00
Morten Olsen
707f0dcaad fix: missing nuclei path 2025-12-13 08:19:34 +01:00
3 changed files with 15 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -60,6 +60,7 @@ USER 65532:65532
# Environment variables for nuclei
ENV NUCLEI_TEMPLATES_PATH=/nuclei-templates
ENV NUCLEI_BINARY_PATH=/usr/local/bin/nuclei
ENV HOME=/home/nonroot
ENTRYPOINT ["/manager"]

View File

@@ -122,13 +122,23 @@ func (s *NucleiScanner) Scan(ctx context.Context, targets []string, options Scan
logger.Info("Targets file created", "targetsFile", targetsFile, "targetCount", len(targets))
// Check if nuclei binary exists and is executable
// First try the exact path
if _, err := os.Stat(s.nucleiBinaryPath); os.IsNotExist(err) {
return nil, fmt.Errorf("nuclei binary not found at %s", s.nucleiBinaryPath)
// If not found at exact path, try to find it in PATH
if path, err := exec.LookPath(s.nucleiBinaryPath); err == nil {
logger.Info("Found nuclei binary in PATH", "path", path, "originalPath", s.nucleiBinaryPath)
s.nucleiBinaryPath = path
} else {
return nil, fmt.Errorf("nuclei binary not found at %s and not in PATH: %w", s.nucleiBinaryPath, err)
}
}
// Verify nuclei is executable
// Verify nuclei is executable by running version command
if err := exec.Command(s.nucleiBinaryPath, "-version").Run(); err != nil {
logger.Error(err, "Failed to execute nuclei -version, nuclei may not be properly installed")
logger.Error(err, "Failed to execute nuclei -version, nuclei may not be properly installed", "path", s.nucleiBinaryPath)
// Don't fail here, just log - the actual scan will fail if nuclei is truly broken
} else {
logger.Info("Nuclei binary verified", "path", s.nucleiBinaryPath)
}
// Check templates availability if templates path is set