← Blog/DevSecOps

DevSecOps for Startups: How to Bake Security Into Your CI/CD Without Slowing Down

"We'll handle security after we have traction." It's the most expensive thing a startup can say. Retrofitting security into an established codebase is ten times harder than building it in from the start. Here's how to do it without sacrificing velocity.

·11 min read

DevSecOps — Development, Security, and Operations integrated as a single practice — sounds like an enterprise concept. It conjures images of dedicated security engineers, quarterly penetration tests, and compliance frameworks. For a five-person startup shipping daily, it can feel irrelevant.

But the core insight of DevSecOps is exactly what early-stage startups need: catch security problems at the point when they're cheapest to fix — in code, before they reach production. A SQL injection found in a code review takes 30 minutes to fix. The same vulnerability discovered after a breach takes months and significant revenue.

The startup-sized version of DevSecOps isn't an enterprise SIEM and a team of penetration testers. It's a set of automated checks wired into your existing CI/CD pipeline that catch the most common and most expensive vulnerability classes without requiring a human to remember to check.

The Startup DevSecOps Stack

A practical DevSecOps pipeline for a small team has five layers, each addressing a different part of the security surface:

  1. Secret scanning — catch credentials before they reach git
  2. Static analysis (SAST) — catch code-level vulnerability patterns
  3. Dependency scanning (SCA) — catch vulnerable packages
  4. Container scanning — catch base image vulnerabilities
  5. External API scanning — catch what's exposed in production

Not every startup needs all five from day one. But understanding what each layer catches — and what it misses — lets you prioritize intelligently based on your threat model and stage.

Layer 1: Secret Scanning (Zero Tolerance)

Secret scanning is non-negotiable and costs nothing. The blast radius of a leaked credential is immediate and severe — it's the fastest path from "we got hacked" to "everything is on fire."

Pre-commit hooks

Install detect-secrets or gitleaks as a pre-commit hook. These tools scan every commit for patterns matching known secret formats (API keys, connection strings, private keys) before they reach git. A rejected commit is a minor inconvenience; a leaked key is a potential catastrophe.

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/zricethezav/gitleaks
    rev: v8.18.0
    hooks:
      - id: gitleaks

CI/CD secret scanning

Pre-commit hooks can be bypassed (with --no-verify). Add a second layer in CI that scans the entire git history on every PR:

# .github/workflows/security.yml
- name: Secret scanning
  uses: gitleaks/gitleaks-action@v2
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GitHub Secret Scanning (automatic for public repos, Advanced Security for private) adds a third layer — but treat it as a safety net, not a primary control.

Layer 2: Static Analysis (SAST)

Static Application Security Testing analyzes your source code for vulnerability patterns — without running the code. It catches things like:

  • Injection flaws (SQL injection, command injection, path traversal)
  • Insecure cryptography (weak algorithms, hardcoded salts)
  • Dangerous function usage (eval, exec, deserialize)
  • Missing input validation patterns

Tools by language

  • JavaScript/TypeScript: ESLint with eslint-plugin-security. Semgrep with the p/javascript or p/typescript rulesets (free, open source, excellent coverage).
  • Python: Bandit (simple, effective, fast). Semgrep p/python.
  • Go: Gosec (govulncheck for dependencies, gosec for SAST patterns).
  • Multi-language: Semgrep is the standout choice for teams using multiple languages. The free tier covers essential rulesets.

Integration

Wire SAST into your CI pipeline as a PR check. Configure it to fail on high/critical findings — not medium or low — to avoid alert fatigue that causes developers to ignore the tool entirely.

# GitHub Actions SAST with Semgrep
- name: Semgrep scan
  uses: returntocorp/semgrep-action@v1
  with:
    config: >-
      p/security-audit
      p/owasp-top-ten
    auditOn: push

SAST covers your code. What covers your live API?

Scantient is the external layer of your DevSecOps stack — scanning what's actually exposed in production, not what's in your source code. Free scan, no signup.

Scan Your API Free →

Layer 3: Dependency Scanning (SCA)

Software Composition Analysis (SCA) scans your dependencies for known vulnerabilities. Your application might be perfectly written — but if you import a library with a critical CVE, you inherit that vulnerability.

The tools

  • GitHub Dependabot: Free, automatic. Opens PRs when vulnerable dependency versions are detected. Enable in Settings → Code security and analysis. Start here — zero friction.
  • npm audit / pip-audit / cargo audit: Native package ecosystem tools. Run these in CI as a blocking check on high-severity findings.
  • Snyk: Commercial, free tier for open source. More detailed vulnerability context and fix suggestions than native tools. Worth considering as you scale.

The cadence problem

New CVEs are published continuously. A dependency that was clean when you deployed may have a critical vulnerability today. Dependabot handles this by continuously monitoring your lockfiles against the advisory database — but you need to actually merge the PRs it opens, not let them accumulate.

Set a team practice: Dependabot PRs for critical/high severity get merged within 48 hours. Medium severity within one sprint cycle. Low severity in the next scheduled dependency update.

Layer 4: Container Scanning

If you're deploying containers, your base image is part of your attack surface. Anubuntu:20.04 base from six months ago may have dozens of OS-level vulnerabilities that won't appear in npm audit.

Tools

  • Trivy (by Aqua Security): Open source, fast, comprehensive. Scans container images for OS packages, language dependencies, and misconfigurations. The easiest starting point — one command, excellent coverage.
  • Docker Scout: Built into Docker Desktop and Docker Hub. Integrated if you already use Docker Hub for image storage.
  • Snyk Container: Commercial, integrates with CI and image registries.
