@cryptotaxi247 / CoPilot / commits / 5635aae6

precommit and dfir_iris_client

Taylor committed Jul 10, 2023 at 22:08 UTC 5635aae6f5e0ff9e15c4e601b77c732ea766a91e
4 files changed +3 -88
backend/app/models/agents.py
+1 -1
@@ -1,7 +1,7 @@
1 # from datetime import datetime
2
3 # from loguru import logger
4 -from sqlalchemy.dialects.postgresql import JSONB # Add this line
4 +# from sqlalchemy.dialects.postgresql import JSONB # Add this line
5
6 from app import db
7 from app import ma
backend/app/models/rules.py
+1 -1
@@ -4,7 +4,7 @@ from app import db
4 from app import ma
5
6 # from loguru import logger
7 -from sqlalchemy.dialects.postgresql import JSONB # Add this line
7 +# from sqlalchemy.dialects.postgresql import JSONB # Add this line
8
9
10 # Class for the disabled rule IDs which will store the rule ID, previous configuration, new configuration, reason for
backend/app/routes/graylog.py.isorted deleted
-86
@@ -1,86 +0,0 @@
1 -from flask import Blueprint
2 -from flask import jsonify
3 -
4 -from app.services.Graylog.index import IndexService
5 -from app.services.Graylog.inputs import InputsService
6 -from app.services.Graylog.messages import MessagesService
7 -from app.services.Graylog.metrics import MetricsService
8 -
9 -# from loguru import logger
10 -
11 -
12 -bp = Blueprint("graylog", __name__)
13 -
14 -
15 -@bp.route("/graylog/messages", methods=["GET"])
16 -def get_messages():
17 - """
18 - Endpoint to collect the latest 10 messages from Graylog.
19 -
20 - Returns:
21 - json: A JSON response containing the list of all the messages.
22 - """
23 - service = MessagesService()
24 - messages = service.collect_messages()
25 - return messages
26 -
27 -
28 -@bp.route("/graylog/metrics", methods=["GET"])
29 -def get_metrics():
30 - """
31 - Endpoint to collect Graylog metrics.
32 -
33 - Returns:
34 - json: A JSON response containing the list of all metrics
35 - """
36 - service = MetricsService()
37 - uncommitted_journal_size = service.collect_uncommitted_journal_size()
38 - metrics = service.collect_throughput_metrics()
39 - return jsonify(
40 - {"uncommitted_journal_size": uncommitted_journal_size, "metrics": metrics},
41 - )
42 -
43 -
44 -@bp.route("/graylog/indices", methods=["GET"])
45 -def get_indices():
46 - """
47 - Endpoint to collect Graylog indices.
48 -
49 - Returns:
50 - json: A JSON response containing the list of all indices
51 - """
52 - service = IndexService()
53 - indices = service.collect_indices()
54 - return indices
55 -
56 -
57 -@bp.route("/graylog/indices/<index_name>/delete", methods=["DELETE"])
58 -def delete_index(index_name):
59 - """
60 - Endpoint to delete a Graylog index.
61 -
62 - Args:
63 - index_name (str): The name of the index to be deleted.
64 -
65 - Returns:
66 - json: A JSON response containing the result of the deletion.
67 - """
68 - service = IndexService()
69 - result = service.delete_index(index_name)
70 - return result
71 -
72 -
73 -@bp.route("/graylog/inputs", methods=["GET"])
74 -def get_inputs():
75 - """
76 - Endpoint to collect Graylog inputs.
77 -
78 - Returns:
79 - json: A JSON response containing the list of all inputs
80 - """
81 - service = InputsService()
82 - running_inputs = service.collect_running_inputs()
83 - configured_inputs = service.collect_configured_inputs()
84 - return jsonify(
85 - {"running_inputs": running_inputs, "configured_inputs": configured_inputs},
86 - )
backend/requirements.in
+1
@@ -1,4 +1,5 @@
1 blueprint
2 +dfir_iris_client
3 elasticsearch7==7.10.1
4 environs
5 flask