Mailing List Archive

[clamav-users] Docker Connection Refused on Host
Hi,

I have setup clamav using the docker container available on Docker Hub. Clamd is running with in the container and the socket path is mounted, however when I attempt to run `clamdtop` on the host computer I receive a connection refused response.




_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
Hi there,

On Fri, 8 Oct 2021, Taylor Schley via clamav-users wrote:

> I have setup clamav using the docker container available on Docker
> Hub. Clamd is running with in the container and the socket path is
> mounted, however when I attempt to run `clamdtop` on the host
> computer I receive a connection refused response.

The most likely explanation is that clamdtop is trying to connect to a
socket or port to which clamd is not connected.

Please tell us exactly what socket or port clamd is using.

Please show the exact command that you are using to run clamdtop, and
the complete response.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
ClamD setup in the docker container is:
`/run/clamav/clamd.socket`

Which is bound to `/tmp/clamd.socket` on the host MacOS.

The following works from inside of the container:
`clamdtop ‘/run/clamav/clamd.socket’`

The following does not work on the host MacOS.
`clamdtop ‘/tmp/clamd.socket’`
Producing this result:
Connecting to: /tmp/clamd.socket
connect: Connection refused
Abnormal program termination: Unable to connect to all clamds in void setup_connections(int, char **) at line 1456

I have already checked permissions and both the docker container and the host user have access to `/tmp/clamd.socket`

> Hi there,
>
> On Fri, 8 Oct 2021, Taylor Schley via clamav-users wrote:
>
>> I have setup clamav using the docker container available on Docker
>> Hub. Clamd is running with in the container and the socket path is
>> mounted, however when I attempt to run `clamdtop` on the host
>> computer I receive a connection refused response.
>
> The most likely explanation is that clamdtop is trying to connect to a
> socket or port to which clamd is not connected.
>
> Please tell us exactly what socket or port clamd is using.
>
> Please show the exact command that you are using to run clamdtop, and
> the complete response.
>
> --
>
> 73,
> Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
Hi there,

On Sun, 10 Oct 2021, Taylor Schley via clamav-users wrote:
>> On Fri, 8 Oct 2021, Taylor Schley via clamav-users wrote:
>>
>>> I have setup clamav using the docker container available on Docker
>>> Hub. Clamd is running with in the container and the socket path is
>>> mounted, however when I attempt to run `clamdtop` on the host
>>> computer I receive a connection refused response.
>>
>> The most likely explanation is that clamdtop is trying to connect to a
>> socket or port to which clamd is not connected.
>>
>> Please tell us exactly what socket or port clamd is using.
>>
>> Please show the exact command that you are using to run clamdtop, and
>> the complete response.
>
> ClamD setup in the docker container is:
> `/run/clamav/clamd.socket`
>
> Which is bound to `/tmp/clamd.socket` on the host MacOS.
>
> The following works from inside of the container:
> `clamdtop ‘/run/clamav/clamd.socket’`
>
> The following does not work on the host MacOS.
> `clamdtop ‘/tmp/clamd.socket’`
> Producing this result:
> Connecting to: /tmp/clamd.socket
> connect: Connection refused
> Abnormal program termination: Unable to connect to all clamds in void setup_connections(int, char **) at line 1456
>
> I have already checked permissions and both the docker container and the host user have access to `/tmp/clamd.socket`

What happens if you use netcat or similar to send PING from the host
MacOS to the clamd socket in /tmp/? See 'man clamd' for the PING
command and the expected response.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
Here is the response:

2021/10/10 12:14:57 socat[38274] E connect(5, LEN=19 AF=1 "/tmp/clamd.socket", 19): Connection refused


