horusec: Horusec is not reading my config-file.json

What happened: I am running Horusec in a pipeline using Docker. I have a Python script that receives the desired parameters and configurations, runs the scan, and shows the results. Two weeks ago it was working fine, but I ran it again yesterday and some issues appeared. First, it returned an error saying “open: /tmp is a directory”. I just create a new branch and without any change in the code, the scanner started to work but currently, it is not taking my config-file.json

How to reproduce it (as minimally and precisely as possible): This is how I am building the command structure in my Python code:

def GetStartHorusecCMD(imageName, reportName, outputFormat, configFilePath):  
    command =("docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/src "+imageName+
            ":latest horusec start -p /src -P $(pwd) --config-file-path "+configFilePath+" -o "+outputFormat)  
    if outputFormat != 'text':
            command = command + " -O /src/Horusec/"+ reportName
   return command 

And the variables that I am passing in my pipeline (running in an Ubuntu environment in GitHub) are:

imageName: "horuszup/horusec-cli" 
reportName: "Horusec-21-10-07"
outputFormat: 'json'
configFilePath: '/src/Horusec/horusec-config.json'

Anything else we need to know?: This is my project structure: image

Configurations showed using the --log-level=debug flag: image

Environment:

  • Horusec version (use horusec version): We are downloading the latest version from Docker
  • Operating System: Ubuntu-latest (GitHub pipeline environment)
  • Network plugin / Tool and version (if this is a network-related / tool bug): N/A
  • Others:

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (13 by maintainers)

Commits related to this issue

Most upvoted comments

This is great!! I’m still confusing why this error is happening. Here is where we set the default log file path, I don’t understand why in this scenario only os.TempDir() is used. But I think that its better to not fail the analysis if we get error on creating the log file anyway. I’will open a new issue to discover this bug.

Thank you very much for your help and patience, we really appreciate it.

We will release this patch very soon, on the next days.