Imagine the information security compliance guideline says you need an antivirus but you run Arch Linux

Overview

libredefender

Imagine the information security compliance guideline says you need an antivirus but you run Arch Linux.

Screenshot showing a libredefender status report

libredefender is an antivirus program featuring:

  • Industry standards - Scanning is implemented with libclamav
  • Signatures - We have that
  • Scheduling - Starts scans periodically so you don't have to
  • Checkmarks - Extra green

The process is trying to change both io and processor priority to idle.

clamav-freshclam.service needs to be setup.

Example config

[scan]
excludes = [
    # rust build folders
    "/home/user/repos/**/target",
]
skip_hidden = true
skip_larger_than = "30MiB"

[update]
# use data fetched by clamav-freshclam.service (default)
path = "/var/lib/clamav"

[schedule]
preferred_hours = "09:00:00-19:00:00"

Installation

Packaging status

pacman -S libredefender

License

This code is dual-licensed as GPLv2 OR GPLv3+. libclamav is currently likely to be considered GPLv2-only, so the final binary is going to be GPLv2. If the need for GPLv2 is resolved we're likely going to drop GPLv2 compatibility.

Note that both licenses have a "No warranty" clause.

Comments
  • [Feature] improved scheduling (systemd timers)

    [Feature] improved scheduling (systemd timers)

    Ok, my preliminary suggestion is actually, remove scheduling and let systemd user (the ones in the home directory) configuration files do this instead. Perhaps it can be streamlined by you in some way. Realistically, I'm just thinking I don't need to run it more than once a week. Honestly I probably don't need to run it at all.

    opened by xenoterracide 7
  • [Feature request] Don't scan when running on battery

    [Feature request] Don't scan when running on battery

    As I would like to avoid burning CPU cycles while I'm on the go it would be great of the automatic scan would not run when the machine in on battery power.

    Should be possible to implement using the battery crate.

    opened by tongpu 6
  • Causing

    Causing "desktop" system performance issues

    So I decided to install libre defender over just ClamAV being interested in the goal of being desktop-oriented. Unfortunately, I've found that on my laptop, it starts as soon as I get up (probably a system timer start on resume thing). When it runs, it uses so much CPU (io?) that my system... lags. Not to the point it's frozen, but to where it's obnoxious to use. All 8 cores of my CPU are maxed, and my IO seems to be running high. I checked htop/iotop, and it appears to be nice-ed and ionice-ed properly. So to some extent, it could be argued this is a kernel problem, a Wayland problem, etc. However, no other application causes this problem, not even when I'm doing intensive software development, only when it's doing a scan.

    My first thought on resolving this? let me limit it to one core. I doubt, even if one core is running at max, that it causes my system to be unusable.

    Linux manjaro 5.10.60-1-MANJARO #1 SMP PREEMPT Wed Aug 18 08:02:07 UTC 2021 x86_64 GNU/Linux
    

    NOTE: This is a Thinkpad Carbon X1 Gen 8 (model released 2020), and I upgraded everything to the Max. Generally speaking, performance issues shouldn't be in its vocabulary.

    P.S. Your README shows an example config file, but not where it goes ;).

    opened by xenoterracide 5
  • skip_on_battery not working

    skip_on_battery not working

    I was attempting to work from a coffee shop this morning. After powering on my machine, I noticed that libredefender was attempting to run a scan, killing my battery.

    Laptop: Lenovo Thinkpad P14s (AMD - Cezanne)

    Laptop State prior - Fully Powered off. (Not in standby or hibernate)

    Config:

    [scan]
    excludes = [
        # git repositories
        "/home/brogers/git/**/*",
    ]
    ## by default libredefender spawns one thread per cpu core
    ## set to 1 to use a single thread
    #concurrency = 1
    concurrency = 4
    skip_hidden = false
    #skip_larger_than = "30MiB"
    
    [update]
    ## use data fetched by clamav-freshclam.service (default)
    path = "/var/lib/clamav"
    
    [schedule]
    preferred_hours = "22:00:00-09:00:00"
    ## Do not run scans when on battery
    skip_on_battery = true
    

    I'm unsure if the logs will display anything useful. However, please let me know if log output would be helpful and which log to provide.

    bug 
    opened by th3raid0r 4
  • Add configuration to disable scanning when on battery

    Add configuration to disable scanning when on battery

    This change introduces a new configuration parameter scan_on_battery which makes it possible to skip a scan when running on battery. The default is true, which means that scans will be performed, even when running on battery. If the parameter is set to false the scan will be skipped if any battery is in state Discharging.

    Fixes #27

    opened by tongpu 4
  • Issues opening ClamAV database

    Issues opening ClamAV database

    Hello, I stumbled across this and decided that I'd give it a go, why not, looking for some antivirus stuff for Linux for the hell of it. However, every time I want to do a scan, this occurs.

    [2021-06-03T08:02:37Z INFO  libredefender::scan] Initializing with libclamav 0.103.2
    [2021-06-03T08:02:37Z WARN  libredefender::db] Failed to open existing database, using new one: Failed to open database: No such file or directory (os error 2)
    [2021-06-03T08:02:37Z INFO  libredefender::scan] Empty arguments, defaulting to home directory
    [2021-06-03T08:02:37Z INFO  libredefender::scan] Loading database from /var/lib/clamav...
    [2021-06-03T08:02:45Z INFO  libredefender::scan] Checking database age...
    Error: Failed to open clamav database
    
    Caused by:
        No such file or directory (os error 2)
    [ricochet@gamer ~]$
    
    // However, I already have ClamAV setup and I have ran freshclam before.
    
    // Here is a listing of my files in /var/lib/clamav:
    
    [ricochet@gamer ~]$ cd /var/lib/clamav
    [ricochet@gamer clamav]$ ls
    bytecode.cvd  daily.cvd  main.cvd  mirrors.dat
    opened by RicochetYT 4
  • Add debugging output for battery information

    Add debugging output for battery information

    Up to now we've been blind with regards to the information about batteries present in the system. This change should allow us to ask for debug output in case of problems.

    opened by tongpu 2
  • Turn scheduled scanning off?

    Turn scheduled scanning off?

    Hi there

    Thanks for creating this :)

    I am trying to turn scheduled scanning off and have tried commenting out the schedule section, which didn't seem to work and am now trying with a preferred time of between 9am and 9:10am, to see what that does :)

    Perhaps I need to delete crontab if I have previously enabled a schedule?

    Thanks in advance

    opened by mannp 2
  • Fresh install in Arch Linux with v0.40 cannot open /usr/lib/libclamav.so.9

    Fresh install in Arch Linux with v0.40 cannot open /usr/lib/libclamav.so.9

    libredefender: /usr/lib/libclamav.so.9: no version information available (required by libredefender) libredefender: /usr/lib/libclamav.so.9: no version information available (required by libredefender) ❌ Last scan - ✅ Threats present 0 ❌ Signatures 0 ❌ Signatures updated -

    After running freshclam and starting the freshclam service. Is it a permissions issue? Perhaps this needs to be run as root, is it intended to be run as root? Documentation does not specify.

    opened by mruiz42 1
  • Skip special devices

    Skip special devices

    Only actual files should be opened. Directories are logged but walkdir already traverses them on its own so we're can safely skip them too.

    Resolves #8

    opened by kpcyrd 0
  • Support reading from cvd files too

    Support reading from cvd files too

    Running freshclam for the first time creates cvd files, the next time that file seems to be renamed to cld. This patch reads the database age from the cvd file if no cld file was found.

    Resolves #3

    opened by kpcyrd 0
  • Fails to build on FreeBSD

    Fails to build on FreeBSD

    Hi, i tried compile source code on FreeBSD 13.1 and cargo 1.63.0, rustc 1.63.0 and I have issue with missing libc compile_rust_libredeferender.TXT

         |
    
    error[E0277]: the trait bound `<<D as si::Dimension>::L as std::ops::Neg>::Output: Integer` is not satisfied
       --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:716:18
        |
    716 |               ) -> Quantity<$quantities<$($crate::typenum::Negate<D::$symbol>),+>, U, V>
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Integer` is not implemented for `<<D as si::Dimension>::L as std::ops::Neg>::Output`
        |
       ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
        |
    10  | / system! {
    11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
    12  | |     quantities: ISQ {
    13  | |         length: meter, L;
    ...   |
    55  | |     }
    56  | | }
        | |_- in this macro invocation
        |
    note: required by a bound in `si::Quantity`
       --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:232:16
        |
    230 |           pub struct Quantity<D, U, V>
        |                      -------- required by a bound in this
    231 |           where
    232 |               D: Dimension + ?Sized,
        |                  ^^^^^^^^^ required by this bound in `si::Quantity`
        |
       ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
        |
    10  | / system! {
    11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
    12  | |     quantities: ISQ {
    13  | |         length: meter, L;
    ...   |
    55  | |     }
    56  | | }
        | |_- in this macro invocation
        = note: this error originates in the macro `system` (in Nightly builds, run with -Z macro-backtrace for more info)
    
    error[E0277]: the trait bound `<<D as si::Dimension>::M as std::ops::Neg>::Output: Integer` is not satisfied
       --> code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/system.rs:716:18
        |
    716 |               ) -> Quantity<$quantities<$($crate::typenum::Negate<D::$symbol>),+>, U, V>
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Integer` is not implemented for `<<D as si::Dimension>::M as std::ops::Neg>::Output`
        |
       ::: code/FreeBSD-Ports/libredefender/work/libredefender-0.6.0/cargo-crates/uom-0.21.1/src/si/mod.rs:10:1
        |
    10  | / system! {
    11  | |     /// [International System of Quantities](http://jcgm.bipm.org/vim/en/1.6.html) (ISQ).
    12  | |     quantities: ISQ {
    13  | |         length: meter, L;
    ...   |
    55  | |     }
    56  | | }
    
    
    
    opened by Martinfx 6
  • no supported database files found in clamav folder

    no supported database files found in clamav folder

    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z ERROR libredefender::schedule] Error: Failed to load clamav database: cl_error 8: Can't open file or directory
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::schedule] Sleeping for 0h 0m 0s (2022-03-18 04:18:56 +00:00)...
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::scan] Scanning home directory: "/home/satoshi"
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::scan] Loading database from /var/lib/clamav...
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: LibClamAV Error: cli_loaddbdir: No supported database files found in /var/lib/clamav
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z ERROR libredefender::schedule] Error: Failed to load clamav database: cl_error 8: Can't open file or directory
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::schedule] Sleeping for 0h 0m 0s (2022-03-18 04:18:56 +00:00)...
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::scan] Scanning home directory: "/home/satoshi"
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: [2022-03-18T04:18:56Z INFO  libredefender::scan] Loading database from /var/lib/clamav...
    Mar 18 04:18:56 xiaomi13 libredefender.desktop[16403]: LibClamAV Error: cli_loaddbdir: No supported database files found in /var/lib/clamav
    

    found my journalctl spammed with following errors

    question 
    opened by hitchhooker 4
