Giter Club home page Giter Club logo

phpantimalware-cron's Introduction

phpantimalware-cron

CONTENT BELOW IS STILL BEING EDITED... MAY HAVE INAPPLICABLE INFORMATION DUE TO SOURCE FORKED FROM

Overview:

This is an easy to configure bash script, for those who want to schedule definition updates, scanning, and e-mail a report upon any detection via the local MTA.

Licensing:

This is free software licensed under the GPLv3 and is based on the original script by Stefano Stagnaro.

You can find the original script here:

https://code.google.com/p/clamav-cron/

Functions performed (in order):

  1. Run a PHP-Antimalware-scan (PHP-Antimalware-Scanner).
  2. Send a brief report upon virus detection via e-mail (sendmail).

The configuration file for the scheduled task will contain scanning options for each path. You will need to customize this file to fit your server's layout.

Dependencies:

PHP-Antimalware-Scanner (doesn't need to be installed system-wide, just put the correct path to the script in the config).

A mail server (sendmail) required for sending mail reports.

------------------------ NOTHING BELOW THIS HAS BEEN EDITED YET AND WILL NOT APPLY

Installation and configuration:

Option 1. Use the setup scripts for the intial install

Requires: ClamAV daemon (clamd)

Supported Installations

Debian/Ubuntu quick setup (debian-setup.sh)

mkdir -p /opt/clamav-cron
cd /opt/clamav-cron
wget https://raw.githubusercontent.com/yangwithinyin/clamav-cron/master/debian/debian-setup.sh
chmod 755 debian-setup.sh

FreeBSD quick setup (freebsd-setup.sh)

mkdir -p /opt/clamav-cron
cd /opt/clamav-cron
wget https://raw.githubusercontent.com/yangwithinyin/clamav-cron/master/freebsd/freebsd-setup.sh
chmod 755 freebsd-setup.sh

Option 2. Download and copy clamav-cron.sh to /usr/local/bin/

cd ~
wget https://raw.githubusercontent.com/yangwithinyin/clamav-cron/master/clamav-cron.sh
cp ~/clamav-cron.sh /usr/local/bin/clamav-cron.sh

Setup the permissions and ownership

chmod 755 /usr/local/bin/clamav-cron.sh
chown clamav:clamav /usr/local/bin/clamav-cron.sh
chown clamav:clamav /var/log/clamav

Update clamav-cron "User configuration"

Open /usr/local/bin/clamav-cron.sh in your favorite editor

#============================================#
#        User configuration section          #
#============================================#

# Log file name and its path:
CV_LOGFILE="/var/log/clamav/clamav-cron.log" 

# Notification e-mail sender (will work when invalid):
CV_MAILFROM="[email protected]" 

# Notification e-mail recipient (must be valid):
CV_MAILTO="[email protected]" 

# Notification e-mail secondary recipients (must be valid):
CV_MAILTO_CC="[email protected]" 

# Notification e-mail subject:
CV_SUBJECT="Your Company - ClamAV scan report" 

Schedule clamav-cron.sh via crontab.

crontab -e 
45 23 * * 5 /usr/local/bin/clamav-cron.sh /

Crontab details

Cron will run clamav-cron every Friday at 23:45 (11:45 pm) to recursively scan the whole / tree.

At the end of task it will send a notification e-mail upon virus detection to the users specified at step 3.

For more information about crontab see the manual (e.g. man 5 crontab).

phpantimalware-cron's People

Contributors

mjpcomp avatar

Stargazers

 avatar

Watchers

 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.