Skip to content

Commit

Permalink
Merge branch 'release/1.4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
fedelemantuano committed Apr 1, 2017
2 parents 87c1b18 + c3ed70b commit e02f841
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject spamscope "1.4.5-SNAPSHOT"
(defproject spamscope "1.4.6-SNAPSHOT"
:resource-paths ["_resources"]
:target-path "_build"
:min-lein-version "2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PyYAML==3.12
backports.functools-lru-cache==1.3
chainmap==1.0.2
elasticsearch==5.2.0
mail-parser==1.1.6
mail-parser==1.1.9
patool==1.12
pyparsing==2.2.0
python-magic==0.4.12
Expand All @@ -11,5 +11,5 @@ simplejson==3.10.0
six==1.10.0
ssdeep==3.2
streamparse==3.4.0
tika-app==1.0.1
tika-app==1.1.0
virustotal-api==1.1.2
2 changes: 1 addition & 1 deletion src/cli/spamscope_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_args():
submit.add_argument(
"-t",
"--timeout",
default=600,
default=720,
type=int,
help=("How long (in s) between heartbeats until supervisor considers "
"that worker dead."),
Expand Down
9 changes: 8 additions & 1 deletion src/modules/attachments/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ def tika(conf, attachments):

for a in attachments:
if not a.get("is_filtered", False):

if a["Content-Type"] in conf["whitelist_cont_types"]:
payload = a["payload"]

if a["content_transfer_encoding"] != "base64":
payload = payload.encode("base64")

# tika-app only gets payload in base64
a["tika"] = tika.extract_all_content(
payload=a["payload"], convert_to_obj=True)
payload=payload, convert_to_obj=True)


@register(active=True)
Expand Down
8 changes: 5 additions & 3 deletions src/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ def write_payload(payload, extension, content_transfer_encoding="base64"):
"""

temp = tempfile.mkstemp()[1] + extension
write_type = "w"

with open(temp, 'wb') as f:
if content_transfer_encoding == "base64":
payload = payload.decode("base64")
if content_transfer_encoding == "base64":
payload = payload.decode("base64")
write_type = "wb"

with open(temp, write_type) as f:
f.write(payload)

return temp
Expand Down
2 changes: 1 addition & 1 deletion src/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from os.path import join

__version__ = "1.4.5"
__version__ = "1.4.6"
__configuration_path__ = "/etc/spamscope"

__defaults__ = {
Expand Down
2 changes: 1 addition & 1 deletion topologies/spamscope_elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OutputElasticsearchTopology(Topology):
attachments = Attachments.spec(
name="attachments",
inputs={tokenizer['attachments']: Grouping.fields('sha256_random')},
par=1)
par=4)

urls_body = UrlsHandlerBody.spec(
name="urls-handler-body",
Expand Down
2 changes: 1 addition & 1 deletion topologies/spamscope_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OutputRedisTopology(Topology):
attachments = Attachments.spec(
name="attachments",
inputs={tokenizer['attachments']: Grouping.fields('sha256_random')},
par=2)
par=4)

urls_body = UrlsHandlerBody.spec(
name="urls-handler-body",
Expand Down
2 changes: 1 addition & 1 deletion topologies/spamscope_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class OutputTestingTopology(Topology):
attachments = Attachments.spec(
name="attachments",
inputs={tokenizer['attachments']: Grouping.fields('sha256_random')},
par=1)
par=4)

urls_body = UrlsHandlerBody.spec(
name="urls-handler-body",
Expand Down

0 comments on commit e02f841

Please sign in to comment.