Skip to content

Commit 8bb98d0

Browse files
Merge branch 'release/2.5.0'
2 parents ff26341 + 3517a0b commit 8bb98d0

34 files changed

+7688
-147
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ after_success:
8484
- coveralls
8585

8686
- if [ "$TRAVIS_BRANCH" == "master" ]; then
87-
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
87+
echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin;
8888
docker push $DOCKER_USERNAME/spamscope-elasticsearch;
8989
fi
9090

9191
- if [ "$TRAVIS_BRANCH" == "develop" ]; then
92-
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
92+
echo $DOCKER_PASSWORD | docker login -u="$DOCKER_USERNAME" --password-stdin;
9393
docker push $DOCKER_USERNAME/spamscope-elasticsearch:develop;
9494
fi
9595

README.rst

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Concepts <http://storm.apache.org/releases/1.2.1/Concepts.html>`__ -
1717
`Streamparse
1818
Quickstart <http://streamparse.readthedocs.io/en/stable/quickstart.html>`__
1919

20-
In general the first step is start Apache Storm, then you can run the
21-
topologies. SpamScope has some topologies in `topologies
20+
In general the first step is run Apache Storm, then you can run the
21+
topologies on it. SpamScope has some topologies in `topologies
2222
folder <./topologies/>`__, but you can make others topologies.
2323

2424
.. figure:: docs/images/schema_topology.png?raw=true
@@ -117,15 +117,15 @@ Mantuano <https://www.linkedin.com/in/fmantuano/>`__)
117117
Requirements
118118
============
119119

120-
For operating system requirements you can read ``Ansible`` playbook,
121-
that goes into details.
120+
For operating system requirements you can read `Ansible
121+
playbooks <./ansible>`__, that go into details.
122122

123123
For Python requirements you can read: \* `mandatory
124124
requirements <./requirements.txt>`__ \* `optional
125125
requirements <./requirements_optional.txt>`__
126126

127-
*Thug* is another optional requirement. See Thug section for more
128-
details.
127+
*Thug* is another optional requirement, that it's not in requirements.
128+
See `Thug section <#thug-optional>`__ for more details.
129129

130130
Apache Storm
131131
------------
@@ -181,7 +181,8 @@ From release v1.3 SpamScope can analyze Javascript and HTML attachments
181181
with `Thug <https://github.com/buffer/thug>`__. If you want to analyze
182182
the attachments with Thug, follow `these
183183
instructions <http://buffer.github.io/thug/doc/build.html>`__ to install
184-
it. Enable it in ``attachments`` section.
184+
it. Enable it in ``attachments`` section of `main configuration
185+
file <./conf/spamscope.example.yml>`__.
185186

186187
What is Thug? From README project: > Thug is a Python low-interaction
187188
honeyclient aimed at mimicing the behavior of a web browser in order to
@@ -190,8 +191,9 @@ detect and emulate malicious contents.
190191
You can see a complete SpamScope report with Thug analysis
191192
`here <https://goo.gl/Y4kWCv>`__.
192193

193-
Thug analysis can be very slow and you can have ``heartbeat timeout`` in
194-
Apache Storm. To avoid any issue set ``supervisor.worker.timeout.secs``:
194+
Thug analysis can be very slow and you can have ``heartbeat timeout``
195+
errors in Apache Storm. To avoid any issue set
196+
``supervisor.worker.timeout.secs``:
195197

196198
::
197199

@@ -226,8 +228,9 @@ install ``redis`` package.
226228
Configuration
227229
=============
228230

229-
Read the `example configuration file <./conf/spamscope.example.yml>`__.
230-
The default value where SpamScope will search the configuration file is
231+
Read the `example of main configuration
232+
file <./conf/spamscope.example.yml>`__. The default value where
233+
SpamScope will search the configuration file is
231234
``/etc/spamscope/spamscope.yml``, but it's possible to set the
232235
environment variable ``SPAMSCOPE_CONF_FILE``:
233236

ansible/02_submit_spamscope_debug.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
tasks:
99
- name: Submit spamscope_debug topology
10-
shell: "spamscope-topology submit -g spamscope_debug -p 100 -t 30 -e prod_vm"
10+
shell: "spamscope-topology submit -g spamscope_debug -p 1 -t 20 -e prod_vm"
1111
args:
1212
chdir: "{{ spamscope_path }}"
1313
tags:
1414
- submit
1515
when: spamscope_debug_submit == "true"
1616
environment:
17-
PATH: "{{ spamscope_path }}/venv/bin:{{ install_path }}/storm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
18-
LEIN_ROOT: "yes"
17+
PATH: "{{ spamscope_path }}/venv/bin:{{ install_path }}/storm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
18+
LEIN_ROOT: "yes"

