clamav icon indicating copy to clipboard operation
clamav copied to clipboard

clamav_milter only resolves clamd remote host IPs on startup, not on re-connection

Open f1-outsourcing opened this issue 1 year ago • 6 comments
trafficstars

If the clamd is getting a new ip address (after failover or so) clamav-milter does not update to the new ip address

clamav-lib-1.0.5-3.el9.x86_64 clamav-filesystem-1.0.5-3.el9.noarch clamav-milter-1.0.5-3.el9.x86_64

f1-outsourcing avatar Aug 16 '24 19:08 f1-outsourcing

Can you please provide more details of your deployment and the steps taken to reproduce this issue.

tj-cisco avatar Sep 09 '24 19:09 tj-cisco

run clamav-milter on host a, run clamd on host b, now restart host b so it gets a new ip address. The clamav-milter on host a does not update to the new host b ip address.

f1-outsourcing avatar Sep 12 '24 19:09 f1-outsourcing

Ok I think we have found the reason here, the name is only resolved when the milter is started here:

https://github.com/Cisco-Talos/clamav/blob/main/clamav-milter/connpool.c#L110

We should move resolution to the nc_socket function so that it is resolved every time a connection is made: https://github.com/Cisco-Talos/clamav/blob/main/clamav-milter/netcode.c#L82

tj-cisco avatar Sep 12 '24 19:09 tj-cisco

Oh cool, nice this can be fixed :)

f1-outsourcing avatar Sep 12 '24 20:09 f1-outsourcing

Shit everything was down again. I am not really sure why this clamd container is getting OOM recently. How long does this type of fix normally take before it finds it's way into el9 repo's?

f1-outsourcing avatar Oct 01 '24 07:10 f1-outsourcing

I guess this solution also would detect multiple ip addresses?

f1-outsourcing avatar Oct 01 '24 10:10 f1-outsourcing