Releases(v0.6.0)
Owner
Independent security research. Works on backdoor-resistant software distribution. Maintains packages in Arch Linux and Debian. Steals food at conferences.
null
Provides a single TUI-based registry for drm-free, wine and steam games on linux, accessed through a rofi launch menu.

eidolon A conversion of steam_suite to rust with additional features. Provides a single TUI-based registry for drm-free, wine and steam games on linux

Nico Hickman 113 Dec 27, 2022
A utility like pkg-audit for Arch Linux. Based on Arch Security Team data.

arch-audit pkg-audit-like utility for Arch Linux. Based on data from security.archlinux.org collected by the awesome Arch Security Team. Installation

Andrea Scarpino 316 Nov 22, 2022
A utility like pkg-audit for Arch Linux. Based on Arch Security Team data.

arch-audit pkg-audit-like utility for Arch Linux. Based on data from security.archlinux.org collected by the awesome Arch Security Team. Installation

Andrea Scarpino 316 Nov 22, 2022
Arch Linux Security Update Notifications

arch-audit-gtk Show an indicator if there are any security updates missing for your Arch Linux system. Install git clone https://aur.archlinux.org/arc

null 48 Nov 28, 2022
Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs

backseat-signed Authenticate the cryptographic chain-of-custody of Linux distributions (like Arch Linux and Debian) to their source code inputs. This

