Crates.io | leguichet |
lib.rs | leguichet |
version | 0.1.9 |
source | src |
created_at | 2019-07-13 17:18:37.531618 |
updated_at | 2020-06-28 16:26:34.04448 |
description | One way diodes with antiviral and yara scanning |
homepage | https://gitlab.com/r3dlight/leguichet |
repository | https://gitlab.com/r3dlight/leguichet |
max_upload_size | |
id | 148819 |
size | 139,418 |
Le-Guichet is a decontamination station prototype aka "white station" written in Rust, fast, secure and multithreaded.
Untrusted files are deposited (via rsync over ssh) in the entry window (in) and automatically scanned by an antivirus server (clamav-daemon API). If a file is considered unhealthy, it is logged/hashed and immediately deleted. Files considered as healthy are also logged and hashed (sha256) but sent (with associated hashes) to the transit window through an unidirectional software diode (named pipe) where they are logged and hashed again. A static analysis is made on files using libyara and a report is generated if one rule or more matched. Finally, files in transit are transfered to the output window through another software diode.
Memory-safe
Thread-safe
No unsafe code
Mode 2 seccomp (x86_64 and aarch64 supported)
Tested with cargo audit & Clippy
Daemons are all running with unprivileged users
Systemd protections per daemon:
Note: LeGuichet has been tested with Grsecurity kernel patch. It just requires MPROTECT to be disabled on ELF binaries.
Download the latest build artefact and unzip it (see the picture below)
Install required dependencies
apt-get install clamav-daemon clamav-freshclam pkg-config libyara3 git bash acl adduser
Update your freshclam database
Add the following to /etc/clamav/clamd.conf and restart the daemon :
Install (tested on Debian or Debian based like Ubuntu)
sudo make install
Note: You might want to modify LeGuichet's default parameters according to your needs, by editing the following files:
sudo vi /etc/default/leguichet-in
sudo vi /etc/default/leguichet-transit
sudo vi /etc/default/leguichet-out
Then install the following dependencies (Debian Buster):
apt-get install clamav-daemon clamav-freshclam pkg-config libyara3 libyara-dev git bash clang-7 libclang-common-7-dev libclang-7-dev libclang-dev libclang1-7 liblzma-dev liblzma5 llvm-dev libllvm7 llvm
TCPSocket 3310
TCPAddr 127.0.0.1
Clone the repo:
git clone --depth=1 https://gitlab.com/r3dlight/leguichet.git
make help
make audit
make build
sudo make install
You might want to create new users belonging to the group "leguichet-in" to be able to deposit files into /home/in/, for exemple:
sudo adduser --home /home/in --gid [LEGUICHET-IN_GID] user-in
(where LEGUICHET-IN_GID is the ID of the group leguichet-in)
You also need to create new users belonging to group leguichet-out to be able to retrieve files from /home/out/
sudo adduser --home /home/out --gid [LEGUICHET-OUT_GID] user-out
(where LEGUICHET-OUT_GID is the ID of the group leguichet-out)
In order to avoid leguichet-in daemon to be running under root privileges, we take advantage of the rsync binary:
To send a directory into /home/in , use rsync over ssh with --chmod=ug=rwx option :
rsync -r -e ssh --chmod=ug=rwx /path/MyFolder user-in@IP-in:
To send a file :
rsync -e ssh --chmod=ug=rwx /path/MyFile.docx user-in@IP-in:
To send every files in a directory:
rsync -r -e ssh --chmod=ug=rwx /path/MyFolder/ user-in@IP-in:
user-out can simply login with ssh to get the files back.
To uninstall Le-Guichet:
sudo make uninstall