Skip to main content

Tests

ckanext-clamav

This is a basic example that helps to scan uploaded resources for malwares with clamd library.

Installation

Clamd library uses clamav tool, and you must install it into your environment, to make this extension work.

For example, to install ClamAV on Ubuntu:

  1. Install ClamAV with APT

    apt-get update
    apt-get install clamav clamav-daemon -y
    
  2. Update the ClamAV signature database

    systemctl stop clamav-freshclam
    freshclam
    systemctl start clamav-freshclam
    

To install ckanext-clamav:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate

  2. Clone the source and install it on the virtualenv

    git clone https://github.com/DataShades/ckanext-clamav.git
    cd ckanext-clamav
    pip install -e .
    pip install -r requirements.txt
    
  3. Add clamav to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/ckan.ini).

  4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload

Config settings

# If your socket file is in different folder, you can specify it
# (optional, default: /var/run/clamav/clamd.ctl).
ckanext.clamav.socket_path = /your/path/to/socket.file

# You can decide to upload unscanned files or not.
# For example, if clamav is disabled, you won't be able to scan a file
# (optional, default: True).
ckanext.clamav.upload_unscanned = False

# ClamAV connection mechanism. There are two options: `tcp` or `unix`.
# If `tcp` selected, you must provide host:port (check next options).
# ( optional, default: unix)
ckanext.clamav.socket_type = unix

# TCP/IP hostname
ckanext.clamav.tcp.host = your.hostname.address

# TCP/IP port
ckanext.clamav.tcp.port = 3310

# ClamAV connection timeout. Either `tcp` or `unix`
# By default, there is no timeout.
# ( optional, default: 60)
ckanext.clamav.timeout = 120

Developer installation

To install ckanext-clamav for development, activate your CKAN virtualenv and do:

git clone https://github.com/DataShades/ckanext-clamav.git
cd ckanext-clamav
python setup.py develop
pip install -r dev-requirements.txt

Tests

To run the tests, do:

pytest --ckan-ini=test.ini

License

AGPL

Metadata

Release files for ckanext-clamav 1.0.32

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

Source distribution (sdist)

Source distribution for ckanext-clamav 1.0.32
File Size Uploaded Provenance
ckanext_clamav-1.0.32.tar.gz 19.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-clamav 1.0.32
File Interpreter ABI Platform
ckanext_clamav-1.0.32-py3-none-any.whl Python 3 none any Details

Total release size: 39.2 kB

Release files / ckanext_clamav-1.0.32.tar.gz

Download URL ckanext_clamav-1.0.32.tar.gz
Size 19.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a4e4c7c9c69a68bf9d24052b3178a00205faca57937a1afdc3f94de52ecf8a7a
BLAKE2b-256 checksum
How to use checksums
838c6ad526a5a9bf6ae3d72da350600c6a6605f22a1a66f1d39c41ea0a883403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Release files / ckanext_clamav-1.0.32-py3-none-any.whl

Download URL ckanext_clamav-1.0.32-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfee4c14ff0ca0e61d699dff9b7acae64c4aa568e02af13e9c9642a1299f50b4
BLAKE2b-256 checksum
How to use checksums
4ef1b497f96b5838c6fc7aad2bc9ff00312b89eea4eb4b9dce2655af1a4b363f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.10

Security for ckanext-clamav 1.0.32

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.

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