Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

The Dockle component of the scanning tool is broken using ubuntu latest #146

Open
iamahern opened this issue Jul 4, 2022 · 6 comments
Open
Labels
idle Inactive for 14 days need-to-triage Requires investigation

Comments

@iamahern
Copy link

iamahern commented Jul 4, 2022

There is an upstream issue in the Dockle CLI where it is utilizing the XDG_RUNTIME_DIR variable to determine the docker host settings. See:
goodwithtech/dockle#188

I was able to work around the issue by setting:

env:
  # See https://github.com/goodwithtech/dockle/issues/188
  DOCKLE_HOST: "unix:///var/run/docker.sock"

This is breaking Azure Container Scan for images that are not pushed to container registries on the current ubuntu-latest runner.

@iamahern iamahern added the need-to-triage Requires investigation label Jul 4, 2022
@ThadRasmussen
Copy link

Thanks for raising this issue and providing a workaround. This issue resulted in being unable so scan a locally build docker image and gave the errors:

Scanning for CIS and best practice violations...
Error: FATAL	unable to initialize a image struct: failed to initialize source: unable to retrieve auth token: invalid username/password: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information.
Error: An error occurred while scanning the container image for best practice violations

Adding the work-around resolved the issue! 💯

tjololo added a commit to Altinn/altinn-studio that referenced this issue Jul 14, 2022
lorang92 pushed a commit to Altinn/altinn-studio that referenced this issue Jul 14, 2022
* fix for containerscan

Workaround for goodwithtech/dockle#188
Source: Azure/container-scan#146

* remove path filter to test designer scan

will revert this when tested ok

* test container scan with repositories instead

* revert changes made to run workflow
@grzesuav
Copy link

hi, I think it is resolved in dockle 0.3.0, so ultimate fix would be to update that dependency goodwithtech/dockle#72 (comment) if I am not mistaken

@loganmarchione
Copy link

I was under the impression from this code that it tries to get the latest then falls back to an older version.

https://github.com/Azure/container-scan/blob/master/src/dockleHelper.ts#L190-L202

I think this is where those two versions are defined.

https://github.com/Azure/container-scan/blob/master/src/dockleHelper.ts#L17-L18

@github-actions
Copy link

This issue is idle because it has been open for 14 days with no activity.

@github-actions github-actions bot added the idle Inactive for 14 days label Jul 28, 2022
sakai135 added a commit to sakai135/wsl-vpnkit that referenced this issue Jul 29, 2022
sakai135 added a commit to sakai135/wsl-vpnkit that referenced this issue Jul 29, 2022
* update docker images to alpine 3.16

* add workaround for Azure/container-scan#146
sakai135 added a commit to sakai135/wsl-vpnkit that referenced this issue Jul 30, 2022
sakai135 added a commit to sakai135/wsl-vpnkit that referenced this issue Jul 30, 2022
* update to alpine 3.16.1

* add workaround for Azure/container-scan#146
@KEINOS
Copy link

KEINOS commented Aug 19, 2022

As of 2022/08/20, this problem is still occurring. Currently, @iamahern's solution is the only workaround.

  • The error msg.
Scanning for CIS and best practice violations...
Error: FATAL	unable to initialize a image struct: failed to initialize source: reading manifest latest in docker.io/keinos/vscode-dev-container-go-test: errors:
Error: An error occurred while scanning the container image for best practice violations
  • The fix.
  name: Azure Scan

  on:
    workflow_dispatch:
    pull_request:
      branches: [main]

  jobs:
    analysis:
      runs-on: ubuntu-latest

      steps:
        - name: Checkout repository
          uses: actions/checkout@v3

        - name: Build Docker image
          run: docker build -t test:local .

        - name: Run Dockle and Trivy
          uses: Azure/container-scan@v0
          with:
            image-name: test:local
            severity-threshold: CRITICAL
+ env:
+  # See:
+  #   https://github.com/goodwithtech/dockle/issues/188
+  #   https://github.com/Azure/container-scan/issues/146
+  DOCKLE_HOST: "unix:///var/run/docker.sock"

@github-actions github-actions bot removed the idle Inactive for 14 days label Aug 19, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

This issue is idle because it has been open for 14 days with no activity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
idle Inactive for 14 days need-to-triage Requires investigation
Projects
None yet
Development

No branches or pull requests

5 participants