null 25 Apr 17, 2024
Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code...

tosh Imagine your SSH server only listens on an IPv6 address, and where the last 6 digits are changing every 30 seconds as a TOTP code... Inspired fro

Mark Vainomaa 409 Oct 23, 2022
Rust port of the Terry Davis' (RIP) "god says" program

RIP Terry A. Davis 1969-2018 god says Rust port of the programmer Terry Davis' "god says" (AKA GodSpeaks) program. Terrence Andrew Davis (December 15,

Orhun Parmaksız 54 Dec 26, 2022
Licensebat - 🔐⛵ Effortless dependency compliance with your license policies

Licensebat All docs here are temporary. Thougths For the moment, it seems it makes sense to have all the collectors sharing the same trait. That doesn

Licensebat 19 Dec 28, 2022
Kill processes protected by antivirus during offensive activities.

superman Kill everything. usage Options: -p, --pid <PID> Pid to kill -r Recursive kill process -t, --time <TIME> Kill interv

B1-TEAM 96 Jun 16, 2023
Distrod is a meta-distro for WSL 2 which runs Systemd as init process. You can run Ubuntu, Arch, and et.c with systemd in a minute. Distrod also has built-in auto-start feature on Windows startup and port forwarding abiltiy.

Distrod - WSL2 Distros with Systemd! Distrod is a systemd-based meta-distro for WSL2 that allows you to install Ubuntu, Arch Linux, Gentoo and many ot

