diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 06bca5aa6..970508902 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.3.3 +current_version = 2.3.4 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-(?P.*)-(?P\d+))? diff --git a/README.md b/README.md index 748d44af9..af40ae346 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

Incident Response Investigation System
- Current Version v2.3.3 + Current Version v2.3.4
Online Demonstration

@@ -52,7 +52,7 @@ git clone https://github.com/dfir-iris/iris-web.git cd iris-web # Checkout to the last tagged version -git checkout v2.3.3 +git checkout v2.3.4 # Copy the environment file cp .env.model .env diff --git a/docker-compose.yml b/docker-compose.yml index 4d569c6f2..5b1aee24b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,7 +27,7 @@ services: build: context: docker/db container_name: iriswebapp_db - image: iriswebapp_db:v2.3.3 + image: iriswebapp_db:v2.3.4 restart: always # Used for debugging purposes, should be deleted for production ports: @@ -47,7 +47,7 @@ services: build: context: . dockerfile: docker/webApp/Dockerfile - image: iriswebapp_app:v2.3.3 + image: iriswebapp_app:v2.3.4 container_name: iriswebapp_app command: ['nohup', './iris-entrypoint.sh', 'iriswebapp'] volumes: @@ -85,7 +85,7 @@ services: build: context: . dockerfile: docker/webApp/Dockerfile - image: iriswebapp_app:v2.3.3 + image: iriswebapp_app:v2.3.4 container_name: iriswebapp_worker command: ['./wait-for-iriswebapp.sh', 'app:8000', './iris-entrypoint.sh', 'iris-worker'] volumes: @@ -121,7 +121,7 @@ services: args: NGINX_CONF_GID: 1234 NGINX_CONF_FILE: nginx.conf - image: iriswebapp_nginx:v2.3.3 + image: iriswebapp_nginx:v2.3.4 container_name: iriswebapp_nginx environment: - IRIS_UPSTREAM_SERVER diff --git a/source/app/alembic/versions/d207b4d13385_add_severity_to_cases.py b/source/app/alembic/versions/d207b4d13385_add_severity_to_cases.py new file mode 100644 index 000000000..ac899b7ee --- /dev/null +++ b/source/app/alembic/versions/d207b4d13385_add_severity_to_cases.py @@ -0,0 +1,51 @@ +"""Add severity to cases + +Revision ID: d207b4d13385 +Revises: d6c49c5435c2 +Create Date: 2023-11-28 11:50:08.136090 + +""" +from alembic import op +import sqlalchemy as sa + +from app.alembic.alembic_utils import _table_has_column + +# revision identifiers, used by Alembic. +revision = 'd207b4d13385' +down_revision = 'd6c49c5435c2' +branch_labels = None +depends_on = None + + +def upgrade(): + if not _table_has_column('cases', 'severity_id'): + op.add_column( + 'cases', + sa.Column('severity_id', sa.Integer, sa.ForeignKey('severities.severity_id'), nullable=True) + ) + + op.create_foreign_key( + None, 'cases', 'severities', ['severity_id'], ['severity_id'] + ) + + conn = op.get_bind() + # Create the new severity if it doesn't exist already - we check first + res = conn.execute( + "SELECT severity_id FROM severities WHERE severity_name = 'Medium'" + ).fetchone() + + if res is None: + conn.execute( + "INSERT INTO severities (severity_name, severity_description) VALUES ('Medium', 'Medium')" + ) + + # Update the severity of all cases to the default severity + conn.execute( + "UPDATE cases SET severity_id = (SELECT severity_id FROM severities WHERE severity_name = 'Medium')" + ) + + pass + + +def downgrade(): + pass diff --git a/source/app/alembic/versions/d6c49c5435c2_add_evidence_type_to_evidences.py b/source/app/alembic/versions/d6c49c5435c2_add_evidence_type_to_evidences.py new file mode 100644 index 000000000..9a396fb4f --- /dev/null +++ b/source/app/alembic/versions/d6c49c5435c2_add_evidence_type_to_evidences.py @@ -0,0 +1,68 @@ +"""Add evidence type to evidences + +Revision ID: d6c49c5435c2 +Revises: 3a4d4f15bd69 +Create Date: 2023-11-06 15:29:14.435562 + +""" +from alembic import op +import sqlalchemy as sa + +from app.alembic.alembic_utils import _table_has_column + +# revision identifiers, used by Alembic. +revision = 'd6c49c5435c2' +down_revision = '3a4d4f15bd69' +branch_labels = None +depends_on = None + + +def upgrade(): + if not _table_has_column('case_received_file', 'type_id'): + + op.add_column( + 'case_received_file', + sa.Column('type_id', sa.Integer, sa.ForeignKey('evidence_type.id'), nullable=True) + ) + + op.create_foreign_key( + None, 'case_received_file', 'evidence_type', ['type_id'], ['id'] + ) + + if not _table_has_column('case_received_file', 'acquisition_date'): + + op.add_column( + 'case_received_file', + sa.Column('acquisition_date', sa.DateTime, nullable=True), + + ) + + if not _table_has_column('case_received_file', 'start_date'): + + op.add_column( + 'case_received_file', + sa.Column('start_date', sa.DateTime, nullable=True), + + ) + + if not _table_has_column('case_received_file', 'end_date'): + + op.add_column( + 'case_received_file', + sa.Column('end_date', sa.DateTime, nullable=True), + + ) + + if not _table_has_column('case_received_file', 'chain_of_custody'): + + op.add_column( + 'case_received_file', + sa.Column('chain_of_custody', sa.JSON, nullable=True), + + ) + + pass + + +def downgrade(): + pass diff --git a/source/app/blueprints/alerts/templates/alerts.html b/source/app/blueprints/alerts/templates/alerts.html index d5e18f99e..a5d03519f 100644 --- a/source/app/blueprints/alerts/templates/alerts.html +++ b/source/app/blueprints/alerts/templates/alerts.html @@ -57,6 +57,7 @@ Merged + @@ -260,7 +261,10 @@ True positive with impact - +
diff --git a/source/app/blueprints/case/case_rfiles_routes.py b/source/app/blueprints/case/case_rfiles_routes.py index c8d5e25d1..29ccec136 100644 --- a/source/app/blueprints/case/case_rfiles_routes.py +++ b/source/app/blueprints/case/case_rfiles_routes.py @@ -81,7 +81,7 @@ def case_list_rfiles(caseid): crf = get_rfiles(caseid) ret = { - "evidences": [row._asdict() for row in crf], + "evidences": CaseEvidenceSchema().dump(crf, many=True), "state": get_evidences_state(caseid=caseid) } @@ -111,8 +111,8 @@ def case_add_rfile(caseid): evidence = evidence_schema.load(request_data) crf = add_rfile(evidence=evidence, - user_id=current_user.id, - caseid=caseid + user_id=current_user.id, + caseid=caseid ) crf = call_modules_hook('on_postload_evidence_create', data=crf, caseid=caseid) diff --git a/source/app/blueprints/case/case_routes.py b/source/app/blueprints/case/case_routes.py index 1e79a46bc..63fe4c38c 100644 --- a/source/app/blueprints/case/case_routes.py +++ b/source/app/blueprints/case/case_routes.py @@ -67,7 +67,7 @@ from app.models import UserActivity from app.models.authorization import CaseAccessLevel from app.models.authorization import User -from app.schema.marshables import TaskLogSchema, CaseSchema +from app.schema.marshables import TaskLogSchema, CaseSchema, CaseDetailsSchema from app.util import ac_api_case_requires, add_obj_history_entry from app.util import ac_case_requires from app.util import ac_socket_requires @@ -245,6 +245,13 @@ def export_case(caseid): return response_success('', data=export_case_json(caseid)) +@case_blueprint.route("/case/meta", methods=['GET']) +@ac_api_case_requires(CaseAccessLevel.read_only, CaseAccessLevel.full_access) +def meta_case(caseid): + case_details = get_case(caseid) + return response_success('', data= CaseDetailsSchema().dump(case_details)) + + @case_blueprint.route('/case/tasklog/add', methods=['POST']) @ac_api_case_requires(CaseAccessLevel.full_access) def case_add_tasklog(caseid): diff --git a/source/app/blueprints/case/templates/case.html b/source/app/blueprints/case/templates/case.html index ee8fe5239..68e4f06a3 100644 --- a/source/app/blueprints/case/templates/case.html +++ b/source/app/blueprints/case/templates/case.html @@ -23,47 +23,53 @@
-

