Implementing a Secure Code Review Workflow with GitHub, Sentry, and Slack
Implementing a Secure Code Review Workflow with GitHub and Slack
Security vulnerabilities don't announce themselves. They slip through in hastily reviewed pull requests, overlooked dependency updates, and midnight commits that nobody catches until it's too late. For founders and engineering leads at growing companies, the challenge isn't understanding that code review matters—it's building a workflow that actually catches problems without grinding development to a halt.
This guide walks through how to wire up GitHub and Slack into a secure code review workflow that scales with your team. We'll cover the practical setup, the tier decisions that actually matter, and the automation that keeps security from becoming a bottleneck.
What Is a Secure Code Review Workflow?
A secure code review workflow combines automated analysis (linting, static application security testing), human pull-request reviews, and systematic triage—all tracked in GitHub—with real-time alerts to relevant teams via Slack channels. It's the difference between hoping someone notices a vulnerability and building a system that surfaces problems before they ship.
The workflow has three layers:
- Automated gates: Code scanning, dependency checks, and linting that run before human eyes touch the code
- Human review: Required approvals from designated reviewers with security context
- Communication rails: Instant notifications that route the right alerts to the right people
When these layers work together, security becomes part of the development rhythm rather than a separate checkpoint that slows everything down.
Why This Combination Works
GitHub handles the heavy lifting: hosting your code, managing pull requests, running automated security scans, and enforcing branch protection rules. It's where the actual review happens.
Slack handles the human coordination: alerting reviewers when PRs need attention, surfacing security findings that require immediate action, and keeping audit trails of who responded to what. It's where decisions get made and communicated.
The integration between them is native and well-maintained. GitHub's official Slack app pushes PR events, code scanning alerts, and Dependabot findings directly into channels. Slack's Workflow Builder can add automation on top—reminders for stale PRs, escalations for critical vulnerabilities, daily digests of open security items.
Setting Up GitHub for Security-First Reviews
Branch Protection: Your First Line of Defense
Branch protection rules in GitHub prevent direct pushes to your main branches and require specific conditions before merging. For a security-focused workflow, configure these settings:
- Require pull request reviews before merging: Set minimum approvals (typically 1-2 for small teams)
- Dismiss stale reviews when new commits are pushed: Forces re-review of changed code
- Require review from code owners: Designate security-aware team members for sensitive directories
- Require status checks to pass: Block merges until automated scans complete
- Require signed commits: Verify commit authorship (optional but recommended for compliance)
Setup time: 1-2 hours for a standard repository structure. The Settings → Branches → Branch protection rules interface walks you through each option.
Automated Security Scanning
GitHub offers two levels of automated security checks:
Dependabot (included in all plans): Monitors your dependency files and opens PRs when vulnerabilities are discovered in packages you use. Enable it in Settings → Security → Code security and analysis. It's free, it's automatic, and it catches a surprising number of issues.
Code Scanning with CodeQL (Team plan and above): Static analysis that examines your actual code for security vulnerabilities—SQL injection, cross-site scripting, authentication flaws. CodeQL runs via GitHub Actions and posts findings directly on pull requests.
For teams serious about an automated security code review process, CodeQL is worth the upgrade to GitHub Team ($4/user/month). It catches issues that dependency scanning misses because it analyzes your code, not just your packages.
CODEOWNERS for Security-Sensitive Paths
Create a CODEOWNERS file in your repository root to automatically request reviews from specific people when certain files change:
- /auth/* → security-team
- /payments/* → security-team, finance-lead
- *.yml → devops-lead (catches CI/CD config changes)
- /api/* → backend-lead, security-team
When someone opens a PR touching authentication code, your security-aware reviewers get added automatically. No manual tagging required.
Connecting Slack for Real-Time Coordination
Installing the GitHub App
The official GitHub app for Slack handles the integration without custom webhooks or middleware. Install it from Slack's app directory, authenticate with your GitHub account, and subscribe channels to repositories.
Basic setup takes about 30 minutes:
- Install the GitHub app in your Slack workspace
- Create a dedicated channel (e.g., #code-reviews or #security-alerts)
- Use /github subscribe owner/repo to connect a repository
- Customize notifications with /github subscribe owner/repo reviews comments
Routing Notifications Intelligently
The mistake most teams make: dumping all GitHub notifications into one channel. Within a week, everyone ignores it.
Better approach—create purpose-specific channels:
- #pr-reviews: Pull request opened, approved, changes requested, merged
- #security-alerts: Dependabot alerts, code scanning findings, secret scanning hits
- #deploy-notifications: Merged to main, deployment status
The GitHub Slack app supports filtering by event type, so you can route different notifications to different channels. Security-critical alerts go somewhere they won't get lost in general PR noise.
Building Workflow Automations
Slack's Workflow Builder (available on Standard plan and above) adds automation without code:
Daily stale PR reminder: Trigger at 9 AM, post to #pr-reviews with a reminder to check for PRs open longer than 48 hours. This keeps reviews from becoming blockers.
Security alert escalation: When a message containing "critical vulnerability" appears in #security-alerts, automatically notify @security-oncall. Ensures high-severity issues don't sit unacknowledged.
New team member PR welcome: When someone's first PR gets opened, post a friendly message with links to your review guidelines and security checklist.
Setup time for workflows: 1-2 hours for a basic set of automations.
Which Plans Do You Actually Need?
Plan selection is where cost optimization meets security requirements. Here's the practical breakdown:
GitHub Tiers
- Free: Private repos (up to 3 collaborators), Dependabot alerts, basic branch protection. Workable for very early-stage teams.
- Team ($4/user/month): Unlimited collaborators, code scanning with CodeQL, protected branches with required reviewers. The sweet spot for most growing teams.
- Enterprise: SAML SSO, audit logs, compliance features, advanced security scanning. Required for regulated industries or 50+ person engineering teams.
Slack Tiers
- Free: 10 app integrations, 10k message history, basic functionality. Fine for testing the workflow, problematic for audit trails.
- Standard ($6.67/user/month): Unlimited integrations, full message history, Workflow Builder. Recommended minimum for teams implementing proper security workflows.
- Plus ($12.50/user/month): SAML SSO, compliance exports, 99.99% SLA, SCIM provisioning. Required for SOC 2, HIPAA, or other compliance frameworks.
The Decision Matrix
Bootstrap team (1-3 developers): GitHub Free + Slack Free. Enable Dependabot, set up basic branch protection, route notifications to one channel. Total cost: $0.
Growing startup (5-20 developers): GitHub Team + Slack Standard. Enable CodeQL scanning, configure CODEOWNERS, build Workflow Builder automations for PR management. Total cost: ~$11/user/month.
Compliance-required SMB (20+ developers): GitHub Enterprise + Slack Plus. Full audit logging, SAML across both platforms, compliance exports, advanced scanning. Total cost: ~$35-50/user/month depending on negotiated rates.
Frequently Asked Questions
How do I integrate GitHub with Slack for PR notifications?
Install the official GitHub app in Slack, configure repository-specific notification settings using the /github subscribe command, and route pull-request events (opened, approved, changes requested) to a dedicated channel. The entire setup takes about 30 minutes.
Which GitHub and Slack plan do I need for secure reviews?
Most security review features (branch protection rules, code scanning, SAML) require GitHub Team or Enterprise. For Slack, Standard or Plus provides unlimited integrations, full message retention, and compliance exports. The combination of GitHub Team + Slack Standard covers most growing teams' needs.
Can I implement this workflow with free tiers?
Partially. GitHub Free includes Dependabot and basic branch protection. Slack Free allows the GitHub integration but limits you to 10 apps total and 10k message history (problematic for audit trails). For a proper security workflow with full scanning and unlimited retention, plan on the paid tiers.
How long does full setup take?
For a single repository with basic workflow: 2-4 hours. For a multi-repo setup with comprehensive scanning, CODEOWNERS, and Slack automations: 1-2 days of focused work. The maintenance overhead after initial setup is minimal—mostly tuning notification rules and updating CODEOWNERS as the team changes.
Common Pitfalls to Avoid
Over-notifying: Routing every GitHub event to Slack creates noise that people learn to ignore. Be selective about what triggers notifications.
Skipping Dependabot: It's free and catches real vulnerabilities. There's no reason not to enable it on every repository.
Too many required reviewers: Requiring three approvals on a two-person team creates bottlenecks. Match review requirements to team size.
Ignoring code scanning findings: CodeQL will surface issues. If the team learns to dismiss them without investigation, you've wasted the investment. Build a triage process—someone owns reviewing each finding.
No escalation path: Critical security findings need to reach someone who can act on them, even outside business hours. Slack's notification features can help, but only if you configure them.
The Workflow in Practice
Here's how a secure code review actually flows through this system:
- Developer opens PR against main branch
- GitHub Actions triggers CodeQL scan and runs tests
- Dependabot checks for vulnerable dependencies
- CODEOWNERS rules add appropriate reviewers automatically
- Slack posts notification to #pr-reviews with PR summary
- Reviewers get pinged, review code, leave comments
- Any security findings appear inline on the PR and route to #security-alerts in Slack
- After approval and passing checks, PR merges
- Slack confirms merge in #deploy-notifications
The entire process happens without manual coordination. Security checks run automatically. The right people get notified at the right times. Audit trails exist in both GitHub and Slack.
That's the goal: a secure code review workflow that works without constant attention. Build it once, tune it as you learn what your team needs, and let the automation handle the coordination while humans focus on the actual security review.