Takaya Saeki 1.6k Jan 9, 2023
Tells you how many years you need to wait until your subatomic xeon crystal synchronizer has doubled in plasma inversion efficiency on the Goldberg-Moleman scale or whatever.

about Tells you how many years you need to wait until your subatomic xeon crystal synchronizer has doubled in plasma inversion efficiency on the Goldb

null 2 Dec 3, 2021
Cloup is a template manager that provides the files you desire when you need them, written in Rust.

cloup cloup is a template manager that delivers the files you desire when you need them, written in rust you no longer need to locate your previous pr

Benjamin Akar 62 Dec 5, 2022
Everyday-use client-side map-aware Arch Linux mirror ranking tool

Rate Arch Mirrors This is a tool, which fetches mirrors, skips outdated/syncing Arch Linux mirrors, then uses info about submarine cables and internet

Nikita Almakov 196 Jan 2, 2023
Check the reproducibility status of your Arch Linux packages (read-only mirror)

arch-repro-status A CLI tool for querying the reproducibility status of the Arch Linux packages using data from a rebuilderd instance such as reproduc

Arch Linux 12 Nov 16, 2022
For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

For something between the likes of a toy bootloader or tiny kernel and Arch Linux.

Aarush Gupta 3 Oct 9, 2022
Manage lockfiles in PKGBUILDs for upstreams that don't ship them, `updpkgsums` for dependency trees (Arch Linux tooling)

updlockfiles Manage lockfiles for packages that don't ship any upstream. Like updpkgsums but for 3rd party dependency trees. If you're not actively ma

null 11 Oct 27, 2022
Client for spotify's apt repository in Rust for Arch Linux

spotify-launcher Spotify has a free linux client but prohibits re-distribution, so this is a freely distributable opensource program that manages a sp

null 93 Jun 20, 2023
Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size

Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size (-D_FORTIFY_SOURCE=3 compatibility)

null 3 Sep 9, 2023
Everything you need to know about cross compiling Rust programs!

rust-cross Everything you need to know about cross compiling Rust programs! If you want to set up your Rust toolchain as a cross compiler, you have co

Jorge Aparicio 2.3k Jan 2, 2023
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use • How Does It

null 17 Sep 25, 2022