File Watchtower Documentation
Getting Started with File Watchtower
File Watchtower is a lightweight file integrity monitoring tool designed to help you detect and respond to unauthorized file system changes.
Prerequisites
- Python 3
- Write access to the installation directory
- Email server (for notifications)
Installation
- Clone or download the project files:
git clone https://github.com/your-username/file-watchtower.git
- Place the project files in a writable directory, outside the directories being watched:
mv file-watchtower /opt/
cd /opt/file-watchtower
-
Configure your settings in
settings.py
-
Create your watch list in
watch_list.txt
Configuration
Watch List Format
The watch list file (watch_list.txt
) supports two formats:
- Single File Monitoring:
/var/www/html/config.php
- Directory Monitoring:
/path/to/directory, include_subdirs, excluded_extensions, max_file_size
Example:
/var/www/html/wordpress/wp-content/themes, true, .css|.woff|.ttf, 1048576
Initial Setup
Run the initial scan to create baseline records:
python3 watchtower.py --silent-scan
Automated Monitoring
Set up a cron job for routine scanning:
* * * * * python3 /opt/file_watchtower/watchtower.py --routine_scan
* * * * * python3 /opt/file_watchtower/watchtower.py --process-email-queue
Command Line Options
--routine_scan
: Run normal monitoring scan--silent-scan
: Create baseline records without alerts--process-email-queue
: Send pending email alerts--export-db
: Export records to CSV--reset
: Clear the database--version
: Show version information