Skip to main content

A Python utility wrapper for malware scanning libraries

Project description

SmoothGlue Malware Scan

A Python package that provides a library for interfacing with malware scanning utilities, currently only ClamAV.

Overview

smoothglue_malware_scan simplifies the process of scanning files for malware. The core problem it solves is providing a stop-check for incoming files to be scanned and either continue through the desired workflow if clean of malware and to follow a rejection workflow if malware is found.

Key Features

  • Malware Scanning Wrappers: Easily interact with malware scanning utilities, currently only ClamAV.
  • Custom Exceptions: A set of custom exceptions to easily use if malware is found or to help debug.

Installation

Prerequisites

  • Python 3.9+

Install App From PyPI Package (Official Use)

  1. Before installing the package, make sure that there is a virtual environment set up:

    python -m venv venv
    source venv/bin/activate
    
  2. Use pip and the following command:

    pip install smoothglue_malware_scan
    

Usage

ClamAV

from smoothglue_malware_scan.scanners.clamav import ClamAVScanner
from smoothglue_malware_scan.exceptions import MalwareFoundException, ScanningServiceException

scanner = ClamAVScanner(clam_av_host="<clam av host name>", clam_av_port=3310)

with open("/tmp/mymalware.exe", "rb") as f:
    try:
        scanner.scan_stream(f.read())
    except ScanningServiceException as e:
        # Unable to connect to ClamAV server or ClamAV encountered an error scanning the file
        # e.reason may have additional context
        print("Error scan file")
    except MalwareFoundException as e:
        # ClamAV detected malware in the file. e.reason will be the type of malware detected
        print(f"Detected {e.reason} in file")
    else:
        print("No malware detected")

License

This project is licensed under a Proprietary License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smoothglue_malware_scan-1.0.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smoothglue_malware_scan-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file smoothglue_malware_scan-1.0.0.tar.gz.

File metadata

  • Download URL: smoothglue_malware_scan-1.0.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.51.1.el8_10.x86_64

File hashes

Hashes for smoothglue_malware_scan-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9c76beca85e075ff0dbbb86ba16387296594d88680c89554ce6c754dc9bc136a
MD5 ba4942abc7abf3d5a7d2e8b873e9332c
BLAKE2b-256 40e34139dcd3ad893fb18a4747863f2fddb1f62ec0f32d684b67257c01086fe0

See more details on using hashes here.

File details

Details for the file smoothglue_malware_scan-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smoothglue_malware_scan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.11 Linux/4.18.0-553.51.1.el8_10.x86_64

File hashes

Hashes for smoothglue_malware_scan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40fe543d5288a82cd643dc6dc04bd43bde7c7032b066dd02ccb1b892009c2789
MD5 adcf2e4f4120bb093edddc068300d296
BLAKE2b-256 c3546016226cdc871ecc0f302f5da0daefeca1f39de6c7086eb72644ba2c61bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page