initial commit
This commit is contained in:
18
extra/bro_api.py
Normal file
18
extra/bro_api.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import base64
|
||||
from subprocess import check_output
|
||||
from flask import Flask
|
||||
|
||||
BRO_CONFIG='/opt/bro/share/bro/site/local.bro'
|
||||
|
||||
@app.route('/config')
|
||||
def config_get():
|
||||
cmd = ['cat', BRO_CONFIG]
|
||||
res = check_output(cmd)
|
||||
res = base64.b64encode(res)
|
||||
data = {'acknowledged':'true', 'config':str(res)}
|
||||
return data
|
||||
|
||||
app = Flask(__name__)
|
||||
Reference in New Issue
Block a user