Skip to content

Security: vineet454/PromptZip

Security

SECURITY.md

πŸ”’ PromptZip - GitHub Security & Protection Guide

Quick Answer: Your Code is Safe!

βœ… By default, only YOU can modify the main branch βœ… Others can only suggest changes via Pull Requests βœ… You must approve every change before it goes live


πŸ“Š Permission Levels Explained

What is YOUR GitHub repository:

  • Owner: You (full control)
  • Collaborators: Anyone you specifically invite (limited permissions)
  • Everyone else: Can fork, report issues, suggest changes via PR

What Can Others Do?

Action Default? Can Prevent?
Fork your repo βœ… Yes No (it's open source)
Create Pull Requests βœ… Yes Can be disabled
Push to main branch ❌ NO N/A
Merge PRs ❌ NO Can add extra rules
Delete repository ❌ NO N/A
Change settings ❌ NO N/A
Access your issues βœ… Yes Can mark as private

πŸ›‘οΈ How to Protect Your Code (Step-by-Step)

Step 1: Enable Branch Protection

  1. Go to: https://github.com/vineet454/PromptZip
  2. Click Settings (top right)
  3. Click Branches (left sidebar)
  4. Click Add rule under "Branch protection rules"
  5. Enter main as the branch name
  6. Check these options:
βœ… Require pull request reviews before merging
   β”œβ”€ Required number of approvals: 1
   └─ Require review from code owners

βœ… Require status checks to pass before merging
   β”œβ”€ GitHub Actions (tests must pass)

βœ… Require branches to be up to date before merging

βœ… Dismiss stale pull request approvals when new commits are pushed

βœ… Restrict who can push to matching branches
   └─ Only allow specified people to push
  1. Click Create

Step 2: Make Yourself Code Owner (Optional but Recommended)

  1. Create a file named CODEOWNERS in the root:
# CODEOWNERS
# @vineet454 is the owner of everything
*       @vineet454
  1. Commit and push:
git add CODEOWNERS
git commit -m "Add CODEOWNERS file"
git push
  1. Now you'll automatically be requested for review on all PRs

Step 3: Disable Discussions (If You Want)

  1. Go to Settings
  2. Scroll to Features
  3. Uncheck Discussions (if you don't want them)

🚫 How to Handle Unwanted Pull Requests

If someone submits a PR you don't want:

  1. Open the Pull Request
  2. Scroll to bottom
  3. Click Close pull request
  4. Add a comment explaining why (e.g., "This repository is not accepting contributions at this time")
  5. The PR closes without merging

πŸ“‹ Current Security Status of Your Repo

βœ… Repository: https://github.com/vineet454/PromptZip βœ… Visibility: Public (anyone can see it) βœ… Write Access: Only you βœ… Push Protection: Default GitHub protection active βœ… Pull Requests: You control all merges


πŸ” Recommended Security Settings (Summary)

Owner: @vineet454 βœ…
Collaborators: None (unless you invite)
Branch Protection: Recommended (instructions above)
Pull Request Reviews: Recommended (you are sole reviewer)
CI/CD Tests: Already configured βœ… (runs on all PRs)

πŸ’‘ Open Source vs Private Repository

Your Current Setup (Public Open Source):

  • βœ… Free
  • βœ… Anyone can see your code
  • βœ… Anyone can fork it
  • βœ… You control all direct changes
  • βœ… Good for community contributions

If You Want Private (Paid):

  • Only people you invite can see it
  • GitHub Personal plans offer private repos
  • More restrictive, less open source

🎯 Three Security Options

Option 1: Minimal Security (Current Default)

  • Branch protection: No
  • Reviews required: No
  • Anyone can submit PRs
  • Risk: Low (you control merges)
  • Recommendation: Good for open source

Option 2: Medium Security (Recommended)

  • Branch protection: Yes
  • Reviews required: Yes (from you)
  • Tests must pass
  • Stale reviews dismissed
  • Risk: Very Low
  • Recommendation: Best for most projects

Option 3: Maximum Security (Very Restrictive)

  • All from Option 2, plus:
  • Only you can push (even after PR approval)
  • Require admin approval for merges
  • Require all conversations resolved
  • Risk: None
  • Recommendation: For critical projects only

βœ… Bottom Line

Your code is protected by default!

  • ❌ No one can directly edit your main branch
  • βœ… All changes go through Pull Requests
  • βœ… You approve or reject every change
  • βœ… GitHub tracks who changed what
  • βœ… You can revert any merge instantly

πŸ“ž Need to Disable Contributions?

If you don't want ANY contributions:

  1. Go to Settings
  2. Click Features
  3. Uncheck Sponsorships and Discussions
  4. Edit CONTRIBUTING.md to say "This project is not accepting contributions"
  5. People can still fork it, but won't be encouraged to contribute

πŸ”„ How to Revert a Bad Merge (If It Happens)

# See the commit you want to undo
git log --oneline

# Revert the commit
git revert <commit-hash>

# Push the revert
git push

The bad change will be undone instantly!


πŸŽ“ Summary

Your GitHub Repository Security Status:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
βœ… Only you can push to main
βœ… All PRs require your approval
βœ… CI/CD tests run automatically
βœ… Changes are tracked
βœ… You can revert anything
βœ… Your code is safe!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Recommendation: Follow Option 2 (Medium Security) for the best balance between security and open-source collaboration.

Need help with setup? Check the instructions above!

There aren't any published security advisories