跳转到主要内容

检查上传资源病毒

项目描述

Tests

ckanext-clamav

这是一个基本示例,帮助使用clamd库扫描上传资源中的恶意软件。

安装

ClamAV库使用clamav工具,您必须在环境中安装它才能使此扩展正常工作。

例如,在Ubuntu上安装ClamAV

  1. 使用APT安装ClamAV apt-get update apt-get install clamav clamav-daemon -y

  2. 更新ClamAV签名数据库 systemctl stop clamav-freshclam freshclam systemctl start clamav-freshclam

要安装ckanext-clamav

  1. 激活您的CKAN虚拟环境,例如

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

  2. 克隆源并将其安装在虚拟env中

    git clone https://github.com/mutantsan/ckanext-clamav.git cd ckanext-clamav pip install -e . pip install -r requirements.txt

  3. clamav添加到您的CKAN配置文件中的ckan.plugins设置(默认配置文件位于/etc/ckan/default/ckan.ini)。

  4. 重启CKAN。例如,如果您在Ubuntu上使用Apache部署CKAN

    sudo service apache2 reload

配置设置

# 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

开发者安装

要为开发安装ckanext-clamav,激活您的CKAN虚拟环境并执行

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

测试

要运行测试,请执行

pytest --ckan-ini=test.ini

许可证

AGPL

项目详情


下载文件

为您的平台下载文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源分布

ckanext-clamav-1.0.3.tar.gz (20.4 kB 查看哈希值)

上传时间 源代码

构建分发版

ckanext_clamav-1.0.3-py3-none-any.whl (19.6 kB 查看哈希值)

上传时间 Python 3

由以下支持