kubescape / kubevuln

Kubevuln is an in-cluster component of the Kubescape security platform. It scans container images for vulnerabilities, using Grype as its engine.
Apache License 2.0
18 stars 19 forks source link

[question] can't load config file using `CONFIG` env #129

Open anubhav06 opened 1 year ago

anubhav06 commented 1 year ago

Description

As mentioned in the README, we can load config file using the CONFIG env. However, we are unable to load config file path using the CONFIG environment variable. Kubevuln always defaults to searching the config file in the /etc/config path, even when we define a new path in the CONFIG env.

In order to run kubevuln:

If we follow any of the above 2 steps, then I am able to run it locally

Environment

OS: Ubuntu 20.04.4 LTS

Steps To Reproduce

Method 1:

  1. Build kubevuln using make
  2. Load config file using the CONFIG environment variable export CONFIG=path/to/clusterData.json

Method 2:

  1. Build the Docker image from the Dockerfile and run it using: docker run <kubevuln-built-image-name> -e CONFIG=path/to/clusterData.json

Additional Context

Is this an expected behavior or am I missing something?

0xt3j4s commented 1 year ago
dwertent commented 1 year ago

Thank you for raising this issue. You can either manually edit the path here or contribute a fix :)

0xt3j4s commented 1 year ago

@dwertent For a fix, what path should it be looking for?

siddhikhapare commented 1 year ago

@anubhav06 @dwertent Please review my PR. Please suggest any improvements. Thank You.

matthyx commented 1 year ago

@anubhav06 why do you want to relocate the config, is it specific to your cluster? Maybe we can just drop the documentation instead...

anubhav06 commented 1 year ago

@matthyx The problem was that LoadConfig was unable to load config file path set by the CONFIG environment variable.

However, as david mentioned, we are able to run it by manually editing the path and then running it.

You can either manually edit the path here

So I believe if we just remove/update the documentation, that works.