-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
- Running yubihsm-connector on host:
sudo yubihsm-connector -d --enable-host-header-allowlist --host-header-allowlist localhost,localhost.,127.0.0.1,[::1]],host.docker.internal,host.docker.internal.,172.17.0.1,172.17.0.2,host.docker.internal:12345 -l localhost:12345
- Test on host shows success
curl localhost:12345/connector/status
- Start Docker container
docker pull ubuntu
docker run -it --add-host=host.docker.internal:host-gateway ubuntu bash
- [container] Install curl and check /etc/hosts in container to ensure that we can contact services running on the host
apt-get update && apt-get install curl
cat /etc/hosts
172.17.0.1 host.docker.internal
- [container] Run a test (Tried with IP
172.17.0.1
as well)
root@c29483c2f844:/# curl -i host.docker.internal:12345/connector/status
curl: (7) Failed to connect to host.docker.internal port 12345 after 0 ms: Connection refused
- Check docker container's host headers look ok by quitting yubihsm-connector on the host, starting an http listener on the host and running curl from container again.
GET / HTTP/1.1
Host: host.docker.internal:12345
User-Agent: curl/7.81.0
Accept: */*
HTTP/1.1 200 OK
Docker container can definitely contact the host, but it seems that the yubihsm-connector host header allowlist is not accepting host.docker.internal
if the request comes from a container?
Metadata
Metadata
Assignees
Labels
No labels