Skip to main content

DevShield for Linux

An installable Python CLI package is included. The Python distribution is devshield-scanner; the command is devshield. See INSTALL.md for isolated installation under /opt/devshield. devshield --version displays the CLI version.

Version 0.1.1 enables ClamAV scan-limit alerts and marks zero-data scans, missing summaries and logged warnings/errors as incomplete coverage (exit 2), even when ClamAV returns 0. Limit alerts are not proof of malware. Optional --max-filesize-mb and --max-scansize-mb override engine limits in MB. Increasing limits can increase memory, CPU and runtime; engine hard limits still apply. A positive data count alone does not prove every archive entry was inspected.

Read-only host and Docker filesystem malware scanning using the locally installed ClamAV signature engine. Requires Linux, Python 3.8+, clamscan, updated ClamAV databases, and the Docker CLI for container scanning. Run on the Docker host with a local Unix socket context. Root access normally provides the required file/socket access.

On Debian/Ubuntu, install prerequisites using your normal package-management policy:

sudo apt-get update
sudo apt-get install python3 clamav clamav-freshclam

Ensure the ClamAV databases have downloaded before scanning. Use your distribution's freshclam service, or sudo freshclam if that service is not already managing updates. The scanner does not install software, change services, or update databases automatically. Docker must already be installed if you use it.

Copy this folder onto the server, then run:

sudo python3 devshield_linux.py

Console messages identify each stage and show a heartbeat every 10 seconds during long scans. Verbose file-level progress is saved to each stage's log; inspect a log with tail -f /path/printed/by/script.log. JSON results are checkpointed after every completed scan and on interruption, under /var/log/devshield/<run>/report.json.

# Check a small directory first
sudo python3 devshield_linux.py --host-root /srv/project --skip-docker

# Containers and volumes only
sudo python3 devshield_linux.py --skip-host

# Use a scratch disk with room for the largest container filesystem export
sudo python3 devshield_linux.py --temp-dir /mnt/scratch --heartbeat 5

Host scanning starts at / and traverses mounted filesystems, including potentially slow network mounts. /proc, /sys, /dev, /run, raw default Docker/containerd storage, the report directory and scratch directory are excluded. No symlinks are followed. Custom Docker storage may be scanned twice. Logs can be large and contain private file paths; keep them private.

For each running container the script uses docker export, scans the resulting TAR as an archive, then deletes only its own temporary export. It does not execute programs inside containers, extract archives, stop containers or change their files. It separately scans bind-mount sources and discovered Docker volumes, including unused volumes. Remote daemons are rejected. Volume plugins/network-backed volumes may need separate mounting and scanning. If using a local socket proxy to a remote daemon, do not use this script: mount paths must refer to this machine.

Stopped containers, unused image layers, RAM, kernel state and rootkits are not covered. ClamAV's configured/default size, archive and recursion limits still apply, including to large container TAR exports; a successful scan can miss content past those limits. Review ClamAV summaries and warnings in every log. This is a best-effort filesystem scan, not a comprehensive compromise assessment. Live files can change during scanning. Use a trusted rescue environment for suspected root-level compromise.

Exit status: 0 = no signature detections reported and no recorded orchestration errors; 1 = detections; 2 = incomplete/error (detections may also exist; always inspect the report). No deletion or quarantine is requested. Reports persist if Docker scanning fails or the scan is interrupted with Ctrl+C. A forced kill or power loss may lose the active stage, but earlier checkpoints remain.

Validation on the development Windows machine covers syntax and mocked orchestration only. A real Linux/Docker/ClamAV integration scan must be validated on your server before operational use.

Metadata

Release files for devshield-scanner 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devshield-scanner 0.1.1
File Size Uploaded Provenance Actions
devshield_scanner-0.1.1.tar.gz 7.7 kB Without provenance Details for devshield_scanner-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for devshield-scanner 0.1.1
File Interpreter ABI Platform Actions
devshield_scanner-0.1.1-py3-none-any.whl Python 3 none any Details for devshield_scanner-0.1.1-py3-none-any.whl

Total release size: 16.0 kB

Release files / devshield_scanner-0.1.1.tar.gz

Download URL devshield_scanner-0.1.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9056b78c16b43785317ce4201b2004c891412cac5d4c171c96e12bb26dd086ce
BLAKE2b-256 checksum
How to use checksums
b3d0ac88b2b54c6427dc2cc1b75c4c32e01336db2d3cf6913fc7162d1ba4d6d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / devshield_scanner-0.1.1-py3-none-any.whl

Download URL devshield_scanner-0.1.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0718d5a09e8f384ea1a221592c3c237f8e2d6454bb597a525f0e685805c03228
BLAKE2b-256 checksum
How to use checksums
57a6570a25d932978c2e1ea6c34819372d4cc53b50243031f8c94dde483f6fc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for devshield-scanner 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page