docker / scout-cli

Docker Scout CLI
https://docker.com/products/docker-scout
Other
250 stars 60 forks source link

docker scout doesn't use proxy settings #91

Closed drenderyga closed 5 months ago

drenderyga commented 5 months ago

Hello everyone!

I'm using proxy to requests to github.com and docker resources on my docker host.

When i'm using docker scout, all requests sending without proxy and gives me the message about login.

docker login working correctly and sending requests through proxy, but docker scout doesn't.

user@host:$ docker scout version
version: v1.3.0 (go1.21.3 - linux/amd64)
git commit: 1934037f9d1cd0875cd2e5817cb19545d446cbf5
user@host:~/.docker$ docker login
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/secadm/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
user@host:~/.docker$ docker scout cves drenderyga/nginx_vuln_test:latest
Log in with your Docker ID or email address to use docker scout.

If you don't have a Docker ID, head over to https://hub.docker.com to
create one. You can log in with your password or a Personal Access Token (PAT)
by running docker login.
Using a limited-scope PAT grants better security and is required for organizations
using SSO. Learn more at https://docs.docker.com/go/access-tokens/

You can also log in using Docker Desktop.

on fw i see requests without proxy

Screenshot 2024-01-29 at 11 30 37
cdupuis commented 5 months ago

@drenderyga thank for raising this. Are you using the Docker Scout CLI on a host that has Docker Desktop installed and a proxy configured?

drenderyga commented 5 months ago

@cdupuis no, it's not Docker desktop host.

docker version
Client: Docker Engine - Community
 Version:           25.0.1
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        29cf629
 Built:             Tue Jan 23 23:09:23 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.1
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       71fa3ab
  Built:            Tue Jan 23 23:09:23 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.27
  GitCommit:        a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc:
  Version:          1.1.11
  GitCommit:        v1.1.11-0-g4bccb38
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

To be clear, on Windows with Docker Desktop, scout working correctly with proxy settings.

cdupuis commented 5 months ago

Thank you, that is helpful.

eunomie commented 5 months ago

Hi @drenderyga How is setup/defined your proxy? When there's no Docker Desktop, we are using the default behaviour from Go, that is to rely on the HTTP_PROXY, HTTPS_PROXY environment variables. So if you define those environment variables that should work. BTW Docker scout CLI is not using the daemon configuration.

drenderyga commented 5 months ago

Hi @eunomie Yes, you are right. If I use export HTTP_PROXY it works. Thank you for your message about daemon configuration, i thought that it's usefull for CLI too.