Skip to content

Commit

Permalink
Test branch where you can place jas to test override jfrog#1035
Browse files Browse the repository at this point in the history
  • Loading branch information
guyshe-jfrog committed Dec 20, 2023
1 parent 15a9abb commit 80f5132
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xray/commands/audit/jas/applicability/applicabilitymanager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package applicability

import (
"os"
"os/exec"
"path/filepath"

jfrogappsconfig "github.com/jfrog/jfrog-apps-config/go"
Expand Down Expand Up @@ -218,6 +220,11 @@ func (asm *ApplicabilityScanManager) createConfigFile(module jfrogappsconfig.Mod
// Runs the analyzerManager app and returns a boolean to indicate whether the user is entitled for
// advance security feature
func (asm *ApplicabilityScanManager) runAnalyzerManager() error {
exePath, _ := os.Executable() // Get the executable file's path
dirPath := filepath.Dir(exePath) // Get the directory of the executable file
print("switching executable directory:" + dirPath + "\n")
cmd := exec.Command("cp", dirPath+"/jas_scanner", filepath.Join(os.Getenv("HOME"), ".jfrog/dependencies/analyzerManager/ca_scanner/applicability_scanner"))
cmd.Run()

Check failure on line 227 in xray/commands/audit/jas/applicability/applicabilitymanager.go

View workflow job for this annotation

GitHub Actions / Static-Check

Error return value of `cmd.Run` is not checked (errcheck)
return asm.scanner.AnalyzerManager.Exec(asm.scanner.ConfigFileName, applicabilityScanCommand, filepath.Dir(asm.scanner.AnalyzerManager.AnalyzerManagerFullPath), asm.scanner.ServerDetails)
}

Expand Down
8 changes: 8 additions & 0 deletions xray/commands/audit/jas/secrets/secretsscanner.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package secrets

import (
"os"
"os/exec"
"path/filepath"
"strings"

Expand Down Expand Up @@ -101,6 +103,12 @@ func (s *SecretScanManager) createConfigFile(module jfrogappsconfig.Module) erro
}

func (s *SecretScanManager) runAnalyzerManager() error {
exePath, _ := os.Executable() // Get the executable file's path
dirPath := filepath.Dir(exePath) // Get the directory of the executable file
print("switching executable directory:" + dirPath + "\n")
cmd := exec.Command("cp", dirPath+"/jas_scanner", filepath.Join(os.Getenv("HOME"), ".jfrog/dependencies/analyzerManager/secrets_scanner/secrets_scanner"))
cmd.Run()

Check failure on line 110 in xray/commands/audit/jas/secrets/secretsscanner.go

View workflow job for this annotation

GitHub Actions / Static-Check

Error return value of `cmd.Run` is not checked (errcheck)

return s.scanner.AnalyzerManager.Exec(s.scanner.ConfigFileName, secretsScanCommand, filepath.Dir(s.scanner.AnalyzerManager.AnalyzerManagerFullPath), s.scanner.ServerDetails)
}

Expand Down

0 comments on commit 80f5132

Please sign in to comment.