# .github/workflows/security.yml - Trivy container scan
- name: Build container image
  run: docker build -t myapp:${{ github.sha }} .

- name: Run Trivy vulnerability scanner
  uses: aquasecurity/trivy-action@master
  with:
    image-ref: myapp:${{ github.sha }}
    format: 'sarif'
    output: 'trivy-results.sarif'
    severity: 'CRITICAL,HIGH'
    exit-code: '1'

Practical guidance

Pin your base images to specific digests (not just tags) to get reproducible builds. Use minimal base images (Alpine, distroless) to reduce attack surface. Schedule weekly rebuilds even when no code changes — this picks up base image patches.

Layer 5: External API Scanning — The Missing Layer

Here's where most startup DevSecOps stacks stop — and where they leave a critical gap. The four layers above all operate pre-deploy: they analyze code, dependencies, and container images before they ship. None of them can see what your API looks like after it's deployed.

Your deployed API can have security issues that don't exist in source code:

  • Security headers that are configured in code but stripped by a proxy or CDN
  • CORS configurations that look correct in code but resolve differently under production routing
  • Endpoints that are accidentally exposed due to a routing configuration change
  • TLS misconfiguration at the infrastructure level
  • Rate limiting that works in development but fails in distributed production

External API scanning is the post-deploy layer that catches what internal tools can't see. It tests your live API from the outside — the same perspective an attacker has.

For a deeper look at why this layer is distinct, internal vs external security scanning explains exactly what each catches and why you need both perspectives.

How Scantient fits the DevSecOps stack

Scantient is the external API scanning layer for startup DevSecOps stacks. It runs from outside your infrastructure — no agent, no SDK, no access to your codebase — and reports on what your deployed API exposes to the internet.

In a CI/CD context, you can:

  • Run a scan immediately after a production deploy and compare to the previous baseline
  • Get notified when new findings appear that weren't present before the deploy
  • Use the scan report as part of your post-deploy security checklist

This is the layer that closes the DevSecOps loop — you shift security left with SAST, SCA, and secret scanning, and you verify the deployed state with external monitoring. Neither is sufficient without the other.

Putting It Together: The Startup DevSecOps Pipeline

Here's how a complete startup DevSecOps GitHub Actions workflow looks, combining all five layers:

name: Security CI

on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      # Layer 1: Secret scanning
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - name: Gitleaks secret scan
        uses: gitleaks/gitleaks-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      # Layer 2: SAST
      - name: Semgrep
        uses: returntocorp/semgrep-action@v1
        with:
          config: p/security-audit p/owasp-top-ten

      # Layer 3: Dependency scanning
      - name: npm audit
        run: npm audit --audit-level=high

      # Layer 4: Container scanning (if applicable)
      - name: Build image
        run: docker build -t app:${{ github.sha }} .
      - name: Trivy scan
        uses: aquasecurity/trivy-action@master
        with:
          image-ref: app:${{ github.sha }}
          severity: CRITICAL,HIGH
          exit-code: '1'

  # Layer 5: External scan (post-deploy, in separate job)
  post-deploy-scan:
    needs: [deploy]  # runs after your deploy job
    runs-on: ubuntu-latest
    steps:
      - name: Notify external scan
        run: |
          curl -X POST https://scantient.com/api/scan \
            -H "Authorization: Bearer ${{ secrets.SCANTIENT_API_KEY }}" \
            -d '{"url": "https://api.yourapp.com"}'

The Alert Fatigue Problem

The most common failure mode for startup DevSecOps isn't ignoring security — it's implementing too many checks, generating too many alerts, and having developers learn to ignore the noise. Security tooling that blocks CI on every low-severity finding is worse than no tooling at all.

Recommended severity gates:

  • Block CI: Critical and High findings that are exploitable, directly in your code or dependencies
  • Warn (don't block): Medium severity, transitive dependency issues
  • Inform (weekly digest): Low severity, informational

Most tools support configuring severity thresholds. Use them. A security pipeline that developers work around is not a security pipeline.

SaaS Launch Security Considerations

Before your first launch, run through the SaaS launch security checklist — it covers the items that should be verified in production before you go public, complementing the CI/CD checks that catch issues pre-deploy. The two together give you full pipeline-to-production coverage.

DevSecOps Maturity Stages for Startups

You don't need to implement all five layers simultaneously. Staged rollout by company stage:

Stage 0–$10K MRR: Foundation

  • GitHub Dependabot enabled
  • npm audit in CI (high severity blocking)
  • GitHub Secret Scanning enabled
  • External API scan before each launch / major deploy

Stage $10K–$50K MRR: Hardening

  • Gitleaks pre-commit hook and CI check
  • Semgrep SAST in CI (critical/high blocking)
  • Trivy container scanning
  • Continuous external API monitoring (post-deploy automation)

Stage $50K+ MRR: Maturity

  • Annual penetration test by a third party
  • SOC 2 Type II preparation
  • Dedicated security review in engineering planning
  • Incident response plan documented and tested

The goal of Stage 0 is to catch the vulnerabilities that are responsible for the vast majority of startup breaches: leaked secrets, exploitable dependencies, and exposed production APIs. The cost is near zero. The risk reduction is substantial. Everything after that is incremental hardening as your risk profile and obligations grow.

Add the External Layer to Your DevSecOps Stack

SAST catches code issues. Dependency scanning catches CVEs. Scantient catches what's exposed after you deploy. Run your first external scan free — no signup, no SDK.