I'm trying to connect Shadowd (Shadow Daemon) WAF (Web Application Firewall) with Flask connector from this Documentation
Even the normal "Hello world" program is throwing Internal server error. while I'm using the Flask Connector.
MY CODE
from flask import *
from shadowd.flask_connector import InputFlask, OutputFlask, Connector
app = Flask(__name__)
@app.before_request
def before_req():
input = InputFlask(request)
output = OutputFlask()
Connector().start(input, output)
@app.route('/', methods=['GET','POST'])
def index():
return "<h1>Working</h1>"
if __name__ == '__main__':
app.run()
The above code throws Internal Server Error
Traceback
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2018-03-15 12:33:36,668] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1610, in full_dispatch_request
rv = self.preprocess_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1831, in preprocess_request
rv = func()
File "index.py", line 11, in before_req
Connector().start(input, output)
File "/usr/local/lib/python2.7/dist-packages/shadowd/connector.py", line 285, in start
if config.get('debug'):
File "/usr/local/lib/python2.7/dist-packages/shadowd/connector.py", line 55, in get
return self.config.get(self.section, key)
File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
NoSectionError: No section: 'shadowd_python'
127.0.0.1 - - [15/Mar/2018 12:33:36] "GET / HTTP/1.1" 500 -
However the If I remove the Flask Connector part the application works good. I don't find much documentation in shadowd. Does anyone have Idea on the above issue? Kindly help me out.