feat: implement automated threat modeling system and CLI integration - #70
Open
BigFundz wants to merge 1 commit into
Open
feat: implement automated threat modeling system and CLI integration#70BigFundz wants to merge 1 commit into
BigFundz wants to merge 1 commit into
Conversation
Author
|
@Nanle-code Please review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #51
Issue: Implement Automated Threat Modeling System for Smart Contracts
Problem Statement
Currently, the ChainProof scanner detects code-level vulnerabilities, but it lacks a holistic, architecture-level security view. Developers and auditors need a way to automatically model smart contracts' security architectures—identifying what assets exist, who might attack them, where the trust boundaries lie, and how code-level findings impact the overall system risk.
To bridge this gap, we need to implement an automated AI Threat Modeling System integrated into the ChainProof core and CLI.
Requirements
1. Asset Extraction & Valuation Engine
high,medium,low) to these assets.2. Threat Agent Database & Modeling
3. Attack Surface & Trust Boundary Mapping
onlyOwner) to outline logical trust boundaries.4. Risk Prioritization & Framework Mapping
5. Team Collaboration & Overrides
mitigatedor adding custom assets) using a local JSON assumptions file.6. Visual Representations & Multi-Format Reporting
7. CLI & CI Integration
chainproof threat-model).Solution Implemented
packages/core/src/threat-model/): Created custom AST visitor engines, risk calculators with expert category weighting, configuration merger, and visual layout generators.packages/cli/src/cli.ts): Built a fully featuredthreat-modelcommand that supports options like--format json,--output, and--assumptions.test:ciscript issue and added TypeDoc peer dependencies to prevent docs/tests pipeline failures.DeFiSystemFixture.sol) and wrote comprehensive Jest unit and integration test suites.