How Cal.com Rebuilt AppSec After Going Closed Source
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security

If your team is already running code scanning on pull requests, you're doing the right thing. The part that tends to go wrong is configuration: severity thresholds set too strict and developers start bypassing the gate, set too loose and real issues slip through unreviewed. This is a practical walkthrough of how to set up PR-level security checks in GitHub, tune them to actually hold, and understand what they won't catch.
TLDR:
The pull request sits at a precise convergence point in the software delivery cycle: code is written, peer review is pending, and nothing has merged yet. That sequence matters more than it might appear at first glance.
Fixing a vulnerability in production requires patching, redeployment, incident response coordination, and often customer notification. Catching the same issue in a PR requires a comment and a commit. The cost difference is not marginal.
There are three properties that make the PR the right place to run security checks:
The alternative, scanning after merge or at release time, produces findings that are technically accurate but disruptive in practice. Understanding the difference between SAST vs DAST helps clarify which approach fits each stage. At that stage, fixing a vulnerability means interrupting a developer who has moved on, potentially reverting merged work, and reopening review cycles that were already closed.
PR-stage security checks convert findings into actionable, low-friction developer tasks. That is the structural argument for treating the PR as a security checkpoint, not a courtesy scan.
GitHub's native security features give developers a starting point for PR-level vulnerability detection without leaving their existing workflow. Understanding what these tools actually do under the hood helps clarify where they fit and where they stop.
GitHub's built-in code scanning runs CodeQL queries against your repository when PRs are opened or updated. CodeQL works by compiling your code into a queryable database, then running dataflow and taint-tracking queries against that database, a form of static code analysis that operates before execution. The results surface as annotations directly on the diff, blocking merge if you configure required status checks accordingly.
This approach handles a meaningful set of vulnerability classes: SQL injection, XSS, path traversal, and similar patterns where taint can be traced from source to sink within a bounded scope.
The structural constraint is scope. CodeQL analyzes code it can see in the repository. Cross-service data flows, infrastructure trust boundaries, and business logic correctness fall outside what any single-repository scanner can reason about. A PR that introduces an IDOR because a service incorrectly trusts a caller's role claim won't trigger a CodeQL query because no individual file contains the full vulnerability. This is where dedicated API scanning for automated security testing adds coverage.
Secret scanning and Dependabot complement code scanning by catching exposed credentials and vulnerable dependencies respectively, but neither performs semantic analysis on your application logic.
Getting GitHub's native scanning running on PRs involves three steps:
codeql-analysis.yml workflow file manually to .github/workflows/.on: pull_request trigger so scans fire on every PR opened against protected branches, instead of solely on pushes to main.Most SAST tools ship as pre-built GitHub Actions. The setup pattern is consistent: add the action to your workflow file, point it at your repository, and configure it to run on pull request events.
Here is what a typical integration looks like across the most common tools:
Semgrep publishes an official action (returntocorp/semgrep) that runs on pull_request triggers. You authenticate via SEMGREP_APP_TOKEN, and findings surface directly in the PR checks panel. Rule sets are configurable via --config flags, ranging from community rulesets to your own custom YAML rules.
GitHub's own SAST engine integrates through the github/codeql-action. You define which languages to analyze in a matrix, run the init and analyze steps, and results feed into the Security tab as code scanning alerts. CodeQL handles inter-procedural analysis reasonably well for compiled languages, though it struggles with runtime type resolution in Python and JavaScript.
For infrastructure-as-code scanning, Checkov (bridgecrewio/checkov-action) and Trivy (aquasecurity/trivy-action) both run cleanly as PR checks. Trivy covers container image vulnerabilities alongside IaC misconfigurations, making it useful when your PR includes Dockerfile changes.
| Tool | Primary Focus | PR Integration Method | Language Coverage |
|---|---|---|---|
| Semgrep | Application code | Official action + App Token | 30+ languages |
| CodeQL | Application code | github/codeql-action matrix | 10 languages |
| Checkov | IaC / cloud config | bridgecrewio/checkov-action | Terraform, CF, K8s |
| Trivy | Containers + IaC | aquasecurity/trivy-action | Images, IaC files |
The shared limitation across all four: findings are file-scoped. None of them trace a vulnerability across service boundaries or factor in how your infrastructure actually deploys the code under review.
Branch protection rules turn security scans from suggestions into requirements. Under Settings > Branches, turn on "Require status checks to pass before merging" and add the exact job name from your workflow YAML as a required status check. If the SAST job fails, the merge button stays locked.
A few configuration choices matter here:
For repositories with compliance requirements, "Require signed commits" closes the gap where a passing CI check is meaningless if you can't verify who authored the commit, a concern also covered in automated pentest tools and best practices.
GitHub code scanning maps alert severity to check failure behavior through a threshold you configure in repository security settings: Critical only, High and above, Medium and above, or any finding.
Three practical modes teams run:
Strict mode is where alert fatigue takes root. When every Low-severity informational finding stops a merge, developers start requesting blanket dismissals, and what was a security gate becomes rubber-stamping. The check stays green on paper while real issues pass through unreviewed.
High severity is the right default for most teams. It catches exploitable findings without generating the volume that pushes developers to treat the gate as friction to bypass. Once your baseline noise is understood, you can tighten the threshold selectively, scoping stricter rules to directories or file patterns that carry more exposure instead of applying them across the whole repository, a consideration that also applies when securing AI-generated code merged through PRs.
Secrets and dependencies represent two of the most common, and most preventable, PR-stage security failures. Both have dedicated GitHub mechanisms worth knowing.
GitHub's push protection scans commits for high-entropy strings and known credential patterns before they reach a remote branch. When a match fires, the push is blocked at the git layer, before the PR even opens.
The catch: push protection covers GitHub's supported partner patterns. Custom internal tokens, proprietary API formats, and legacy credential schemes fall outside that list. Teams running services with non-standard credential formats need supplemental tooling to close that gap.
The dependency-review-action compares the dependency tree between base and head commits, flagging packages with known CVEs, license conflicts, or unexpected version jumps. Running it as a required status check stops vulnerable dependencies from merging silently. GitHub's dependency review documentation covers the full configuration options.
One configuration worth setting: fail-on-severity: high combined with allow-licenses keeps the signal-to-noise ratio manageable without letting high-severity transitive vulnerabilities slip through on licensing technicalities.
When a security tool surfaces a finding in a pull request, the work is just beginning. Alerts need context before a developer can act on them effectively.
Start by reading the full finding: what file, what line, what data flow triggered it. Most SAST tools will tell you the vulnerability class and sometimes the exploit path. The question to answer first is whether the flagged code is reachable from an untrusted input in your actual deployment.
Not every high-severity alert deserves immediate action:
| Action | When to use it |
|---|---|
| Fix before merge | Exploitable path confirmed, reachable from untrusted input |
| Create tracked issue | Valid finding, low reachability, acceptable short-term risk |
| Suppress with justification | False positive confirmed, document the reasoning in code |
| Escalate | Confirmed critical, affects auth or data integrity, needs security team review |
Suppressing a finding without written justification is how false positives accumulate into ignored alerts. Require a comment explaining why a suppression was applied whenever a developer marks something as not a real issue.
PR-level SAST catches a meaningful category of bugs: SQL injection, XSS, hardcoded secrets, known-vulnerable dependencies. These are pattern-recognizable, file-local, and well-served by rule-based scanners running in CI.
The gap shows up where security stops being a data-flow question and starts being a correctness question.
Consider a permission check that exists in the codebase but never runs for a specific API route. No taint flows to a dangerous sink. No pattern matches a known vulnerability signature. The scanner reports clean. The route is open to anyone. This is precisely why static analysis struggles with business logic vulnerabilities.
This is the business logic class of vulnerability. It requires understanding what the code was supposed to do, beyond what it does. PR-level scanners read diffs; they don't hold the system's intended behavior in scope.
Three structural limits explain why:
The result is a class of vulnerabilities that passes every automated gate and lands in production.
For each PR, Gecko analyzes the diff in full context: the changed lines and how those changes interact with authentication logic, authorization checks, and data flows elsewhere in the application. When it finds a real issue, it generates a working proof-of-concept exploit, so reviewers can confirm the finding without manual reproduction.
Most SAST tools operating at the file level will miss vulnerabilities where the flaw spans multiple components. Gecko's cross-service tracing covers several categories that consistently slip through standard PR checks:
Gecko also produces auto-remediation PRs when it finds an exploitable issue, giving developers a concrete fix instead of a finding description to interpret. The result is fewer back-and-forth review cycles and a shorter path from detection to merged patch.
Rule-based SAST at the PR stage handles the pattern-recognizable category of bugs well, and the setup options covered here give you real blocking power before anything merges. The harder category, business logic and cross-service authorization failures, passes every automated gate because those vulnerabilities live in the relationship between components, not in any single file or diff. You can tighten severity thresholds and add reviewers, but the structural limit remains. The Gecko team can show you how contextual analysis covers what file-scoped tools miss.
Add a codeql-analysis.yml workflow file to .github/workflows/ with an on: pull_request trigger, then go to Settings > Branches and add the CodeQL job name as a required status check. Set "Require branches to be up to date before merging" so PRs based on older commits cannot slip through before a newly added security rule takes effect.
Start at High severity as your blocking threshold. Strict mode, which blocks on any finding at any level, leads developers to request blanket dismissals instead of fixing real issues, which defeats the gate entirely. Once you understand your codebase's baseline noise, tighten the threshold selectively for high-exposure directories instead of applying stricter rules across the whole repository.
Semgrep operates at the file level and cannot trace authorization logic across service boundaries, so a missing permission check that only becomes exploitable through a cross-service call will pass its checks cleanly. Gecko Security builds a compiler-accurate semantic graph across your full codebase, traces those cross-service call chains, and generates a working proof-of-concept exploit for each confirmed finding, covering the class of vulnerabilities that rule-based PR scanners structurally cannot reach.
No. GitHub's CodeQL handles taint-traceable patterns like SQL injection and XSS, but IDOR and broken access control failures have no syntactic signature. They exist in the gap between what authorization logic was supposed to enforce and what it actually enforces across components. Detecting them requires reasoning about system intent across service boundaries, which no single-repository scanner can do.
Use both, and treat them as covering separate failure modes. Push protection blocks high-entropy strings and known credential patterns before a PR even opens, but it only covers GitHub's supported partner token formats, so custom internal credentials need supplemental tooling. Dependency review catches vulnerable packages by comparing the dependency tree between base and head commits; set fail-on-severity: high to block high-severity transitive vulnerabilities without generating noise from lower-severity licensing findings.
Gecko Security
The latest news, technologies, and resources from our team.
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security
See what actually changed in the OWASP Top 10 for 2026, from merged SSRF and XXE categories to new supply chain risks and scanner coverage gaps.
Jeevan Jutla
Gecko Security uncovered CVE-2026-21894 in August 2026, an n8n authorization bypass with CVSS 8.8. See why static tools missed it and how to remediate it.
Jeevan Jutla
Security misconfiguration is OWASP A05 for a reason. Learn how deployment context determines exploitability and how to fix gaps in August 2026.
Jeevan Jutla
How do modern AppSec vendors actually compare? This July 2026 capability map covers SAST, DAST, SCA, business logic flaws, and cross-service
Gecko Security
Break down your AppSec stack: what SAST, DAST, SCA, IAST, and pen testing each see — and what they miss. Updated July 2026 by Gecko Security.
Gecko Security
Occasional updates, new content, and insights. No spam; unsubscribe anytime.