Skip to content

Architecture

Augustin FL edited this page Jul 30, 2024 · 2 revisions

FIR is coded using Django, which is an MVC (model-view-controller)-oriented framework. This is what the Django tree structure looks like for FIR:

fir
├── fir_alerting                         # Alerting plugin (sending context-aware emails from FIR)
├── fir_artifacts                        # Artifacts plugin (extract forensic artifacts - IPs, hostnames, etc.)
├── fir_nuggets                          # FIR Nuggets (forensic investigation data)
├── fir_plugins                          # FIR plugins (necessary core for plugins)
├── fir_todos                            # Plugin to attribute tasks to users / BLs
├── db.sqlite3                           # Dev. database
├── fir
│   ├── config                           # different configuration environments & installed_apps.txt
│   ├── settings.py
│   ├── urls.py                          # base URLs routing for application 
│   ├── wsgi.py
├── incidents
│   ├── static
│   │   ├── css                              # bootstrap CSS
│   │   ├── custom_css                       # Custom CSS
│   │   ├── custom_js                        # Custom JS
│   │   ├── fonts                            # fonts
│   │   ├── img                              # images
│   │   ├── js                               # bootstrap JS
│   │   ├── momentjs                         # Time display JS
│   │   └── select                           # Select widget CSS / JS
│   ├── admin.py                         # various admin settings
│   ├── custom_urls 
│   ├── fixtures                         # initial data
│   ├── forms.py                         # Forms
│   ├── migrations                       # DB migrations
│   │   └── <files>
│   ├── models.py                        # Database models
│   ├── tests.py
│   ├── urls.py                          # more URL routing
│   └── views.py                         # Controller
├── LICENSE
├── logs
├── manage.py                            # Django manager
├── README.md
├── requirements-dev.txt                 # PIP install requirements (development)
├── requirements.txt                     # PIP install requirements
├── templates                            # Directory containing HTML files used throughout the application
│   └── <directories>
└── uploads                              # Directory containing files uploaded via FIR
    └── <directories>

Where the magic happens

The templates directory and views.py and models.py files are the main files of the Django MVC model. 90% of the core-development occurs in these files. In the MVC model, files correspond to:

  • models.py – The data model. Here are defined the "objects" that will compose FIR's database. These will later be manipulated in the controller, and displayed in the templates.
  • templates – It contains the HTML templates (the view of the MVC) that are populated with information returned from the controller and sent to the user's browser.
  • views.py – The controler (and not the view, as its name would imply) is the connector between the model and the templates. It interprets requests received by the web application, requests the model for information, and sends a rendered template back to the browser.
Clone this wiki locally