Skip to content

vahabov007/FileScan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📂 FileScan: Asynchronous Malware Scanner

FileScan is a robust Spring Boot backend service designed to enhance application security by scanning all uploaded files for viruses and malware before they are stored or processed by your system. It leverages the power of ClamAV, the industry-standard open-source antivirus engine, for highly effective file inspection.


📌 Features

  • Upload & Scan: Provides a secure REST API endpoint to accept file uploads and initiate the scanning process.
  • Asynchronous Scanning: Integrates with ClamAV to perform non-blocking, asynchronous file scans.
  • Quarantine: Automatically blocks or quarantines infected files to prevent system contamination.
  • Configurable: Easily configure the connection details for both PostgreSQL and the ClamAV daemon.
  • Auditing: Logs all scan results to the database for security tracking and auditing purposes.

🛠️ Technologies Used

Technology Role
Java 17+ Core programming language
Spring Boot 3.x Backend framework
ClamAV Antivirus and malware scanning engine
Spring Data JPA (Hibernate) ORM for database interaction
PostgreSQL Primary database for storing logs and metadata
Maven Dependency management and build tool

🧠 How It Works

The service acts as a security gateway for file uploads:

  1. A user uploads a file via the dedicated REST API endpoint.
  2. The FileScan service connects to the ClamAV daemon over TCP (default port: 3310).
  3. The file stream is passed to ClamAV and is scanned asynchronously.
  4. If the file is clean (CLEAN): It is stored in the configured location (database or file system, depending on implementation detail).
  5. If the file is infected (FOUND): The file is immediately blocked and a record of the infection is logged.

🚀 Getting Started

Prerequisites

Before you run the service, you must have the following running and accessible:

  1. Java 17+
  2. PostgreSQL database server
  3. ClamAV Daemon (clamd)

💻 Setting Up ClamAV

It is crucial that the ClamAV daemon is running and accessible to the Spring Boot service.

For Linux (Ubuntu/Debian)

# Update and install ClamAV and the daemon
sudo apt update
sudo apt install clamav clamav-daemon -y

# Stop the updater service
sudo systemctl stop clamav-freshclam

# Manually update the virus database (can take a few minutes)
sudo freshclam

# Start the ClamAV daemon
sudo systemctl start clamav-daemon

# Check the status
sudo systemctl status clamav-daemon

About

FileScan is a Spring Boot backend service that scans uploaded files for viruses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages