Giter VIP home page Giter VIP logo

ansible-role-clamav's Introduction

ansible-role-clamav 🦪

GitHub Build Status CodeQL

Installs ClamAV and a related cron job. This allows servers to be quickly queried en mass for any matched signatures. The ClamAV-Report tool can be used to gather scan data from systems using this role.

Requirements

None.

Role Variables

Variable Description Default Required
clamav_clamd_configuration A dictionary of values to set in the clamd configuration file. {} No
clamav_configuration_backup Whether or not to backup configuration files before changing. false No
clamav_cron_frequency The frequency of ClamAV scanning. Must be custom or an ansible.builtin.cron special_time. weekly No
clamav_cron_custom If frequency is set to custom, a dictionary to define the timer. {"day": "*", "job": "/usr/local/share/virus_scan.sh", "minute": "30", "month": "*", "hour": "5", "weekday": "*"} No
clamav_freshclam_configuration A dictionary of values to set in the freshclam configuration file. {} No
clamav_scan_copy Whether to copy infected files to quarantine folder. false No
clamav_scan_exclude_directories A list of regexes matching directory trees that are to be excluded from scan operations. [^/dev, ^/proc, ^/sys, ^/var/spool/clamav] No
clamav_scan_extra_flags Additional flags to pass to clamscan (see clamscan man page for reference). [] No
clamav_scan_move Whether to move infected files to a quarantine directory. false No
clamav_scan_quarantine_directory Directory to store infected files. /var/spool/clamav No
clamav_scan_quarantine_group Group owner to apply to quarantine directory. root No
clamav_scan_quarantine_mode Permissions to apply to quarantine directory. 0750 No
clamav_scan_quarantine_owner Owner to apply to quarantine directory. root No
clamav_seboolean_name The name of the SELinux boolean used to configure whether or not ClamAV is allowed to scan files. Note that this variable is only used when SELinux is enabled. antivirus_can_scan_system No
clamav_seboolean_state The value to use for the SELinux boolean that configures whether or not ClamAV is allowed to scan files. Note that this variable is only used when SELinux is enabled. true No

Example

clamav_freshclam_configuration:
  DatabaseMirror: ['db.local.clamav.net', 'database.clamav.net']
  Bytecode: 'true'
  PrivateMirror:

would change:

  ...
  DatabaseMirror foo.bar.com
  DatabaseMirror bar.baz.com
  PrivateMirror private.mirror.local
  Bytecode false
  ...

to:

  ...
  DatabaseMirror db.local.clamav.net
  DatabaseMirror database.clamav.net
  Bytecode true
  ...

Dependencies

None.

Example Playbook

Here's how to use it in a playbook:

- hosts: all
  become: true
  become_method: sudo
  tasks:
    - name: Install ClamAV and a cron job to run automated AV scans
      ansible.builtin.include_role:
        name: clamav

Cron job output

The log of the last scan is accessible at: /var/log/clamav/lastscan.log

If a detection occurs the file /var/log/clamav/last_detection will be touched. Its modification time represents the time of the last detection.

Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

License

This project is in the worldwide public domain.

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Author Information

Mark Feldhousen, Jr. - [email protected]

ansible-role-clamav's People

Contributors

jsf9k avatar mcdonnnj avatar clementj35 avatar felddy avatar jasonodoom avatar dav3r avatar jmorrowomni avatar dependabot[bot] avatar mjourdan avatar umarizulkifli avatar hillaryj avatar monoflo avatar arcsector avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.