diff --git a/run.py b/run.py index 36cd7b1..d85d3a6 100644 --- a/run.py +++ b/run.py @@ -4,7 +4,8 @@ import os import yaml import base64 -from flask import Flask, render_template, request, Response +import json +from flask import Flask, jsonify, render_template, request, Response from sigma.conversion.base import Backend from sigma.plugins import InstalledSigmaPlugins @@ -19,6 +20,7 @@ backends = plugins.backends pipeline_resolver = plugins.get_pipeline_resolver() pipelines = list(pipeline_resolver.list_pipelines()) +pipelines_names = [p[0] for p in pipelines] @app.route("/") @@ -41,6 +43,11 @@ def home(): ) +@app.route("/getpipelines", methods=["GET"]) +def get_pipelines(): + return jsonify(pipelines_names) + + @app.route("/sigma", methods=["POST"]) def convert(): # get params from request diff --git a/static/js/index.js b/static/js/index.js index 630d72e..2bb9b5d 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -41,6 +41,15 @@ window.onload = function () { } }); + // check if hideEditor parameter is in url + if(urlParameter.has('hideEditor')){ + let hideEditor = urlParameter.get('hideEditor') + if(hideEditor == 1){ + document.getElementById("rule-section").style.display = "none" + document.getElementById("rule-grid").setAttribute("class", "") + } + } + // check if rule parameter is in url if(urlParameter.has('rule')){ let rule = atob(urlParameter.get('rule')); diff --git a/templates/index.html b/templates/index.html index c473115..8ae3b8e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -78,10 +78,9 @@ -
@@ -169,7 +168,6 @@ level: high