Add EVM security audit pipeline#405
Open
TUPM96 wants to merge 1 commit into
Open
Conversation
|
@TUPM96 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an EVM security audit pipeline that runs Slither + Mythril, normalizes findings, and gates CI on new findings above a severity threshold.
Changes:
- Introduces a Python runner to execute Slither/Mythril, normalize findings, apply baseline/suppressions, and produce JSON + Markdown summaries.
- Adds CI workflow to run the audit on PRs/pushes and upload artifacts.
- Adds documentation and configuration scaffolding for baseline/suppressions and Slither config.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/security/run_evm_audit.py | Implements the local/CI runner (tool execution, normalization, gating, reporting). |
| .github/workflows/security-audit.yml | Wires the runner into CI with artifact upload and a step summary. |
| docs/security-audit.md | Documents the pipeline behavior, gating, baseline, and suppressions. |
| contracts/evm/slither.config.json | Provides Slither config used by the runner/workflow. |
| contracts/evm/security-suppressions.json | Adds suppressions file scaffold for reviewed false positives. |
| contracts/evm/security-baseline.json | Adds baseline file scaffold for accepted historical findings. |
| contracts/evm/README.md | Documents local usage and the purpose of the EVM contracts/audit config directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+95
to
+96
| with path.open("r", encoding="utf-8") as handle: | ||
| return json.load(handle) |
Comment on lines
+44
to
+53
| self.severity = normalize_severity(self.severity) | ||
| fingerprint = "|".join( | ||
| [ | ||
| self.tool, | ||
| self.check, | ||
| self.severity, | ||
| self.source, | ||
| compact(self.description), | ||
| ] | ||
| ) |
Comment on lines
+235
to
+246
| def apply_controls(findings: list[Finding], baseline_path: Path, suppressions_path: Path) -> None: | ||
| baseline_ids = load_baseline(baseline_path) | ||
| suppression_payload = load_json(suppressions_path, {"suppressions": []}) | ||
| suppressions = suppression_payload.get("suppressions", []) or [] | ||
|
|
||
| for finding in findings: | ||
| finding.baseline = finding.id in baseline_ids | ||
| for suppression in suppressions: | ||
| if suppression_matches(finding, suppression): | ||
| finding.suppressed = True | ||
| finding.suppression_reason = str(suppression.get("reason") or "suppressed") | ||
| break |
Comment on lines
+56
to
+57
| SEVERITY_THRESHOLD: ${{ inputs.severity_threshold || 'medium' }} | ||
| MYTHRIL_TIMEOUT: ${{ inputs.mythril_timeout || '900' }} |
Comment on lines
+25
to
+28
| mythril_timeout: | ||
| description: "Per-contract Mythril timeout in seconds" | ||
| required: false | ||
| default: "900" |
| --baseline contracts/evm/security-baseline.json \ | ||
| --suppressions contracts/evm/security-suppressions.json \ | ||
| --severity-threshold "$SEVERITY_THRESHOLD" \ | ||
| --timeout "$MYTHRIL_TIMEOUT" |
| - name: Install analysis tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install slither-analyzer mythril |
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 #388
Summary
EVM Security AuditGitHub Actions workflow for Slither and Mythril.contracts/evmaudit configuration with Slither config, historical baseline tracking, and suppression metadata.docs/security-audit.md.Validation
python -m py_compile scripts/security/run_evm_audit.pypython scripts/security/run_evm_audit.py --contracts-dir contracts/evm --out-dir security-reports/evm --baseline contracts/evm/security-baseline.json --suppressions contracts/evm/security-suppressions.json --severity-threshold medium --timeout 60git diff --cached --checkNote: the repo currently has no
.solfiles undercontracts/evm, so the local run validates the empty-contract path. The workflow installs Slither/Mythril and will scan/gate future Solidity sources added under that directory.