fix: replace Flask dev server with Gunicorn in Stimulus Engine#81
Open
prince-shakyaa wants to merge 1 commit into
Open
fix: replace Flask dev server with Gunicorn in Stimulus Engine#81prince-shakyaa wants to merge 1 commit into
prince-shakyaa wants to merge 1 commit into
Conversation
Author
|
Hii @fzipi , @adrianwinckles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Fix DoS Risk by replacing Flask Dev Server with Gunicorn in Stimulus Engine
FIxes #80
📝 What does this PR do?
This Pull Request addresses a critical performance and reliability bottleneck in the
CHAMELEON-RENStimulus Engine.Previously, the honeypot's core routing engine was running using Flask's built-in development server. As the Stimulus Engine sits at Layer 1 and is designed to handle potentially high volumes of malicious traffic, port scans, and payloads, using the single-threaded development server introduced a severe Denial of Service (DoS) risk. Attackers could easily exhaust the server resources or hang connections, blinding the entire honeypot network.
This PR wraps the Flask application in Gunicorn, a production-ready WSGI HTTP server, which manages multiple worker processes to safely handle concurrent requests and maintain high availability under pressure.
🛠️ Proposed Changes (Implementation Plan)
When we are ready to proceed, I will make the following specific code changes:
1. Update
CHAMELEON-REN/layer1_controller/engine/requirements.txtI will add
gunicorn==21.2.0to the list of Python dependencies so it is installed when the Docker image is built.Flask==3.0.0 requests==2.31.0 redis==5.0.1 +gunicorn==21.2.02. Update
CHAMELEON-REN/layer1_controller/engine/DockerfileI will update the
CMDinstruction to start the engine usinggunicornwith 4 worker processes instead of runningpython stimulus_engine.py.🔒 Safety and Verification
stimulus_engine.py(which handles the routing), it only changes how the application is served.-w 4), the honeypot will instantly be able to process multiple concurrent malicious requests simultaneously without locking up.