conf/spamscope.example.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ files-mails:
66
# Reload new mails after reload.mails analyzed
77
reload.mails: 1000
88

9+
# The mails in processing older that fail.after.seconds will be failed
10+
fail.after.seconds: 60
11+
912
# Post processing
1013
post_processing:
1114

12-
# move or remove mails?
15+
# move or remove mails analyzed, default remove
1316
what: remove
1417

15-
# if move where
16-
where: /mnt/testing/spamscope/mails/moved
18+
# Where you want move the analyzed mails, default /tmp/moved
19+
where: /tmp/moved
1720

18-
# if failed move in where.failed
19-
where.failed: /mnt/testing/spamscope/mails/failed
21+
# Where you want move the failed mails, default /tmp/failed
22+
where.failed: /tmp/failed
2023

2124
# Mailboxes
2225
mailboxes:
@@ -64,6 +67,9 @@ phishing:
6467

6568

6669
tokenizer:
70+
# Persistent where store dumps of hashes.
71+
persistent_path: /tmp
72+
6773
# If true mails with same hash are filtered and not analyzed.
6874
# Only the body will not saved
6975
filter_mails: true
@@ -110,6 +116,11 @@ attachments:
110116
# The lists of all components must be under lists keyword to load them
111117
# automatically
112118
commons:
119+
# enable or disable filter on size
120+
size.filter.enabled: false
121+
# max size to analyze in bytes
122+
max.size: 3145728
123+
113124
lists:
114125
blacklist_content_types:
115126
# All content types to remove from results

conf/templates/commons.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"settings": {
55
"index.codec": "best_compression",
66
"index.number_of_replicas": 0,
7-
"index.refresh_interval": "5s"
7+
"index.refresh_interval": "5s",
8+
"index.mapping.total_fields.limit": 100000,
9+
"index.mapping.ignore_malformed": true
810
}
911
}

conf/templates/spamscope_attachments.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"order": 0,
3-
"version": 1,
3+
"version": 2,
44
"index_patterns": "spamscope_attachments-*",
55
"settings": {
66
"analysis": {
@@ -57,6 +57,15 @@
5757
"match": "(^|.*\\.)(payload)$"
5858
}
5959
},
60+
{
61+
"number": {
62+
"mapping": {
63+
"type": "long"
64+
},
65+
"match_pattern": "regex",
66+
"match": "(^|.*\\.)(size)$"
67+
}
68+
},
6069
{
6170
"structured": {
6271
"mapping": {

conf/templates/spamscope_mails.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"order": 0,
3-
"version": 6,
3+
"version": 8,
44
"index_patterns": "spamscope_mails-*",
55
"settings": {
66
"analysis": {
@@ -38,14 +38,23 @@
3838
"_doc": {
3939
"dynamic_templates": [
4040
{
41-
"cert_serial": {
41+
"shodan_cert_serial": {
4242
"mapping": {
4343
"type": "text",
4444
"norms": false
4545
},
4646
"path_match": "network.shodan.data.ssl.cert.serial"
4747
}
4848
},
49+
{
50+
"shodan_vulns": {
51+
"mapping": {
52+
"type": "text",
53+
"norms": false
54+
},
55+
"path_match": "network.shodan.data.vulns.*.cvss"
56+
}
57+
},
4958
{
5059
"hashes": {
5160
"mapping": {
@@ -104,6 +113,15 @@
104113
"match": "(^|.*\\.)(sender_ip|srcip|http_iv_remote_address|clientip|syslog_host|ip_str)$"
105114
}
106115
},
116+
{
117+
"number": {
118+
"mapping": {
119+
"type": "long"
120+
},
121+
"match_pattern": "regex",
122+
"match": "(^|.*\\.)(size)$"
123+
}
124+
},
107125
{
108126
"structured": {
109127
"mapping": {
@@ -126,13 +144,13 @@
126144
"type": "ip"
127145
},
128146
"latitude": {
129-
"type": "half_float"
147+
"type": "float"
130148
},
131149
"location": {
132150
"type": "geo_point"
133151
},
134152
"longitude": {
135-
"type": "half_float"
153+
"type": "float"
136154
}
137155
}
138156
},
64.9 KB
Loading
65.6 KB
Loading
64.6 KB
Loading

0 commit comments

Comments
 (0)