Skanowanie antywirusowe¶
Założenia¶
Moduł odpowiedzialny jest za skanowanie wybranych przez użytkowników plików z użyciem skanerów antywirusowych on-line.
Dostępne są następujące silniki skanowania:
VirusTotal - limit 4 żądań / minutę, brak limitu plików, szczegóły
MetaDefender Cloud - limit 10 żądań / minutę, 100 żądań / dzień, szczegóły: https://metadefender.opswat.com/licensing
AttachmentScanner - brak limitów, niska skuteczność, szczegóły: https://www.attachmentscanner.com/pricing
Architektura¶
Model¶
- class feder.virus_scan.models.EngineApiKey(id, created, modified, name, engine, key, url, prevention_limit, prevention_remaining, prevention_interval_sec, prevention_reset_at, last_used)[source]¶
- Parameters:
id (AutoField) – Id
created (AutoCreatedField) – Utworzono
modified (AutoLastModifiedField) – Zmodyfikowany
name (CharField) – Name
engine (CharField) – Engine
key (CharField) – Key
url (CharField) – Url
prevention_limit (IntegerField) – Prevention limit
prevention_remaining (IntegerField) – Prevention remaining
prevention_interval_sec (IntegerField) – Prevention interval in seconds
prevention_reset_at (DateTimeField) – Prevention reset at
last_used (DateTimeField) – Last used
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
- class feder.virus_scan.models.Request(id, created, modified, content_type, object_id, field_name, engine_name, engine_id, engine_report, engine_link, status)[source]¶
- Parameters:
id (AutoField) – Id
created (AutoCreatedField) – Utworzono
modified (AutoLastModifiedField) – Zmodyfikowany
content_type_id (ForeignKey to
django.contrib.contenttypes.models.ContentType) – Scan ofobject_id (PositiveIntegerField) – Scan object id
field_name (CharField) – Field name
engine_name (CharField) – Nazwa silnika
engine_id (CharField) – Zewnętrzny identyfikator
engine_report (JSONField) – Wynik silnika
engine_link (CharField) – Link do wyniku silnika
status (IntegerField) – Status
- exception DoesNotExist¶
- exception MultipleObjectsReturned¶
Widoki¶
Panel administracyjny¶
- class feder.virus_scan.admin.ScanRequestAdmin(model, admin_site)[source]¶
- actions = None¶
- get_queryset(*args, **kwargs)[source]¶
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- has_add_permission(request, obj=None)[source]¶
Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.
- has_change_permission(request, obj=None)[source]¶
Return True if the given request has permission to change the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the obj model instance. If obj is None, this should return True if the given request has permission to change any object of the given type.
- has_delete_permission(request, obj=None)[source]¶
Return True if the given request has permission to delete the given Django model instance, the default implementation doesn’t examine the obj parameter.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the obj model instance. If obj is None, this should return True if the given request has permission to delete any object of the given type.