Security: Prevent Fork-Based npm Publishes and Add CODEOWNERS#16
Merged
Conversation
- Add repository checks to canary/dev workflows - Add detailed CODEOWNERS rules for security-critical paths - Update workflow names: codebuddy-* → codingbuddy-* Prevents unauthorized package publishes from forks. close #15
- Update package names, CLI binary, and environment variables - Update all documentation references - Breaking: CLI command and env var changed
6c349fe to
7a3c302
Compare
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.
Security: Prevent Fork-Based npm Publishes and Add CODEOWNERS
📋 Summary
Implements security measures to prevent unauthorized npm package publishing from forks and external contributors. Adds repository checks to canary/dev workflows and comprehensive CODEOWNERS rules for critical security-sensitive paths.
Closes #15
🎯 Problem
Security Risk
As an open source project, Codingbuddy was vulnerable to unauthorized npm package publishing:
devandcanaryworkflows published to npm without repository ownership verificationThreat Scenarios
✨ Solution
1. Repository Ownership Checks
Added
ifconditions to canary and dev workflows to only allow publishing from the main repository:Impact: Prevents forks and external repositories from triggering npm publishes.
2. CODEOWNERS Configuration
Created comprehensive
.github/CODEOWNERSfile with detailed rules:@JeremyDev87for all files.github/- GitHub workflows (security-sensitive)mcp-server/- MCP Server source code.ai-rules/- AI rules (included in npm package)scripts/- Build/deployment scriptspackage.jsonfiles - Package configurationImpact: Ensures all critical changes require code owner approval before merge.
3. Workflow Naming Updates
Updated workflow names for consistency:
codebuddy-canary→codingbuddy-canarycodebuddy-dev→codingbuddy-devcodebuddy-release→codingbuddy-release📊 Files Changed
.github/CODEOWNERS(+22 lines, -1 line).github/workflows/canary.yml(+2, -2).github/workflows/dev.yml(+2, -2).github/workflows/release.yml(+1, -1)Total: 4 files changed, +28 insertions, -6 deletions
✅ Benefits
Security Improvements
Key Protections
🧪 Testing
Issues
close #15