egirna / icapeg

Open Source ICAP server
Apache License 2.0
40 stars 36 forks source link

Go ICAP Server

ICAPeg Server.

Contributions welcome Apache License, Version 2.0

ICAPeg

Open Source multi-vendor ICAP server

Scan files requested via a proxy server using ICAPeg ICAP server, ICAPeg is an ICAP server connecting web proxies with API-based scanning services and more soon. ICAPeg currently supports VirusTotal, Cloudmersive & Clamav for scanning the files following the ICAP protocol. If you don't know about the ICAP protocol, here is a bit about it:

What is ICAP?

ICAP stands for Internet Content Adaptation Protocol. If a content (for example: file) you've requested over the internet to download or whatever, needs adaptation(some kind of modification or analysis), the proxy server sends the content to the ICAP server for adaptation and after performing the required tasks on the content, the ICAP server sends it back to the proxy server so that it may return the adapted content to the destination. This can occur both during request and response.

To know more about the ICAP protocol, check this out.

Table of Contents

Prerequisites

Before starting to play with ICAPeg, make sure you have the following things in your machine:

  1. Golang(latest enough to be able to use go mod)

    You should install at least go version 1.16.

    You can get how to install Golang from here.

  2. A proxy server

​ You should configure a Proxy server with ICAPeg, you can get an example from here.

  1. Clone the ICAPeg repository

    $ git clone https://github.com/egirna/icapeg.git
  2. Run the project with the default configuration in config.toml file

    1. Run the following command in the directory where you've installed ICAPeg
$ cd ~/ICAPeg
  1. Build ICAPeg binary
$ go build .
  1. Finally execute the file like you would for any other executable according to your OS, for Unix-based users though
$ ./icapeg

You should see something like, ICAP server is running on localhost:1344 .... This tells you the ICAP server is up and running.

Configuration

​ You can change the default configuration file whatever you want to customize the application.

Adding a new vendor to ICAPeg

Developer Guide

How to Setup Existed Services

Testing

Things to keep in mind

  1. You will have to restart the ICAP server each time you change anything in the config file.

  2. You will have to restart squid whenever you restart the ICAP.

  3. You need to configure your network(or your browser)'s proxy settings to go through squid.

More on ICAPeg

  1. Remote ICAP Servers & Shadowing

  2. Logging

  3. Monitoring ICAPeg logs with ELK

Contributing

This project is still a WIP. So you can contribute as well. See the contributions guide here.

License

ICAPeg is licensed under the Apache License 2.0.