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

Clean up outdated code, dependencies, documentation, etc. #532

Merged
merged 19 commits into from
Dec 6, 2020
Merged
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
4 changes: 0 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@ omit =
conpot/core/loggers/hpfriends.py
conpot/core/loggers/log_worker.py
conpot/core/loggers/syslog.py
conpot/core/loggers/mysql_log.py
conpot/core/loggers/sqlite_log.py
conpot/core/loggers/stix_transform.py
conpot/core/loggers/taxii_log.py
conpot/utils/mac_addr.py
# New features.. Just to avoid coverage drop - before we actually write some tests
conpot/core/auth.py
.tox/*


exclude_lines =
pragma: no cover
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:

ignore_errors = True
2 changes: 0 additions & 2 deletions .landscape.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ before_install:
- echo $REPO
- echo $TRAVIS_TAG
- pwd
services:
- mysql
addons:
apt:
packages:
Expand All @@ -26,7 +24,6 @@ install:
- pip install tox
- pip install -r requirements.txt
before_script:
- mysql -e 'CREATE DATABASE IF NOT EXISTS conpot_unittest;'
- chmod +x "$REPO/bin/conpot"
script:
- tox
Expand Down
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM python:3.8 AS conpot-builder

RUN apt-get update && apt-get install -y \
libmariadb-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -19,16 +18,10 @@ RUN pip3 install --user --no-cache-dir /opt/conpot
# Run container
FROM python:3.8-slim

RUN apt-get update && apt-get install -y \
wget \
&& rm -rf /var/lib/apt/lists/*

RUN adduser --disabled-password --gecos "" conpot
WORKDIR /home/conpot

COPY --from=conpot-builder --chown=conpot:conpot /home/conpot/.local/ /home/conpot/.local/
RUN mkdir -p /etc/conpot /var/log/conpot /usr/share/wireshark \
&& wget https://github.com/wireshark/wireshark/raw/master/manuf -o /usr/share/wireshark/manuf

# Create directories
RUN mkdir -p /var/log/conpot/ \
Expand Down
Empty file removed bin/__init__.py
Empty file.
176 changes: 0 additions & 176 deletions bin/hmi_crawler

This file was deleted.

8 changes: 0 additions & 8 deletions conpot/core/databus.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import logging
import json
import inspect

# this is needed because we use it in the xml.
Expand Down Expand Up @@ -105,13 +104,6 @@ def initialize(self, config_file):
raise Exception("Unknown value type: {0}".format(value_type))
self.initialized.set()

def get_shapshot(self):
# takes a snapshot of the internal honeypot state and returns it as json.
snapsnot = {}
for key in list(self._data.keys()):
snapsnot[key] = self.get_value(key)
return json.dumps(snapsnot)

def reset(self):
logger.debug("Resetting databus.")

Expand Down
4 changes: 0 additions & 4 deletions conpot/core/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

import time
import typing
import stat
import tempfile
import logging
Expand All @@ -28,7 +27,6 @@
from os import F_OK, R_OK, W_OK
from typing import Optional, Union, Text, Any, List
from fs import open_fs, mirror, errors, subfs, base
from fs.time import datetime_to_epoch
from fs.mode import Mode
from fs.wrapfs import WrapFS
from fs.permissions import Permissions
Expand All @@ -43,8 +41,6 @@
)
from conpot.core.fs_utils import FSOperationNotPermitted

_F = typing.TypeVar("_F", bound="FS", covariant=True)

logger = logging.getLogger(__name__)


Expand Down
1 change: 0 additions & 1 deletion conpot/core/fs_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"""
import fs
from typing import Optional, Union
from fs import errors
from fs.permissions import Permissions
import typing
from fs.subfs import SubFS
Expand Down
3 changes: 0 additions & 3 deletions conpot/core/loggers/json_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,3 @@ def log(self, event):
json.dump(data, self.fileHandle, default=json_default)
self.fileHandle.write("\n")
self.fileHandle.flush()

def log_session(self, session):
pass
20 changes: 0 additions & 20 deletions conpot/core/loggers/log_worker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright (C) 2014 Lukas Rist <[email protected]>
#
# This program is free software; you can redistribute it and/or
Expand All @@ -18,8 +17,6 @@

import json
import logging

# import uuid
import time

from datetime import datetime
Expand All @@ -28,8 +25,6 @@
from gevent.queue import Empty

from conpot.core.loggers.sqlite_log import SQLiteLogger

# from conpot.core.loggers.mysql_log import MySQLlogger
from conpot.core.loggers.hpfriends import HPFriendsLogger
from conpot.core.loggers.syslog import SysLogger
from conpot.core.loggers.taxii_log import TaxiiLogger
Expand All @@ -45,7 +40,6 @@ def __init__(self, config, dom, session_manager, public_ip):
self.log_queue = session_manager.log_queue
self.session_manager = session_manager
self.sqlite_logger = None
# self.mysql_logger = None
self.json_logger = None
self.friends_feeder = None
self.syslog_client = None
Expand All @@ -55,17 +49,6 @@ def __init__(self, config, dom, session_manager, public_ip):
if config.getboolean("sqlite", "enabled"):
self.sqlite_logger = SQLiteLogger()

# if config.getboolean('mysql', 'enabled'):
# host = config.get('mysql', 'host')
# port = config.getint('mysql', 'port')
# db = config.get('mysql', 'db')
# username = config.get('mysql', 'username')
# passphrase = config.get('mysql', 'passphrase')
# logdevice = config.get('mysql', 'device')
# logsocket = config.get('mysql', 'socket')
# sensorid = config.get('common', 'sensorid')
# self.mysql_logger = MySQLlogger(host, port, db, username, passphrase, logdevice, logsocket, sensorid)

if config.getboolean("json", "enabled"):
filename = config.get("json", "filename")
sensorid = config.get("common", "sensorid")
Expand Down Expand Up @@ -137,9 +120,6 @@ def start(self):
if self.sqlite_logger:
self.sqlite_logger.log(event)

# if self.mysql_logger:
# self.mysql_logger.log(event)

if self.syslog_client:
self.syslog_client.log(event)

Expand Down
Loading