Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3

WORKDIR /app

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY imap2thehive.py ./imap2thehive.py

CMD [ "python", "imap2thehive.py" ]
10 changes: 10 additions & 0 deletions Dockerfile.CI
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3

WORKDIR /app

COPY git_src/requirements.txt /app/requirements.txt
COPY git_src/imap2thehive.py /app/imap2thehive.py

RUN pip install --no-cache-dir -r /app/requirements.txt

CMD [ "python", "imap2thehive.py" ]
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
Miscelaneous Docker files for my personal usage.
Feel free to contribute.
# imap2thehive

imap2thehive image with analyzers installed

image built around: https://github.com/xme/dockers/tree/master/imap2thehive

Image name: `pipedrive/imap2thehive`

# Description
This image is a K8 ready version of imap2thehive. The Python script included in the image diviates slightly from the original version of XME.


# Live deployment
1. [Deploy via Jenkins][1]
2. After deploying, fetch the new tag that was pushed to Docker Hub. This is listed in the console output of the Jenkins job.
3. Update the tag in the K8 manifests in [chef-repo][2] and in [the-hive-kube][3]

[1]: https://jenkins.pipedrive.tools/job/baseimage-imap2thehive-docker/
[2]: https://github.com/pipedrive/chef-repo
[3]: https://github.com/pipedrive/the-hive-kube
16 changes: 0 additions & 16 deletions cvesearch/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions cvesearch/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions cvesearch/docker-compose.yml

This file was deleted.

20 changes: 0 additions & 20 deletions cvesearch/init.sh

This file was deleted.

31 changes: 0 additions & 31 deletions dssuite/Dockerfile

This file was deleted.

18 changes: 12 additions & 6 deletions imap2thehive/imap2thehive.py → imap2thehive.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

__author__ = "Xavier Mertens"
__license__ = "GPLv3"
__version__ = "1.0.7"
__version__ = "1.0.8"
__maintainer__ = "Xavier Mertens"
__email__ = "xavier@rootshell.be"
__name__ = "imap2thehive"
Expand Down Expand Up @@ -138,7 +138,8 @@ def searchObservables(buffer, observables):
{ 'type': 'mail', 'regex': r'\b([a-z][_a-z0-9-.+]+@[a-z0-9-.]+\.[a-z]+)\b' },
{ 'type': 'hash', 'regex': r'\b([a-f0-9]{32}|[A-F0-9]{32})\b' },
{ 'type': 'hash', 'regex': r'\b([a-f0-9]{40}|[A-F0-9]{40})\b' },
{ 'type': 'hash', 'regex': r'\b([a-f0-9]{64}|[A-F0-9]{64})\b' }
{ 'type': 'hash', 'regex': r'\b([a-f0-9]{64}|[A-F0-9]{64})\b' },
{ 'type': 'headers', 'regex': r'\b(([A-Za-z-]+):\s([^\r\n]+(?:\r?\n(?![A-Za-z-]+:\s)[^\r\n]+)*))\b'}
]

# Add custom observables if any
Expand Down Expand Up @@ -216,8 +217,8 @@ def submitTheHive(message):
while i < len(headers.keys()):
headers_string = headers_string + headers.keys()[i] + ': ' + headers.values()[i] + '\n'
i+=1
# Temporary disabled
# observables = searchObservables(headers_string, observables)
# Testing email headers.
observables.extend(searchObservables(headers_string, observables))

body = ''
for part in msg.walk():
Expand Down Expand Up @@ -545,5 +546,10 @@ def main():
return

if __name__ == 'imap2thehive':
main()
sys.exit(0)
log = logging.getLogger(__name__)

while True:
log.info('Running main loop')
main()
log.info('Finished main loop, sleeping')
time.sleep(120)
24 changes: 0 additions & 24 deletions imap2thehive/Dockerfile

This file was deleted.

33 changes: 0 additions & 33 deletions imap2thehive/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions imap2thehive/entrypoint.sh

This file was deleted.

69 changes: 0 additions & 69 deletions imap2thehive/imap2thehive.conf

This file was deleted.

6 changes: 0 additions & 6 deletions imap2thehive/imap2thehive.whitelists

This file was deleted.

4 changes: 4 additions & 0 deletions pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: "2.0.0"
params:
platform:
name: "docker"
8 changes: 8 additions & 0 deletions repository.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "imap2thehive",
"description": "CronJob to sync our AlienVault email box with TheHive",
"owner": "Polaris",
"type": "tool",
"status": "unreleased",
"region-type": null
}
1 change: 1 addition & 0 deletions imap2thehive/requirements.txt → requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ requests
uuid
python-magic
thehive4py
chardet
Loading