mirror of https://github.com/MISP/misp-modules
fix: [website] print and css
parent
ee02bb171b
commit
2b94f73c15
|
@ -8,7 +8,7 @@ body {
|
||||||
|
|
||||||
main
|
main
|
||||||
{
|
{
|
||||||
overflow-x: auto;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
span#goTop{
|
span#goTop{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
|
@ -7,37 +7,39 @@ from .utils import query_get_module
|
||||||
|
|
||||||
def create_modules_db():
|
def create_modules_db():
|
||||||
modules = query_get_module()
|
modules = query_get_module()
|
||||||
|
if not "message" in modules:
|
||||||
for module in modules:
|
for module in modules:
|
||||||
m = Module.query.filter_by(name=module["name"]).first()
|
m = Module.query.filter_by(name=module["name"]).first()
|
||||||
input_attr = ""
|
input_attr = ""
|
||||||
if "input" in module["mispattributes"]:
|
if "input" in module["mispattributes"]:
|
||||||
input_attr = json.dumps(module["mispattributes"]["input"])
|
input_attr = json.dumps(module["mispattributes"]["input"])
|
||||||
if not m:
|
if not m:
|
||||||
m = Module(
|
m = Module(
|
||||||
name=module["name"],
|
name=module["name"],
|
||||||
description=module["meta"]["description"],
|
description=module["meta"]["description"],
|
||||||
is_active=True,
|
is_active=True,
|
||||||
request_on_query=False,
|
request_on_query=False,
|
||||||
input_attr=input_attr
|
input_attr=input_attr
|
||||||
)
|
)
|
||||||
db.session.add(m)
|
db.session.add(m)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
if "config" in module["meta"]:
|
if "config" in module["meta"]:
|
||||||
for conf in module["meta"]["config"]:
|
for conf in module["meta"]["config"]:
|
||||||
c = Config.query.filter_by(name=conf).first()
|
c = Config.query.filter_by(name=conf).first()
|
||||||
if not c:
|
if not c:
|
||||||
c = Config(
|
c = Config(
|
||||||
name = conf
|
name = conf
|
||||||
|
)
|
||||||
|
db.session.add(c)
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
mc = Module_Config(
|
||||||
|
module_id=m.id,
|
||||||
|
config_id=c.id
|
||||||
)
|
)
|
||||||
db.session.add(c)
|
db.session.add(mc)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
else:
|
||||||
mc = Module_Config(
|
print("[-] Error in misp-modules. It might not running.")
|
||||||
module_id=m.id,
|
|
||||||
config_id=c.id
|
|
||||||
)
|
|
||||||
db.session.add(mc)
|
|
||||||
db.session.commit()
|
|
Loading…
Reference in New Issue