{{ case.name|unquote }} -

+
+

{{ case.name|unquote }} +

+
-
Open on {{ case.open_date }} by {{ case.user.name }}
-
Owned by {{ case.owner.name }}
- {% if case.close_date %} -
Closed on {{ case.close_date }}
- {% endif %} - -
-
-
- {{ case.status_name }} +
+
+
Open on {{ case.open_date }} by {{ case.user.name }}
+
Owned by {{ case.owner.name }}
+ {% if case.close_date %} +
Closed on {{ case.close_date }}
+ {% endif %}
-
-
-
-
Customer : {{ case.client.name }}
+
+
+ {% if case.severity %} {{ case.severity.severity_name }}{% endif %} + {{ case.status_name }} +
+
+
+
+
Customer : {{ case.client.name }}
+
+
+ {% if case.soc_id %}
SOC ID : {{ case.soc_id }}
{% endif %} +
-
- {% if case.soc_id %}
SOC ID : {{ case.soc_id }}
{% endif %} -
+
- {% if case.state %}
{{ case.state.state_name }}
{% endif %} + {% if case.state %}
{{ case.state.state_name }}
{% endif %} {% if case.classification %}
{{ case.classification.name_expanded }}
{% endif %} - {% if case.alerts| length > 0 %}
{{ case.alerts| length }} related alerts
{% endif %} + {% if case.alerts| length > 0 %}
{{ case.alerts| length }} related alerts
{% endif %} {% if case.review_status.status_name == "Reviewed" %}
Case reviewed by {% if case.reviewer.id == current_user.id %} you {% else %} {{ case.reviewer.name }} {% endif %}
{% endif %}
-
+
{% if case.case_tags %} {% for tag in case.case_tags %} {{ tag }} diff --git a/source/app/blueprints/case/templates/case_assets.html b/source/app/blueprints/case/templates/case_assets.html index da89d142f..64a2cf434 100644 --- a/source/app/blueprints/case/templates/case_assets.html +++ b/source/app/blueprints/case/templates/case_assets.html @@ -11,7 +11,7 @@
{% if current_user.is_authenticated %} {{ form.hidden_tag() }} -