-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Antivirus relies on connection close to get ICAP result #6764
Comments
@kobergj Can you provide more context? |
@wkloucek How important is this in regards of Release 3.1.0? |
Not important at all |
This is an issue of the icap lib we are using (https://github.com/egirna/icap-client) It is rather unmaintained (last commit 2020) and we planned to replace it with an alternative. However back then there were no alternatives. I see two fixes for this issue, but both are more a story than a bugfix. A) Find an alternative for the used icap-lib and use this. B) Write an icap lib by ourselves (we only need to implement the features we really need) and use this. |
The used icap Library is very "basic" and unmaintained. See the proposal from @kobergj Does anybody know a better library? |
Don't know if it matters, but the ICAP client in here: https://github.com/egirna/icapeg/tree/master/icap-client seems to have some changes newer than the stuff here: https://github.com/egirna/icap-client. |
Might wrapping a c library be an option? If yes this library is also used by many distributions: https://github.com/c-icap/c-icap-server. It also features a CLI: https://c-icap.sourceforge.net/install.html (which I used to test my ICAP server, for the record |
From my little experience, this should be the last option, if any other option has failed.
Due to these drawbacks, wrappers are usually an extremely thin interface to call C methods in order to reduce the "problematic" surface. Any complexity is managed by creating a class in Go that will use the simple methods of the wrapper to achieve its goal. Note that the user might still need to have installed the icap shared library in his system, which might be another problem. I haven't look into it too much, but there should be an option to compile the library code statically to include the library code into the binary. |
Proposal: Put a timeboxed effort on understanding if the upstream bug is fixable in their code base. |
From what I remember:
should force a connection close after the request. So if you have KeepAliveTimeout > 0 or even -1 you'll get a late / no scan result |
Describe the bug
ICAP supports reusing a connection. When ICAP is not explicitly configured to close the connection (= send FIN) after a scan, the antivirus service hangs.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
The virusscan is finished as soon as the ICAP response is received.
Actual behavior
The virusscan takes as long as the connection is not interrupted, timed out or closed. (= eg. receives FIN). In the case of the wireshark dump below with connection reuse and keepalive it takes until 47 / 300 seconds for the antivirus service to actually use the result from 6 / 0.002026783 seconds.
Wireshark dumps
ICAP with disable connection reuse
ICAP with connection reuse and keepalive
The text was updated successfully, but these errors were encountered: