-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MRG] Merge pull request #335 from dfir-iris/v2.3.4-fb
Patch v2.3.4
- Loading branch information
Showing
48 changed files
with
2,013 additions
and
582 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
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
51 changes: 51 additions & 0 deletions
51
source/app/alembic/versions/d207b4d13385_add_severity_to_cases.py
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,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 |
68 changes: 68 additions & 0 deletions
68
source/app/alembic/versions/d6c49c5435c2_add_evidence_type_to_evidences.py
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,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 |
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
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
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.