Skip to content
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

Add custom Database URL to freshclam #22

Open
Extarys opened this issue Sep 12, 2022 · 6 comments
Open

Add custom Database URL to freshclam #22

Extarys opened this issue Sep 12, 2022 · 6 comments
Labels

Comments

@Extarys
Copy link

Extarys commented Sep 12, 2022

Summary

Every time the container starts, the freshclam.conf is overwritten.

Steps to reproduce

Modify the freshclam config file
Restart the container

What is the expected correct behavior?

The freshclam file shouldn't change if not needed.

Relevant logs and/or screenshots

Possible fixes

It would be nice to have a FRESHCLAM_DATABASES variable that allow a comma separated list of URLS to add to the freshclam conf file, or detect if any variable have changed and update only those in the config file.

@Extarys Extarys added the bug label Sep 12, 2022
@tiredofit
Copy link
Owner

Can I have an example freshclam.conf file on how you envision this could work? I could easily build this in.

@Extarys
Copy link
Author

Extarys commented Sep 12, 2022

Hey, quick reply, you're awesome 😎

In docker-compose or podman-compose:

environment:
  - FRESHCLAM_DATABASES=http://www.rfxn.com/downloads/rfxn.ndb,http://www.rfxn.com/downloads/rfxn.hdb,http://www.rfxn.com/downloads/rfxn.yara,http://sigs.mailborder.com/hackingteam.hsb,https://mirror.rollernet.us/sanesecurity/rogue.hdb,https://mirror.rollernet.us/sanesecurity/foxhole_filename.cdb,https://mirror.rollernet.us/sanesecurity/foxhole_generic.cdb

(Not sure if compose will require some quotes around that because of the slashes and all but...)

At the end of the freshclam.conf file, the script would append the following lines:

DatabaseCustomURL http://www.rfxn.com/downloads/rfxn.ndb
DatabaseCustomURL http://www.rfxn.com/downloads/rfxn.hdb
DatabaseCustomURL http://www.rfxn.com/downloads/rfxn.yara
DatabaseCustomURL http://sigs.mailborder.com/hackingteam.hsb
DatabaseCustomURL https://mirror.rollernet.us/sanesecurity/rogue.hdb
DatabaseCustomURL https://mirror.rollernet.us/sanesecurity/foxhole_filename.cdb
DatabaseCustomURL https://mirror.rollernet.us/sanesecurity/foxhole_generic.cdb

@tiredofit
Copy link
Owner

OK! This seems very straight forward, thank you. I just added this functionality to 2.5.0 - Can you let me know if this works as intended?

@Extarys
Copy link
Author

Extarys commented Sep 13, 2022

That was quick! I should try to learn git again, but last time I tried I broke a repo hahaha

It appears to work-ish. For some reason there is no new line after each insertion:

DatabaseCustomURL http://www.rfxn.com/downloads/rfxn.ndbDatabaseCustomURL h...

Relevant docker-compose:

  clamav:
    image: tiredofit/clamav:latest
    container_name: clamav
    volumes:
      - /containers/clamav/data:/data:Z
      - /containers/clamav/logs:/logs:Z
    environment:
      - CONTAINER_NAME=clamav
      - DEFINITIONS_UPDATE_FREQUENCY=60
      - MAX_FILE_SIZE=25M
      - PCRE_MAX_FILE_SIZE=25M
      - STREAM_MAX_LENGTH=25M
      - MAX_THREADS=2
      - FRESHCLAM_DATABASES=http://www.rfxn.com/downloads/rfxn.ndb,http://www.rfxn.com/downloads/rfxn.hdb,http://www.rfxn.com/downloads/rfxn.yara,http://sigs.mailborder.com/hackingteam.hsb,https://mirror.rollernet.us/sanesecurity/rogue.hdb,https://mirror.rollernet.us/sanesecurity/foxhole_filename.cdb,https://mirror.rollernet.us/sanesecurity/foxhole_generic.cdb
    #ports:
    #  - "3310:3310"
    restart: always

Line: https://github.com/tiredofit/docker-clamav/blob/master/install/etc/cont-init.d/10-clamd#L189

@tiredofit
Copy link
Owner

Ack my bad. 2.5.1 or latest will solve :)

@Extarys
Copy link
Author

Extarys commented Sep 13, 2022

The file itself didn't change. I made sure to use the 2.5.1 release.

The default databases themselves are still being downloaded. I also tried stopping the container, delete de config folder and relaunch the container.

I have no clue why the linebreak isn't getting inserted :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants