Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oscap-docker crash when cve scanning #2130

Closed
53845714nF opened this issue Jun 25, 2024 · 0 comments · Fixed by #2172
Closed

oscap-docker crash when cve scanning #2130

53845714nF opened this issue Jun 25, 2024 · 0 comments · Fixed by #2172

Comments

@53845714nF
Copy link

53845714nF commented Jun 25, 2024

Description of Problem:

I use oscap-docker on Debian 12 with the following command:

sudo oscap-docker image-cve ghcr.io/53845714nf/marketminder/frontend --report report.html

And get an error (in Actual Results), it looks similar to #1943

OpenSCAP Version:

SCAP Version: 1.3
XCCDF Version: 1.2
OVAL Version: 5.11.1
CPE Version: 2.3
CVSS Version: 2.0
CVE Version: 2.0
Asset Identification Version: 1.1
Asset Reporting Format Version: 1.1
CVRF Version: 1.1
SCE Version: 1.0 (from libopenscap_sce.so.25)

Operating System & Version:

Debian 12.5
Docker version 27.0.1, build 7fafd33

Steps to Reproduce:

  1. Run sudo oscap-docker image-cve ghcr.io/53845714nf/marketminder/frontend --report report.html

Actual Results:

Failed to import "Atomic.mount.DockerMount". It seems Atomic has not been installed.
Using native Docker API
Running given image in a temporary container ...
Cannot run image ghcr.io/53845714nf/marketminder/frontend:latest, registry:5000/frontend:latest.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 268, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.46/containers/create?name=tmp_oscap_13865512-3344-11ef-999e-507b9d00eda5

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/oscap-docker", line 111, in <module>
    ODS = OscapDockerScan(args.scan_target, args.is_image, args.oscap_binary)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/oscap_docker_python/oscap_docker_util_noatomic.py", line 78, in __init__
    raise e
  File "/usr/lib/python3/dist-packages/oscap_docker_python/oscap_docker_util_noatomic.py", line 66, in __init__
    tmp_cont = self.client.create_container(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 428, in create_container
    return self.create_container_from_config(config, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 439, in create_container_from_config
    return self._result(res, True)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 274, in _result
    self._raise_for_status(response)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 270, in _raise_for_status
    raise create_api_error_from_http_exception(e)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.46/containers/create?name=tmp_oscap_13865512-3344-11ef-999e-507b9d00eda5: Bad Request ("invalid reference format")
!!! WARNING !!! This software has crashed, so you should check that no temporary container is still running

Expected Results:

Get a report.html with CVE from my Image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant