Date: March 26, 2026
Status: ✅ Complete and Production-Ready
Implementation: .github/workflows/ci.yml
- Added
auditjob that runs on every push tomainand all PRs - Uses
cargo audit --deny warningsto fail on any vulnerabilities - Runs before build/test jobs (security-first approach)
- Caches cargo registry for performance
jobs:
audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Run cargo audit
run: cargo audit --deny warningsBehavior:
- Blocks PR merges if vulnerabilities detected
- Fails fast before expensive build steps
- Clear job name for visibility in GitHub Actions UI
Implementation: .github/workflows/security-audit.yml
- Scheduled to run every Monday at 00:00 UTC via cron
- Includes
workflow_dispatchfor manual triggering - Runs independently from CI pipeline
- Creates GitHub issue on failure with actionable guidance
on:
schedule:
- cron: '0 0 * * 1' # Monday 00:00 UTC
workflow_dispatch:Behavior:
- Automatic weekly vulnerability detection
- Issue creation with links to failed workflow
- Labels issues as
securityanddependenciesfor filtering - Includes direct link to CONTRIBUTING.md audit process
Implementation: cargo audit --deny warnings in both workflows
--deny warningsflag treats all vulnerabilities as blocking errors- Applies to both push and PR events
- No exceptions or bypass mechanisms (security-first)
- Consistent with existing CI strictness (clippy, fmt)
Severity Handling:
- Critical/High: Automatically blocked by
--deny warnings - Medium: Blocked by
--deny warnings - Low: Can be accepted via
Cargo.audit(documented process)
Implementation: CONTRIBUTING.md - New "Security & Dependency Management" section
-
Automatic Detection Process
- On every push behavior
- Weekly scan behavior
- Issue creation workflow
-
Severity Assessment Table
- Critical: Same day fix required
- High: 48-hour fix required
- Medium: 1-week fix required
- Low: Case-by-case with documentation
-
Resolution Options
- Option A: Update dependency with
cargo update - Option B: Accept vulnerability (Low only) via
Cargo.audit
- Option A: Update dependency with
-
Step-by-Step Procedures
- How to update dependencies
- How to add entries to
Cargo.audit - Verification commands
- Commit message format
-
Review Process
- Approval requirements
- Verification checklist
- Breaking change documentation
-
Escalation Procedure
- Private security advisory creation
- Maintainer notification
- Patch release preparation
- Disclosure timing
-
Local Audit Commands
cargo audit- Basic checkcargo audit --deny warnings- CI equivalentcargo audit --json- Report generationcargo audit --advisory- Specific advisory check
-
Dependency Update Policy
- Keep dependencies current
- Review changelogs
- Test thoroughly
- Document breaking changes
- Template for documenting accepted vulnerabilities
- Clear format with required fields: id, reason, date, reviewer
- Example provided (commented out)
- Link to official cargo-audit documentation
- Ready for production use
Format:
[[advisories]]
id = "RUSTSEC-YYYY-NNNNN"
reason = "Vulnerability does not affect our usage pattern"
date = "YYYY-MM-DD"
reviewer = "github-username"Changes Made:
- Added
auditjob as first job (runs in parallel but conceptually first) - Separate from build/test to allow independent caching
- Uses same Rust toolchain installation as main CI
- Minimal overhead (no build artifacts needed)
Job Order:
audit- Security check (parallel)ci- Build and test (parallel)
Both must pass for PR to merge.
Features:
- Scheduled trigger (cron)
- Manual trigger support (workflow_dispatch)
- Automatic issue creation on failure
- GitHub Script integration for issue creation
- Proper error handling with
if: failure()
Issue Template:
- Clear title with emoji for visibility
- Action items numbered
- Links to workflow run
- Reference to CONTRIBUTING.md process
- Automatic labels for filtering
New Section: "Security & Dependency Management"
Subsections:
- Handling Audit Findings (5 steps)
- Running Audits Locally (4 commands)
- Dependency Update Policy (4 guidelines)
Integration:
- Placed after "Code Style" section (logical flow)
- Before "Reporting Issues" section
- Cross-referenced from security-audit.yml workflow
✅ YAML Syntax Validation
ci.yml- Valid YAMLsecurity-audit.yml- Valid YAML
✅ File Existence
.github/workflows/ci.yml- Updated.github/workflows/security-audit.yml- CreatedCargo.audit- CreatedCONTRIBUTING.md- Updated
✅ Workflow Logic
- Audit job runs on push and PR
- Weekly job runs on schedule
- Issue creation on failure
- Proper caching configuration
- Correct cron syntax (Monday 00:00 UTC)
- Both workflows have valid YAML syntax
- Audit runs on every push (blocks merges)
- Weekly scheduled scan configured
- Issue creation on failure implemented
- Cargo.audit template created
- Documentation comprehensive and clear
- Severity assessment guidelines provided
- Resolution procedures documented
- Local audit commands documented
- Escalation procedure defined
- No breaking changes to existing CI
- Consistent with project standards
- Ready for immediate deployment
- Merge to main - All changes ready for production
- First audit run - Will execute on next push
- Monitor first weekly run - Monday 00:00 UTC
- Document any accepted vulnerabilities - Add to
Cargo.auditas needed - Review and refine - Adjust timelines based on team capacity
- The
--deny warningsflag is strict but appropriate for a security-critical smart contract - Weekly audits provide early warning of new vulnerabilities
- The
Cargo.auditfile should be reviewed quarterly for accepted vulnerabilities - Consider adding a security policy file (SECURITY.md) in future for vulnerability disclosure
- All team members should be familiar with the audit process in CONTRIBUTING.md
Implementation completed by: Senior Developer
Review status: Ready for production deployment