> On Oct 10, 2021, at 11:35 AM, G.W. Haywood via clamav-users <clamav-users@lists.clamav.net> wrote:
>
> Hi there,
>
> On Sun, 10 Oct 2021, Taylor Schley via clamav-users wrote:
>>> On Fri, 8 Oct 2021, Taylor Schley via clamav-users wrote:
>>>
>>>> I have setup clamav using the docker container available on Docker
>>>> Hub. Clamd is running with in the container and the socket path is
>>>> mounted, however when I attempt to run `clamdtop` on the host
>>>> computer I receive a connection refused response.
>>>
>>> The most likely explanation is that clamdtop is trying to connect to a
>>> socket or port to which clamd is not connected.
>>>
>>> Please tell us exactly what socket or port clamd is using.
>>>
>>> Please show the exact command that you are using to run clamdtop, and
>>> the complete response.
>> ClamD setup in the docker container is:
>> `/run/clamav/clamd.socket`
>>
>> Which is bound to `/tmp/clamd.socket` on the host MacOS.
>>
>> The following works from inside of the container:
>> `clamdtop ‘/run/clamav/clamd.socket’`
>>
>> The following does not work on the host MacOS.
>> `clamdtop ‘/tmp/clamd.socket’`
>> Producing this result:
>> Connecting to: /tmp/clamd.socket
>> connect: Connection refused
>> Abnormal program termination: Unable to connect to all clamds in void setup_connections(int, char **) at line 1456
>>
>> I have already checked permissions and both the docker container and the host user have access to `/tmp/clamd.socket`
>
> What happens if you use netcat or similar to send PING from the host
> MacOS to the clamd socket in /tmp/? See 'man clamd' for the PING
> command and the expected response.
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
Hi there,

On Sun, 10 Oct 2021, Taylor Schley via clamav-users wrote:
>> On Oct 10, 2021, at 11:35 AM, G.W. Haywood via clamav-users <clamav-users@lists.clamav.net> wrote:
>> On Sun, 10 Oct 2021, Taylor Schley via clamav-users wrote:
>>>> On Fri, 8 Oct 2021, Taylor Schley via clamav-users wrote:
>>>>
>>>>> I have setup clamav using the docker container available on Docker
>>>>> Hub. Clamd is running with in the container and the socket path is
>>>>> mounted, however when I attempt to run `clamdtop` on the host
>>>>> computer I receive a connection refused response.
>>>>
>>>> The most likely explanation is that clamdtop is trying to connect to a
>>>> socket or port to which clamd is not connected.
>>>>
>>>> Please tell us exactly what socket or port clamd is using.
>>>>
>>>> Please show the exact command that you are using to run clamdtop, and
>>>> the complete response.
>>> ClamD setup in the docker container is:
>>> `/run/clamav/clamd.socket`
>>>
>>> Which is bound to `/tmp/clamd.socket` on the host MacOS.
>>>
>>> The following works from inside of the container:
>>> `clamdtop ‘/run/clamav/clamd.socket’`
>>>
>>> The following does not work on the host MacOS.
>>> `clamdtop ‘/tmp/clamd.socket’`
>>> Producing this result:
>>> Connecting to: /tmp/clamd.socket
>>> connect: Connection refused
>>> Abnormal program termination: Unable to connect to all clamds in void setup_connections(int, char **) at line 1456
>>>
>>> I have already checked permissions and both the docker container and the host user have access to `/tmp/clamd.socket`
>>
>> What happens if you use netcat or similar to send PING from the host
>> MacOS to the clamd socket in /tmp/? See 'man clamd' for the PING
>> command and the expected response.
>
> 2021/10/10 12:14:57 socat[38274] E connect(5, LEN=19 AF=1 "/tmp/clamd.socket", 19): Connection refused

What does that tell you?

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Docker Connection Refused on Host [ In reply to ]
On Sun, 10 Oct 2021, Taylor Schley via clamav-users wrote:

> ClamD setup in the docker container is:
> `/run/clamav/clamd.socket`
>
> Which is bound to `/tmp/clamd.socket` on the host MacOS.
>
> The following works from inside of the container:
> `clamdtop ‘/run/clamav/clamd.socket’`
>
> The following does not work on the host MacOS.
> `clamdtop ‘/tmp/clamd.socket’`
> Producing this result:
> Connecting to: /tmp/clamd.socket
> connect: Connection refused
> Abnormal program termination: Unable to connect to all clamds in void setup_connections(int, char **) at line 1456

I would imagine that a socket inside the container bound to one outside
was intended to allow a process inside to talk to a listener outside,
but not to allow a process outside to talk to a listener inside.
I would expect a listener running in the container to use a TCP socket
for outside processes to access it.

But then, I know little about docker or any other container system.

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml