19 lines
366 B
Python
19 lines
366 B
Python
#!/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__)
|