Skip to main content

Cyber Risk Modeling Language (CRML) tools and validator

Project description

CRML — Cyber Risk Modeling Language

PyPI version Python 3.7+ License: MIT

Version: 1.1
Maintained by: Zeron Research Labs

CRML is an open, declarative, implementation-agnostic language for expressing cyber risk models, telemetry mappings, simulation pipelines, dependencies, and output requirements.

CRML is designed for:

  • Bayesian cyber risk models (QBER, MCMC-based)
  • FAIR-style Monte Carlo engines
  • Insurance actuarial risk systems
  • Enterprise cyber risk quantification platforms
  • Regulatory or audit-ready risk engines

✨ Key Features

  • 🛡️ Control Effectiveness Modeling - Quantify how security controls reduce risk with defense-in-depth calculations
  • 📊 Intuitive Median-Based Parameterization - Use median directly instead of log-space mu for lognormal distributions
  • 💱 Multi-Currency Support - Model risks across different currencies with automatic conversion (15+ currencies supported)
  • 🔄 Auto-Calibration - Provide raw loss data and let CRML calibrate distributions automatically
  • ✅ Strict Validation - JSON Schema validation catches errors before simulation
  • 🎯 Implementation-Agnostic - Works with any compliant simulation engine
  • 📝 Human-Readable YAML - Models are easy to read, review, and audit

📦 Installation

Install CRML from PyPI:

pip install crml-lang

🚀 Quick Start

Validate a CRML File

crml validate path/to/your/model.yaml

Example

crml validate spec/examples/qber-enterprise.yaml

Output:

[OK] spec/examples/qber-enterprise.yaml is a valid CRML 1.1 document.

Model Security Controls

New in CRML 1.1: Quantify how security controls reduce cyber risk.

model:
  frequency:
    model: poisson
    parameters:
      lambda: 0.15  # 15% baseline probability
  
  controls:
    layers:
      - name: "email_security"
        controls:
          - id: "email_filtering"
            type: "preventive"
            effectiveness: 0.90  # Blocks 90% of attacks
            coverage: 1.0
            reliability: 0.95
      
      - name: "endpoint_protection"
        controls:
          - id: "edr"
            type: "detective"
            effectiveness: 0.80
            coverage: 0.98
  
  severity:
    model: lognormal
    parameters:
      median: "700 000"
      currency: USD
      sigma: 1.8

Result: Risk reduced from 15% to ~3.5% (76% reduction!)

See docs/controls-guide.md for detailed guidance.

📁 Repository Layout

  • spec/ — CRML specification and example models
  • src/crml/ — Python package source code (validator, CLI)
  • src/crml/schema CRML json schema
  • tools/ — Legacy validator and CLI utilities
  • docs/ — Documentation, roadmap, and diagrams

🛠️ Development

Install from Source

git clone https://github.com/Faux16/crml.git
cd crml
pip install -e .

Run Validator Directly

python tools/validator/crml_validator.py spec/examples/qber-enterprise.yaml

📖 Documentation

For detailed documentation, examples, and the full specification, visit the docs/ directory or check out the specification.

🤝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

📄 License

MIT License — see LICENSE for details.

🔗 Links


Maintained by Zeron Research Labs | Website | Contact

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crml_lang-1.1.0.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crml_lang-1.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file crml_lang-1.1.0.tar.gz.

File metadata

  • Download URL: crml_lang-1.1.0.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.67.1 importlib-metadata/8.0.0 keyring/25.7.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.6

File hashes

Hashes for crml_lang-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d23b15144c2d6cfddd29c6ccc040e778ee0b59b160b91292fdb1122a7e40a9c6
MD5 60d682de47dae44399cbe173f5958607
BLAKE2b-256 0013c45ac63fe568e2de393a5290d13f017a933485e5edba77c3fcc12bad9f71

See more details on using hashes here.

File details

Details for the file crml_lang-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: crml_lang-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.67.1 importlib-metadata/8.0.0 keyring/25.7.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.6

File hashes

Hashes for crml_lang-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16bb902b000c1a4a3d6fc6211f51de9b5aa4360c735ab3c66b3bf3413e379a06
MD5 479188d6efd4e74e972b775fea6cbdb1
BLAKE2b-256 ace6c01b817198d57733e08694bd2b4969a12563483f165a30fa6f4b113f423a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page