If you wish to develop in DFIR-IRIS, please make sure to read the following tips.
The project adheres to semantic versioning, see: https://semver.org/.
The workflow is based on the evolution of the following branches:
master and develop,master points to the most recent delivered version,develop,develop and hotfix branches out of master.Delivered versions are tagged with their number, for instance v2.4.11, v2.1.0-beta-1.
The operations which make up the workflow are the following:
develop
git switch develop
git switch develop
git switch -c <branch-name>
git push --set-upstream origin <branch-name>
develop as the base branch (by default it is set to master,
more information here).develop simpler.
git switch -c <branch-name>
git rebase origin/develop
develop is ready to be delivered, it is tagged with the next version number (major, minor or patch), and merged into mastermastermaster.
The modification is brought back into develop by a merge or cherry-pick.Note: for the time being, there is no maintenance on old delivered versions.
Try to follow the repository convention:
[action] Commit message, with action being a 3 letters action related to the commit, eg ADDfor additions, DEL for deletions, IMP for improvements, etc.[#issue_id][action] Commit messageNew files should be prefixed by the following license header, where ${current_year} is replaced by the current year
(for instance 2024):
# IRIS Source Code
# Copyright (C) ${current_year} - DFIR-IRIS
# contact@dfir-iris.org
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
python
#!/usr/bin/env python3
format method (https://podalirius.net/en/articles/python-format-string-vulnerabilities/)iocs_create instead of createpython
from app import app, db
with
python
from app import app
from app import db
=== instead of ==!== instead of !=The code should be pretty easy to apprehend. It's not perfect, but it will improve over time.
Some documentation about development is available here.
Here are the main takes :
source > app > blueprints. A route providing a web page (i.e non API) relies on templates.
Each page template is present in the templates directory of the target route.source > app > datamgmt.templates directory of the corresponding route. These templates are based on layouts, which are defined in source > app > templates.ui > public > assets and ui > src for our own JS code.If your code implies database changes, please create an alembic migration script.
alembic -c app/alembic.ini revision -m <What's changed>
And then modifies the script in source > app > alembic so that the migration can be done automatically.