Skip to content
This repository has been archived by the owner on May 30, 2020. It is now read-only.

Commit

Permalink
Add all resources (not only the ones we started with) to the database…
Browse files Browse the repository at this point in the history
… to catch embedded files too
  • Loading branch information
ercpe committed Jul 7, 2016
1 parent b09c9cb commit 9dad62f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions amavisvt/client.py
Expand Up @@ -438,6 +438,9 @@ def _iter_resources():
if vtresult and vtresult.infected:
continue

# add the resource to the database
self.database.add_resource(resource, vtresult)

if self.database.filename_pattern_match(resource.filename):
logger.info("Flagging attachment %s as INFECTED (identified via filename pattern)", resource.filename)

Expand All @@ -448,12 +451,6 @@ def _iter_resources():

results.extend(vt_results)

for resource in resources:
# add the main resources to the database using the VTResponse from upstream (or cache) if available
start_resource_result = [r for _, r in results if r and r.sha256 == resource.sha256]
start_resource_result = start_resource_result[0] if start_resource_result else None
self.database.add_resource(resource, start_resource_result)

# update patterns for entries which have no pattern set yet
self.database.update_patterns()

Expand Down

0 comments on commit 9dad62f

Please sign in to comment.