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:
-
Install ClamAV with APT apt-get update apt-get install clamav clamav-daemon -y
-
Update the ClamAV signature database systemctl stop clamav-freshclam freshclam systemctl start clamav-freshclam
To install ckanext-clamav:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate
-
Clone the source and install it on the virtualenv
git clone https://github.com/mutantsan/ckanext-clamav.git cd ckanext-clamav pip install -e . pip install -r requirements.txt
-
Add
clamavto theckan.pluginssetting in your CKAN config file (by default the config file is located at/etc/ckan/default/ckan.ini). -
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/mutantsan/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
Release files for ckanext-clamav 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ckanext-clamav-1.0.3.tar.gz | 20.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ckanext_clamav-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.0 kB
Release files / ckanext-clamav-1.0.3.tar.gz
| Download URL | ckanext-clamav-1.0.3.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfe9d8e6333d9ef5bc0d1713f352348111abbe58f075c415588a284801d1d9ea
|
|
BLAKE2b-256 checksum How to use checksums |
bab4a1173d1b6ba54a68aeb84b8a52cbe16b0a92b3b4edfe7c98b510ca630f6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.3
|
Release files / ckanext_clamav-1.0.3-py3-none-any.whl
| Download URL | ckanext_clamav-1.0.3-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a3181b5215566dc1dc5e43c7b16e5a4f25f6cc40ec1419f3bd46a31958b2463
|
|
BLAKE2b-256 checksum How to use checksums |
b05c6ea1d6bd99abe769ea3960d0e9a41bbe9a847d4a320ae38e2c65afeb9fed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.0 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.3
|