README - edamametechnologies/threatmodels GitHub Wiki
- Overview
- Database Generation and Management
- Threat Dimensions
- Naming Conventions
- Model Structure
- Implementation Types
- How to Develop and Test Threat Models
- Platform Coverage
- Security Assessment
- Privacy Protection
- Additional Features
- Score Calculator
- EDAMAME Ecosystem
This repository contains the threat models used by the EDAMAME Security application to compute its Security Score. These models are based on industry-standard benchmarks including NIST and CIS, as well as other authoritative sources.
The EDAMAME Security platform leverages these models to provide comprehensive security posture assessment while ensuring user privacy and preventing administrative overreach.
EDAMAME Security relies on several specialized databases that power its detection capabilities. These databases are maintained through a combination of automated scripts and manual curation to ensure accuracy and relevance.
The lanscan-port-vulns-db.json database catalogs vulnerabilities associated with TCP ports. This database is automatically generated and updated using the build-port-vulns-db.py script which:
- Retrieves port service descriptions from Nmap's service database
- Queries the MITRE CVE database for vulnerabilities associated with each port
- Filters vulnerabilities to include only those from the past 5 years
- Verifies that vulnerability descriptions explicitly mention the port
- Adds metadata including service names, descriptions, and protocol information
- Generates a cryptographic signature for database integrity verification
The database is updated monthly via a scheduled GitHub Actions workflow (.github/workflows/update_vulns_db.yml).
The port vulnerability database enables EDAMAME Security to identify potentially vulnerable services running on endpoints within a network scan.
Similarly, the lanscan-vendor-vulns-db.json database tracks vulnerabilities associated with hardware vendors. It is generated by build-vendor-vulns-db.py which:
- Retrieves vendor information from Wireshark's OUI database
- Processes and normalizes vendor names for consistent matching
- Queries the MITRE CVE database for vulnerabilities associated with each vendor
- Retains only recent CVEs (past 4 years)
- Organizes vulnerabilities by vendor with appropriate metadata
- Signs the database for integrity verification
Like the port vulnerability database, this database is updated monthly via the same GitHub Actions workflow (.github/workflows/update_vulns_db.yml).
This database helps EDAMAME Security evaluate potential risks associated with specific hardware vendors detected on the network.
The lanscan-profiles-db.json file contains rules for identifying device types based on their network characteristics. Unlike the vulnerability databases, this is primarily maintained manually to ensure accurate device type identification. The database:
- Defines device types (printers, routers, IoT devices, etc.)
- Contains logical rules for identifying each device type based on:
- Open ports
- mDNS service advertisements
- Vendor information
- Hostnames
- Service banners
- Implements complex condition trees using AND/OR logical operators
- Supports negation of conditions for more precise matching
Evaluation semantics:
- Rules are evaluated strictly in the JSON order; the engine returns the first matching
device_type(first-match-wins). - To avoid ambiguous classifications, design rules so only one
device_typematches a given device. The validation script flags overlapping matches across multiple device types.
This database powers EDAMAME Security's device identification capabilities, allowing it to recognize and categorize devices on local networks.
The whitelists-db.json database defines allowable network connections for different environments and scenarios. It contains:
- Base whitelists for essential EDAMAME functionality
- Specialized whitelists for development and CI/CD environments
- Platform-specific whitelists (macOS, Linux, Windows)
- Hierarchical definitions with inheritance support
Currently, the database defines the following key whitelists:
-
edamame: Base list for core application connections (backend APIs, analytics, IP services). -
builder: Extendsedamamefor development environments (package repositories, cloud services, CDNs). -
github: Extendsbuilderfor GitHub-related connections (GitHub domains, Azure IPs for Actions). -
github_macos,github_ubuntu,github_windows: Extendgithubwith platform-specific connections needed in CI/CD environments (e.g., Homebrew/Apple services for macOS, Ubuntu/Microsoft repositories for Linux).
The sensitive-paths-db.json database defines file paths that indicate credential stores, secrets, and other high-value targets on a host. The EDAMAME vulnerability detector correlates these paths with network session data in three ways:
-
token_exfiltration: Fires when an anomalous session (flagged by the iForest anomaly detector) has sensitive files open. -
skill_supply_chain: Fires when a blacklisted session (known-bad IP) has sensitive files open. -
credential_harvest: Fires when any session (regardless of anomaly score) has sensitive files spanning >= N distinct label categories (default N=3, configurable viacredential_harvest_min_labelsincve-detection-params-db.json). This catch-all detects supply chain malware that uses normal-looking traffic patterns to exfiltrate harvested credentials.
The database contains three sections:
-
common_patterns: Cross-platform paths matched against L7open_filesin captured sessions. Covers SSH keys, cloud credentials (AWS, GCP, Azure), container configs (Docker, Kubernetes), package manager tokens (npm, PyPI), database credentials (PostgreSQL, MySQL), secret managers (Vault), git credentials, browser credential stores, cryptocurrency wallets, and environment files. -
labels: Semantic groupings of paths (e.g.ssh,aws,gcp,vault,crypto) used by the vulnerability detector to classify which credential categories a process is accessing. The label count drives thecredential_harvestcheck: multi-label findings (e.g. ssh + aws + kube simultaneously) indicate broad credential harvesting such as supply chain infostealers. -
platform_patterns: OS-specific paths (e.g./etc/shadowon Linux, Keychain on macOS, SAM/NTDS on Windows, crypto wallet Application Support / AppData paths).
The path list is informed by real-world supply chain attacks including the litellm 1.82.8 PyPI compromise (March 2026), AMOS infostealer campaigns, and MCPTox tool poisoning research.
This database is maintained manually. After editing, run python3 src/publish/update-models.py sensitive-paths-db.json to refresh the date and signature.
The cve-detection-params-db.json database stores check metadata and tuning parameters for the EDAMAME vulnerability detector. It is a cloud model updated via the same signature mechanism as other databases. Key contents:
-
checks: Metadata (description template, severity, reference) for each vulnerability check:token_exfiltration,skill_supply_chain,credential_harvest,sandbox_exploitation,file_system_tampering, andsensitive_material_egress. -
credential_harvest_min_labels: Minimum number of distinct credential label categories a process must access to trigger thecredential_harvestfinding (default: 3). This threshold can be tuned without shipping a new binary. -
secret_content_scan_max_bytes/secret_content_min_hits/recent_sensitive_open_file_ttl_secs: Tunables for secret-like content scanning and how long recent sensitive open-file evidence remains eligible for correlation. -
ci_runner_process_name_prefixes: CI provisioning daemon name prefixes (for exampleprovjobd) that the sandbox lineage detector may suppress when the matching process is also running from a suspicious temp lineage on ephemeral build hosts. -
suspicious_parent_path_patterns: Path prefixes that triggersandbox_exploitation(for example/tmp/,/var/tmp/,\Temp\). -
generic_reuse_tokens/generic_application_tokens: Tokens filtered from process identity during finding deduplication and self-access suppression. -
init_process_names: Process names excluded from sandbox lineage checks (e.g.launchd,systemd). -
benign_temp_artifact_suffixes: File suffixes treated as routine FIM churn unless the writing process lineage is suspicious. -
application_storage_patterns/packaged_application_*_patterns: App-owned storage roots and install-layout heuristics used for self-access suppression. -
credential_store_patterns: Platform-specific credential-store path buckets for Keychain, keyring, KWallet, and Windows Vault detection. -
trusted_credential_helpers: Configurable allowlists for platform credential helpers and system daemons (for examplesecurityd,assistantd,CommCenter,networkserviceproxy) so benign OS maintenance can be tuned from the model instead of hardcoded in Rust.
After editing, run python3 src/publish/update-models.py cve-detection-params-db.json to refresh the date and signature, then update the fallback embed in edamame_foundation/src/cve_detection_params_db.rs.
The blacklists-db.json database catalogs known malicious or unwanted IP addresses and ranges sourced from public blocklists. This database is automatically generated and updated by the build-blacklists.py script, which:
- Downloads IP lists from predefined sources. Currently, it uses the
firehol_level1list (https://raw.githubusercontent.com/ktsaou/blocklist-ipsets/master/firehol_level1.netset), known for basic protection with minimal false positives. - Parses the downloaded content, removing comments and extracting IP addresses or CIDR ranges.
- Structures the data, including metadata such as the source URL, description, and last update time for each list.
- Stores the collected IP ranges within the JSON structure.
- Generates a cryptographic signature based on the blacklist content for integrity verification.
The database is updated daily via a scheduled GitHub Actions workflow (.github/workflows/update_blacklists_db.yml).
This database enables EDAMAME Security to identify connections to potentially harmful IP addresses.
All EDAMAME databases include:
- A timestamp (
date) indicating when they were last updated (format:Month DDth YYYY) - A cryptographic signature (
signature) for integrity verification, plus a.sigsidecar file containing the same value - A structured format that supports easy parsing and validation
Validation and update rules:
- The validator recomputes the signature by hashing the JSON with the
signaturefield blanked (sorted keys) and compares it to the stored value and.sigsidecar.
Important – manual step required: after any change to a database or threat-model JSON file, you must run the update script locally before committing:
python3 src/publish/update-models.py <file1.json> [file2.json ...]This script refreshes the date, recomputes the cryptographic signature, and writes/updates the .sig side-car file. The CI validation workflow will fail if these values are stale or missing.
These databases are designed to be updated seamlessly from trusted sources while maintaining user privacy and security.
Security threats are categorized along 5 key dimensions:
| Dimension | Description |
|---|---|
| Applications | Application authorizations, EPP/antivirus, ... |
| Network | Network configuration, exposed services, ... |
| Credentials | Password policies, biometrics, 2FA, ... |
| System Integrity | MDM profiles, jailbreaking, 3rd party administrative access, ... |
| System Services | System configuration, service vulnerabilities, ... |
Threat names follow these conventions:
- Describe the threat directly (not its remediation)
- No hyphens (
-) - Spaces are preferred over underscores (
_) - No special characters
- Lowercase except for acronyms and commercial names
- Example:
Chrome not uptodate
Each threat model is structured as a JSON file that defines:
- Threat metadata: Information about the threat, including its name, description, severity, and impact
- Detection logic: The checks and conditions used to detect the presence of the threat
- Remediation guidance: Recommended actions to mitigate the threat
- References: Links to standards, benchmarks, and other sources of information
Each threat model file follows a standardized format:
{
"name": "threat model [Platform]",
"extends": "none",
"date": "Last update date",
"signature": "Cryptographic signature of the model",
"metrics": [
{
"name": "Threat name",
"metrictype": "bool",
"dimension": "One of the 5 dimensions",
"severity": 1-5,
"scope": "Platform-specific or generic",
"tags": ["Compliance standards", "Benchmarks"],
"description": [
{ "locale": "EN", "title": "Title", "summary": "Description" },
{ "locale": "FR", "title": "Titre", "summary": "Description" }
],
"implementation": { ... },
"remediation": { ... },
"rollback": { ... }
}
]
}Top Level Properties:
- name: The unique identifier of the threat model
- extends: Inheritance model, if applicable
- date: Last update timestamp
- signature: Cryptographic signature for integrity verification
- metrics: Array of threat definitions
Metric Properties:
- name: The threat identifier
- metrictype: Type of measurement (typically boolean)
- dimension: The security dimension the threat belongs to
- severity: Impact rating from 1 (low) to 5 (critical)
- scope: Whether the threat is platform-specific or generic
- tags: Compliance references (e.g., CIS Benchmark, ISO 27001, SOC 2)
- description: Localized explanations of the threat
- implementation: Detection logic
- remediation: Steps to resolve the threat
- rollback: Steps to revert remediation if needed
Threat models employ different detection methods depending on the nature of the security check:
Direct checks of system configuration, file presence, or settings that can be evaluated through standard APIs.
Safe, predefined commands that gather information about the system state. These commands are carefully vetted to ensure they cannot cause harm to the system.
Specialized checks that execute local scripts in userspace, leveraging the EDAMAME_BUSINESS_RULES_CMD
The CLI export/import utilities and the GitHub-based test workflow let you edit metrics with full fidelity while validating them on hosted runners.
-
Edit the tracked scripts directly The repository already contains every metric script under
threat model */<metric>/implementation.(sh|ps)(and remediation/rollback counterparts). Treat these files as the source of truth—add comments, restructure logic, and test locally as needed. Only runexport.pyif you need to regenerate the folders from a pristine JSON (e.g., initial checkout) or to diff what changed; the normal workflow never requires exporting again. -
Re-import scripts into the JSON
python3 src/cli/import.py threatmodel-macOS.json python3 src/cli/import.py threatmodel-Windows.json
The importer normalizes newlines, strips shell headers before embedding them back into JSON, and ensures multi-line commands are stored losslessly. Because legacy agents expect a single-line
target, the importer wraps each script in a reversible launcher:- macOS/Linux:
printf '%s\n' … | /bin/bashprints every original line verbatim and pipes it intobash, so heredocs, comments, and arrays survive the round trip intact. - Windows: a PowerShell array of quoted lines is joined with
`nnewlines and passed toInvoke-Expression, yielding the original script text before execution. The exporter detects these wrappers and recreates the readable.sh/.psfiles automatically, so you never need to hand-edit JSON.
- macOS/Linux:
-
Run the hosted test suite
./tests/run-tests.sh
This helper script checks for
git/gh, snapshots your working tree (even with uncommitted changes), pushes a temporary branch, triggers.github/workflows/test_models.yml, streams the run, and prints any[ERROR]/Error:lines found in the CI logs before cleaning up. -
Refresh signatures before committing
python3 src/publish/update-models.py threatmodel-macOS.json threatmodel-Windows.json
This updates the
date,signature, and.sigsidecars required by CI. -
(Optional) Bake local models into
edamame_foundationfor development If you want to test the new JSONs inside the Rust binaries before publishing them, run the embedding script from theedamame_foundationrepo:cd ../edamame_foundation ./update-threats.sh --local macOS ./update-threats.sh --local Linux ./update-threats.sh --local WindowsThe
--localflag tells the script to read the sibling../threatmodels/threatmodel-*.jsonfiles instead of fetching from GitHub, so you can immediatelycargo check/cargo testagainst your edits. You can omit the OS argument to regenerate every platform in one go.
Following this loop keeps the JSON models, extracted scripts, and CI validation in sync.
The score_calculator repository provides a standalone Python utility that computes the EDAMAME Security Score from these threat models. It implements the same severity-weighted scoring algorithm as the production Rust code in edamame_foundation, producing identical results.
Given a platform and a set of check results (which threats are active vs. inactive), it computes:
- Per-dimension scores (0-100%) for each of the 5 security dimensions
- Overall score (0-100%) and star rating (0.0-5.0)
- Compliance percentages per tag prefix (CIS Benchmark, ISO 27001/2, SOC 2, etc.)
# Fetch the macOS threat model and compute the score with specific threats remediated
python score_calculator.py --platform macOS --inactive "local firewall disabled" "SIP disabled"
# Best case score
python score_calculator.py --platform macOS --all-inactive
# JSON output
python score_calculator.py --platform macOS --all-inactive --jsonSee the score_calculator README for full usage documentation.