Permalink
Browse files

Merge remote-tracking branch 'origin/master' into fix_pep8_errors

  • Loading branch information...
pwnbus committed Oct 8, 2018
2 parents 6dfd213 + 2dac54d commit 6456b8eddba26df64024fca6dfe94a5f74110e3b
View
@@ -4,7 +4,6 @@ exclude =
.git
*__init__.py
ignore =
E111 # indentation is not a multiple of four
E114 # indentation is not a multiple of four (comment)
E116 # unexpected indentation (comment)
E121 # continuation line under-indented for hanging indent
@@ -17,7 +16,6 @@ ignore =
E128 # continuation line under-indented for visual indent
E129 # visually indented line with same indent as next logical line
E131 # continuation line unaligned for hanging indent
E221 # multiple spaces before operator
E222 # multiple spaces after operator
E225 # missing whitespace around operator
E226 # missing whitespace around arithmetic operator
@@ -27,7 +25,6 @@ ignore =
E261 # at least two spaces before inline comment
E265 # block comment should start with '# '
E266 # too many leading '#' for block comment
E271 # multiple spaces after keyword
E301 # expected 1 blank line
E302 # expected 2 blank lines, found 1
E305 # expected 2 blank lines after class or function definition
@@ -43,4 +40,3 @@ ignore =
F821 # undefined name 'SysLogHandler'
F841 # local variable 'CIDR' is assigned to but never used
W503 # line break before binary operator
W601 # .has_key() is deprecated, use 'in'
View
@@ -12,7 +12,7 @@ The Mozilla Defense Platform (MozDef) seeks to automate the security incident ha
## Goals:
* Provide a platform for use by defenders to rapidly discover and respond to security incidents.
* Automate interfaces to other systems like bunker, banhammer, mig
* Automate interfaces to other systems like bunker, cymon, mig
* Provide metrics for security events and incidents
* Facilitate real-time collaboration amongst incident handlers
* Facilitate repeatable, predictable processes for incident handling
@@ -19,7 +19,7 @@
import logging
from logging.handlers import SysLogHandler
from Queue import Empty
from requests.packages.urllib3.exceptions import ClosedPoolError
from requests.packages.urllib3.exceptions import ClosedPoolError
import requests
import time
View
@@ -170,7 +170,7 @@ def __init__(self, ):
self.root_logger.setLevel(logging.INFO)
self.client = kitnirc.client.Client(options.host, options.port)
self.controller = kitnirc.modular.Controller(self.client, options.configfile)
self.controller = kitnirc.modular.Controller(self.client, options.configfile)
self.controller.load_config()
self.controller.start()
self.client.root_logger = self.root_logger
View
@@ -65,7 +65,7 @@ def main():
}
}
r = requests.put('%s/_snapshot/s3backup' % esserver, data=json.dumps(snapshot_config))
if r.json().has_key('status'):
if 'status' in r.json():
logger.error("Error while registering snapshot repo: %s" % r.text)
else:
logger.debug('snapshot repo registered')
@@ -87,7 +87,7 @@ def main():
epoch=calendar.timegm(datetime.utcnow().utctimetuple())
r = requests.put('{0}/_snapshot/s3backup/{1}-{2}?wait_for_completion=true'.format(esserver,index_to_snapshot,epoch),
data=json.dumps(snapshot_config))
if r.json().has_key('status'):
if 'status' in r.json():
logger.error('Error snapshotting %s: %s' % (index_to_snapshot, r.json()))
else:
logger.debug('snapshot %s finished' % index_to_snapshot)
View
@@ -347,7 +347,7 @@ def updateAttackerGeoIP(mozdefdb, attackerID, eventDictionary):
#"continent": "EU"
#logger.debug(eventDictionary)
if 'details' in eventDictionary.keys():
if 'sourceipgeolocation' in eventDictionary['details']:
if 'sourceipgeolocation' in eventDictionary['details']:
attackers=mozdefdb['attackers']
attacker = attackers.find_one({'_id': attackerID})
if attacker is not None:
View
@@ -68,7 +68,7 @@ def process_events(mozmsg, duo_events, etype, state):
continue
# Duo client doesn't translate inner dicts to dicts for some reason - its just a string, so we have to process and parse it
if e[i] != None and type(e[i]) == str and e[i].startswith('{'):
if e[i] != None and type(e[i]) == str and e[i].startswith('{'):
j = json.loads(e[i])
for x in j:
details[x] = j[x]

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
View
@@ -135,7 +135,7 @@ def main():
for row in rows:
id = row['UniqueCallID']
# Copy the row's info if we don't already have the final completed call state
if id not in calls or (id in calls and calls[id]['CallState'] != 'COMPLETED'):
if id not in calls or (id in calls and calls[id]['CallState'] != 'COMPLETED'):
calls[id] = row
# Massage call data and send to MozDef
View
@@ -135,7 +135,7 @@
# overrides to fix wide table scrolling.
# https://github.com/snide/sphinx_rtd_theme/issues/117
def setup(app):
app.add_stylesheet("theme_overrides.css")
app.add_stylesheet("theme_overrides.css")
# Add any extra paths that contain custom files (such as robots.txt or
@@ -205,8 +205,7 @@ def setup(app):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'MozDef.tex', u'MozDef Documentation',
u'Mozilla', 'manual'),
('index', 'MozDef.tex', u'MozDef Documentation', u'Mozilla', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -235,8 +234,7 @@ def setup(app):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'mozdef', u'MozDef Documentation',
[u'Mozilla'], 1)
('index', 'mozdef', u'MozDef Documentation', [u'Mozilla'], 1)
]
# If true, show URL addresses after external links.
@@ -249,9 +247,7 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'MozDef', u'MozDef Documentation',
u'Mozilla', 'MozDef', 'MozDef: The Mozilla Defense Platform.',
'Miscellaneous'),
('index', 'MozDef', u'MozDef Documentation', u'Mozilla', 'MozDef', 'MozDef: The Mozilla Defense Platform.', 'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
@@ -18,7 +18,7 @@
import logging
from logging.handlers import SysLogHandler
from Queue import Empty
from requests.packages.urllib3.exceptions import ClosedPoolError
from requests.packages.urllib3.exceptions import ClosedPoolError
import requests
import time
from configlib import getConfig, OptionParser, setConfig
View
@@ -46,7 +46,6 @@ pynsive==0.2.6
pyOpenSSL==16.2.0
pyparsing==2.1.10
python-dateutil==2.6.1
pytx==0.5.6
pytz==2017.3
requests==2.18.4
requests-futures==0.9.7

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 6456b8e

Please sign in to comment.