-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
22 changed files
with
1,498 additions
and
1,262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "misp-modules" | ||
version = "2.4.197" | ||
version = "2.4.198" | ||
description = "MISP modules are autonomous modules that can be used for expansion and other services in MISP" | ||
authors = ["Alexandre Dulaunoy <[email protected]>"] | ||
license = "AGPL-3.0-only" | ||
|
@@ -36,6 +36,7 @@ psutil = "*" | |
pyparsing = "*" | ||
redis = "*" | ||
tornado = "*" | ||
urllib3 = ">=1.26,<2" | ||
## module dependencies (if a dependency fails loading with '*', pin it here) | ||
censys = "2.0.9" | ||
socialscan = "<2.0.0" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from app import create_app, db | ||
from flask import render_template | ||
import os | ||
from app.utils.init_modules import create_modules_db | ||
|
||
from app.utils.utils import gen_admin_password | ||
|
||
os.environ.setdefault('FLASKENV', 'development') | ||
|
||
app = create_app() | ||
|
||
@app.errorhandler(404) | ||
def error_page_not_found(e): | ||
return render_template('404.html'), 404 | ||
|
||
|
||
def main(init_db=False, recreate_db=False, delete_db=False, create_module=False): | ||
if init_db: | ||
with app.app_context(): | ||
db.create_all() | ||
elif recreate_db: | ||
with app.app_context(): | ||
db.drop_all() | ||
db.create_all() | ||
elif delete_db: | ||
with app.app_context(): | ||
db.drop_all() | ||
elif create_module: | ||
with app.app_context(): | ||
create_modules_db() | ||
else: | ||
gen_admin_password() | ||
app.run(host=app.config.get("FLASK_URL"), port=app.config.get("FLASK_PORT") , use_reloader=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import os | ||
import argparse | ||
import subprocess | ||
import time | ||
from app_creation import main | ||
|
||
import signal | ||
import sys | ||
def signal_handler(sig, frame): | ||
kill_script() | ||
sys.exit(0) | ||
|
||
signal.signal(signal.SIGINT, signal_handler) | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-i", "--init_db", help="Initialise the db if it not exist", action="store_true") | ||
parser.add_argument("-r", "--reload_db", help="Delete and initialise the db", action="store_true") | ||
parser.add_argument("-l", "--launch", help="Launch the app", action="store_true") | ||
parser.add_argument("-ks", "--killscript", help="Kill screen running background", action="store_true") | ||
args = parser.parse_args() | ||
|
||
def kill_script(): | ||
r = ["screen", "-ls", "|", "egrep", "[0-9]+.misp_mod", "|", "cut", "-d.", "-f1"] | ||
process = subprocess.Popen(r, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
out, err = process.communicate() | ||
if out: | ||
subprocess.call(["screen", "-X", "-S", "misp_mod", "quit"]) | ||
|
||
if args.init_db: | ||
main(init_db=True) | ||
elif args.reload_db: | ||
main(recreate_db=True) | ||
elif args.launch: | ||
os.environ.setdefault('FLASKENV', 'development') | ||
kill_script() | ||
subprocess.call(["screen", "-dmS", "misp_mod"]) | ||
r = ["screen", "-S", "misp_mod", "-X", "screen", "-t", "misp_modules_server", "bash", "-c", "../env/bin/misp-modules", "-l", "127.0.0.1;", "read x"] | ||
subprocess.call(r) | ||
time.sleep(2) | ||
main(create_module=True) | ||
main() | ||
elif args.killscript: | ||
kill_script() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import argparse | ||
import subprocess | ||
|
||
os.environ.setdefault('FLASKENV', 'development') | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-m", "--migrate", help="Initialise the db if it not exist", action="store_true") | ||
parser.add_argument("-u", "--upgrade", help="Delete and initialise the db", action="store_true") | ||
parser.add_argument("-d", "--downgrade", help="Launch the app", action="store_true") | ||
args = parser.parse_args() | ||
|
||
|
||
if args.migrate: | ||
subprocess.call(["flask", "db", "migrate"]) | ||
elif args.upgrade: | ||
subprocess.call(["flask", "db", "upgrade"]) | ||
elif args.downgrade: | ||
subprocess.call(["flask", "db", "downgrade"]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.