Giter Club home page Giter Club logo

clamav-rest's Introduction

Simple ClamAV REST proxy. Builds on top of clamav-java which is a minimal Java client for ClamAV.

Build Status

What is it?

The big picture

This is an example for the deployment. You could omit the log server, it's completely optional.

Deployment example

For more general information, see also our blog post.

The technical details

This is a REST proxy server with support for basic INSTREAM scanning and PING command.

Clamd protocol is explained here: http://linux.die.net/man/8/clamd

Clamd protocol contains command such as shutdown so exposing clamd directly to external services is not a feasible option. Accessing clamd directly is fine if you are running single application and it's on the localhost.

An example to build on

This is is mainly an example, not a serious production ready server. You can customize this for your specific needs. Or rewrite it using something other than Spring Boot if you wish.

Usage

You have two options. You can use Docker and run a Docker image to test it. The Docker image is based on the supplied Dockerfile specification.

Or you can build the JAR. This creates a stand-alone JAR with embedded Jetty serlet container.

  mvn package

Starting the REST service is quite straightforward.

  java -jar clamav-rest-1.0.2.jar --server.port=8765 --clamd.host=myprecious.clamd.serv.er --clamd.port=3310

Setting up local clamd virtual server

By default clamd is assumed to respond in a local virtual machine. Setting it up is explained in ClamAV client repository. Or you can use a clamd Docker image.

Testing the REST service

You can use curl as it's REST. Here's an example test session:

curl localhost:8080
Clamd responding: true

curl -F "name=blabla" -F "file=@./eicar.txt" localhost:8080/scan
Everything ok : false

EICAR is a test file which is recognized as a virus by scanners even though it's not really a virus. Read more EICAR information here.

License

Copyright © 2014 Solita

Distributed under the GNU Lesser General Public License, either version 2.1 of the License, or (at your option) any later version.

clamav-rest's People

Contributors

anttivi-solita avatar lokori avatar tuulik 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.