Dev.to Security πŸ” Cybersecurity πŸ‘ 2 πŸ“– 4 min read

Building a Lean, Go-Native Security Stack for CI β€” Less Bloat, Same Confidence

🎯 The Problem: Security Tooling Shouldn't Feel Heavy After going through some painful cyber incidents at work, I made a clear resolution for both my professional practice and my upcoming software business: security com

🎯 The Problem: Security Tooling Shouldn't Feel Heavy

After going through some painful cyber incidents at work, I made a clear resolution for both my professional practice and my upcoming software business: security comes first β€” but so does efficiency.

I want solid, continuous security scanning in my CI pipeline. But I don't want to drag in heavy runtimes, bulky images, or languages I don't otherwise use just to run a scanner. The friction of a slow pipeline kills adoption. If the security gate takes five minutes and pulls in half a gigabyte of dependencies every time, eventually you'll be tempted to skip it. And that's exactly what attackers hope for.

So I set out to answer one question: What does a practical, effective, lightweight CI security stack look like today?

πŸ—ΊοΈ My Evaluation Journey

I started with two excellent recommendations: Semgrep for static scanning and OWASP ZAP for dynamic testing. Both are industry-standard, well-respected tools β€” but then I hit a sticking point.

ZAP is distributed primarily as a Docker image (~600–800 MB) bundling a Java runtime and Python wrapper scripts. Functionally it's great. Practically? It felt like inviting two extra programming languages to sit at my table just to run a quick scan. I don't use Java or Python in my stack β€” why should my CI pipeline?

That constraint sent me looking for alternatives β€” and that's where I found a clean, coherent stack of Go-native tools that just work.

🧱 The Final Stack

Here's what I settled on β€” four tools, all single static binaries, zero heavy runtimes, covering the three essential security domains: source code, dependencies, and running application.

Layer Tool Purpose Size License
Static Analysis (SAST) Semgrep Scan source code for insecure patterns β€” including OWASP Top 10 ~15 MB binary AGPL / Commercial option
Dependency Scanning (SCA) Trivy Find known vulnerabilities in libraries, containers, and filesystems ~35 MB Apache 2.0
Endpoint Discovery Katana Crawl your running app to find every URL and API endpoint ~12 MB MIT
Dynamic Scanning Nuclei Test those endpoints against thousands of vulnerability templates ~15 MB MIT

Total footprint: ~75 MB. Four single files. No Java. No Python.

πŸ” How Each Part Works

Semgrep β€” Code Quality & Security Patterns

Semgrep was an easy keep from the start. It's fast, uses a clean declarative rule format, has built-in OWASP Top 10 coverage, and runs directly against your source without needing a compiled binary. It catches things like SQL injection patterns, XSS, and insecure cryptography β€” before your code even builds.

semgrep scan --config=p/owasp-top-ten --error .

Trivy β€” Know What You're Actually Shipping

Your own code might be clean, but what about the 47 direct and 212 transitive dependencies you pulled in? Trivy scans your go.mod, lock files, and container images for known vulnerabilities. It's fast, simple, and integrates seamlessly into every commit.

trivy fs --severity HIGH,CRITICAL --exit-code 1 .

Katana + Nuclei β€” Dynamic Testing, Lightweight

This pair replaces the "ZAP gap" for me β€” and actually fits my workflow better. Here's how they work together:

  1. Katana crawls your staging deployment and maps out every page, API route, and endpoint
  2. It passes that list straight into Nuclei, which runs vulnerability checks against each one

katana -u https://staging.example.com -silent | nuclei -severity critical,high

Nuclei works from templates β€” thousands of community-maintained vulnerability patterns you update with a single command (nuclei -ut). It's not doing the deep application logic probing that ZAP does, but it catches broken configurations, exposed panels, known CVEs, and common injection vectors β€” and it does it in seconds, not minutes.

βš–οΈ Trade-Offs β€” Be Honest About What You're Giving Up

Let's be clear: this stack is lean, but it's not complete. Here's the honest balance sheet so you can decide if it's right for you:

βœ… What You Get ❌ What You Give Up
Blazing fast scans β€” PRs stay snappy Less sophisticated application logic testing vs dedicated DAST tools
Zero runtime friction β€” works anywhere Go runs No built-in authenticated scanning (you'll need to configure headers manually)
Small CI footprint β€” less cache churn, quicker startup No GUI dashboard or historical trend tracking out of the box
Highly customisable β€” write your own templates/rules easily Manual effort needed to tune out false positives, same as any tool

My approach? Lean stack for every commit β€” catch the obvious stuff early and often. Once per quarter or pre-launch, bring in the heavier tools (including ZAP or a human pentester) for a deep audit. Best of both worlds.

πŸš€ The Workflow in Practice

Here's how this actually looks in a pipeline:

Developer opens PR
       ↓
Semgrep scans code patterns ❌ blocks on critical issues
       ↓
Trivy scans dependencies ❌ blocks on critical vulnerabilities
       ↓
Merge to main β†’ Deploy to staging
       ↓
Katana crawls staging β†’ feeds endpoints to Nuclei
       ↓
Nuclei scans for live vulnerabilities β†’ report posted, non-blocking
       ↓
Ship with confidence βœ…

Critical and High severity findings block the merge. Medium and Low get logged and reviewed weekly β€” triage over triage fatigue. Perfect is the enemy of secure.

πŸ’­ Closing Thoughts

Security doesn't have to mean complexity. You don't need an enterprise-grade appliance or a dozen services running in your pipeline to be significantly safer than most teams. You just need good coverage at the right stages, consistent execution, and tooling that stays out of your way.

This stack gives me:

  • βœ… Confidence I'm catching the most common issues
  • βœ… A pipeline that completes before I've finished my coffee
  • βœ… Zero language bloat I don't otherwise use
  • βœ… The ability to grow β€” add deeper scans later, keep what works today

Your security stack should serve you β€” not the other way around. Keep it lean. Keep it running. And keep shipping.

What does your CI security stack look like? Are there other lean Go-native tools I should know about? I'd love to hear what's working for you in the comments!

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.