Skip to main content

MACSFIRE Core Engine

Official developer documentation for the MACSFIRE (Model-Based Avionics Cybersecurity Framework for Identification of Risk and Evaluation) Core Engine.

🎯 Overview

This repository houses the mathematical and logical core of the MACSFIRE Security Risk Assessment (SRA) engine. Designed as a modular, domain-driven standalone library, it processes complex architectural topologies, calculates threat propagation vectors, and evaluates residual risk for avionics architectures aligned with RTCA DO-326A / ED-202A and DO-356A / ED-203A standards.

Because the engine is fully decoupled from the presentation layer, it can be seamlessly integrated into interactive dashboards, automated CI/CD security evaluation pipelines, or headless analytical scripts.


🏗️ Core Architecture & Package Structure

The engine is strictly organized into decoupled, domain-driven packages handling model transformation, graph-theoretic propagation, formal theorem proving, and global optimization.

macsfire/
├── domain/            # Foundational Data Models & Domain Enums
├── engine/            # Core Risk Assessment, Traversal & Propagation Logic
├── adapters/          # Architecture Model Importers (OAAM, IR Transformation)
├── verification/      # Z3 SMT Formal Theorem Prover for DO-326A Scopes
├── solvers/           # CP-SAT Global Security Architecture Optimizer
├── quantification/    # Game-Theoretic & Dynamic NVD Risk Assessment
├── api_server/        # Flask REST API & Headless Listener Service
├── ui/                # Streamlit Interactive Dashboard
├── unittests/         # Comprehensive Automated Test Suite
└── utility.py         # Helper Utilities, LaTeX Rendering & Graph Visualizers

📦 Module Breakdown

1. macsfire.domain (Domain Data Layer)

Contains pure, thread-safe data structures and domain definitions.

  • base.py: Generic in-memory database abstraction (Database[T]) with O(1) indexing and federated identity mixins (ExternalIdentifiable).
  • elements.py: Fundamental system topology nodes (Asset, AssetDB) and connections (Connection, IntConnection, LogicalConnection, SignalConnection).
  • enums.py: Strict type definitions (CIA attributes, Asset Types, Severity tiers, Protection Effectiveness scales, SAL levels, Privilege Levels).
  • risk.py: Risk-specific entities (Threat, FailureCondition, ThreatCondition, CybersecurityNeeds, LevelOfProtection).
  • scope.py: DO-326A perimeter mappings (SecurityPerimeter, SecurityEnvironment, SecurityScope, PreCondition, PostCondition).
  • security.py: Defensive measures (SecurityMeasure, SecurityMeasureInstance) including DO-356A effectiveness scoring.

2. macsfire.engine (Evaluation & Execution Engine)

Orchestrates path traversal, logic gate resolution, and risk calculation.

  • sra.py: The main SRA execution controller. Manages scenario evaluations, severity inheritance, statistics, and LaTeX/Excel artifact generation.
  • scenario.py: Generates and manages individual ThreatScenario instances targeting specific failure conditions.
  • topology.py: Graph-theory algorithms built on NetworkX to compute topological attack paths and cutsets.
  • logic.py: Boolean DNF (Disjunctive Normal Form) reduction and minimum cutset derivation for system failure conditions.
  • propagation/: Extensible threat propagation engine containing CIA flow simulations (RealisticCiaPropagationLayer), DSML kill-chain evaluation (FullKillChainPropagationLayer), and OAAM rule models (OaamPropagationModel).

3. macsfire.adapters (Model Transformation)

Intermediate Representation (IR) layer decoupling external modeling tools from the MACSFIRE core.

  • base.py: Abstract adapter contract (AbstractModelAdapter) and IR dataclasses (NodeIR, EdgeIR, ThreatIR, ScopeIR).
  • oaam/: Importer and adapter for Object-Oriented Architecture Models (.oaam) using eoq2 and pyecore.

4. macsfire.verification (Formal Scope Verification)

  • scope_evaluator.py & formal.py: Translates DO-326A scope Assume-Guarantee contracts into SMT formulas and executes formal proofs via the Z3 Theorem Prover.

5. macsfire.solvers (Global Architecture Optimization)

  • optimization.py: Solves multi-objective optimization problems using Google OR-Tools (CP-SAT) to select cost-optimal security measures while guaranteeing DO-356A score capping and mandatory SAL constraints.

6. macsfire.api_server & macsfire.services & macsfire.ui

  • api.py: Flask REST API providing asynchronous execution boundaries, model uploads, and live memory inspection.
  • listener.py: Headless event-driven listener for automated loop calculations.
  • dashboard.py: Interactive Streamlit web interface for 3D topology visualization, database inspection, and scenario simulation.

🧪 Testing

Run the automated unittest suite with pytest:

# Run all unit tests
pytest unittests/ -v

Release files for macsfire 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macsfire 1.0.0
File Size Uploaded
macsfire-1.0.0.tar.gz 3.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for macsfire 1.0.0
File Interpreter ABI Platform
macsfire-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 MB

Release files / macsfire-1.0.0.tar.gz

Download URL macsfire-1.0.0.tar.gz
Size 3.4 MB
Tags Source
SHA-256 checksum
How to use checksums
5355b11d6fe9d33dd7eef23d72c1c03f60dd15b184087d973e7eae0621659801
BLAKE2b-256 checksum
How to use checksums
a375bd86c5e7ffbc05355f516a1afc3e28f64c6ea71468cd34bb2a23f5516db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / macsfire-1.0.0-py3-none-any.whl

Download URL macsfire-1.0.0-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
121ee9ec62a1d5e036b29ce087cadab0e9dddebcae9ba69fcddc9fb06d9dde37
BLAKE2b-256 checksum
How to use checksums
92a8e2fcc85b0d52c4f5c89b704b9dedb9343fb89e4b616bceffb3d1b67eb964
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page