Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNSDB dockerize + Python3 support #684

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion analyzers/DNSDB/DNSDB_DomainName.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DNSDB_DomainName",
"version": "2.0",
"version": "2.0.0",
"author": "CERT-BDF",
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
"license": "AGPL-V3",
Expand Down
2 changes: 1 addition & 1 deletion analyzers/DNSDB/DNSDB_IPHistory.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DNSDB_IPHistory",
"version": "2.0",
"version": "2.0.0",
"author": "CERT-BDF",
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
"license": "AGPL-V3",
Expand Down
2 changes: 1 addition & 1 deletion analyzers/DNSDB/DNSDB_NameHistory.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DNSDB_NameHistory",
"version": "2.0",
"version": "2.0.0",
"author": "CERT-BDF",
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
"license": "AGPL-V3",
Expand Down
14 changes: 12 additions & 2 deletions analyzers/DNSDB/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM python:2
FROM python:3-alpine

LABEL author="CERT-BDF" \
license="AGPL-V3" \
source="https://github.com/TheHive-Project/Cortex-Analyzers" \
title="DNSDB" \
url="https://github.com/TheHive-Project/Cortex-Analyzers" \
vendor="TheHive" \
version="2.0.0"

WORKDIR /worker

COPY . DNSDB
RUN pip install --no-cache-dir -r DNSDB/requirements.txt
ENTRYPOINT DNSDB/dnsdb.py

ENTRYPOINT DNSDB/dnsdb.py
6 changes: 3 additions & 3 deletions analyzers/DNSDB/dnsdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# encoding: utf-8
import datetime
from urllib2 import HTTPError
from urllib3.exceptions import HTTPError
from dnsdb_query import DnsdbClient, QueryError
from cortexutils.analyzer import Analyzer

Expand Down Expand Up @@ -65,7 +65,7 @@ def run(self):
"records": map(lambda r: self.update_date('time_first', self.update_date('time_last', r)),
self.execute_dnsdb_service(client))
})
except HTTPError, e:
except HTTPError as e:
if e.code != 404:
self.unexpectedError(e)
else:
Expand Down
Loading