Skip to content

Commit

Permalink
post merge cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
glaslos committed Dec 24, 2024
1 parent cb865c0 commit 6ada5dc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 25 deletions.
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ omit =
conpot/core/loggers/sqlite_log.py
conpot/core/loggers/stix_transform.py
conpot/core/loggers/taxii_log.py
conpot/utils/mac_addr.py
.tox/*


Expand Down
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
.gitignore
.landscape.yaml
.travis.yaml
.venv
.pytest_cache

**/__pycache__

Changelog.txt
docker-compose.xml
Dockerfile
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ WORKDIR /opt/conpot
COPY . .

# Install specific dependencies
RUN pip3 install --no-cache-dir pysnmp==4.4.12 \
&& pip3 install --no-cache-dir pysmi==0.3.2 \
&& pip3 install --no-cache-dir pyasn1==0.4.8 \
&& pip3 install --no-cache-dir cryptography==3.4.8 \
&& pip3 install --no-cache-dir .
RUN pip3 install --no-cache-dir .

# Stage 2: Runtime stage
FROM python:3.8-slim
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ build-docker:
docker build -t conpot:latest .

run-docker:
docker run -it -p 80:8800 -p 102:10201 -p 502:5020 -p 161:16100/udp -p 47808:47808/udp -p 623:6230/udp -p 21:2121 -p 69:6969/udp -p 44818:44818 --network=bridge --name conpot conpot:latest
docker run --rm -it -p 80:8800 -p 102:10201 -p 502:5020 -p 161:16100/udp -p 47808:47808/udp -p 623:6230/udp -p 21:2121 -p 69:6969/udp -p 44818:44818 --network=bridge --name conpot conpot:latest

format:
black .
19 changes: 4 additions & 15 deletions bin/conpot
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ from conpot.core.log_worker import LogWorker
from conpot.protocols.proxy.proxy import Proxy
from conpot.utils import ext_ip
from conpot.utils.greenlet import spawn_startable_greenlet
from conpot.utils import mac_addr
from conpot.utils.networking import fix_sslwrap

logger = logging.getLogger()
Expand Down Expand Up @@ -365,8 +364,6 @@ def main():
if config.getboolean("fetch_public_ip", "enabled"):
public_ip = ext_ip.get_ext_ip(config)



for protocol_name, server_class in protocols.name_mapping.items():
protocol_template = os.path.join(
root_template_directory, protocol_name, "{0}.xml".format(protocol_name)
Expand All @@ -384,9 +381,7 @@ def main():
if ast.literal_eval(
dom_protocol.xpath("//{0}/@enabled".format(protocol_name))[0]
):
host = dom_protocol.xpath("//{0}/@host".format(protocol_name))[
0
]
host = dom_protocol.xpath("//{0}/@host".format(protocol_name))[0]
# -- > Are we running on testing config?
if "testing.cfg" in args.config:
if "127." not in host:
Expand All @@ -405,15 +400,11 @@ def main():
greenlet.link_exception(on_unhandled_greenlet_exception)
servers.append((server, greenlet))
logger.info(
"Found and enabled {} protocol.".format(
protocol_name, server
)
"Found and enabled {} protocol.".format(protocol_name, server)
)
else:
logger.info(
"{} available but disabled by configuration.".format(
protocol_name
)
"{} available but disabled by configuration.".format(protocol_name)
)
else:
logger.debug(
Expand All @@ -430,9 +421,7 @@ def main():
# TODO: Line up Proxy init with other protocols
template_proxy = os.path.join(root_template_directory, "proxy", "proxy.xml")
if os.path.isfile(template_proxy):
xsd_file = os.path.join(
os.path.dirname(inspect.getfile(Proxy)), "proxy.xsd"
)
xsd_file = os.path.join(os.path.dirname(inspect.getfile(Proxy)), "proxy.xsd")
validate_template(template_proxy, xsd_file)
dom_proxy = etree.parse(template_proxy)
if dom_proxy.xpath("//proxies"):
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
gevent>=1.0
pysnmp
pysnmp==4.4.12
pysnmp-mibs
pysmi
pysmi==0.3.2
pyasn1==0.4.8
lxml
requests
sphinx
Expand All @@ -25,6 +26,6 @@ tftpy
# some freezegun versions broken
freezegun!=0.3.13
pytest
cryptography
cryptography==3.4.8
sphinx_rtd_theme
psutil

0 comments on commit 6ada5dc

Please sign in to comment.