Lección 2 de 7 · 9 min
Securing the CI/CD pipeline: SAST, DAST, secrets and breaking the build
Automated checks in continuous integration catch problems before they ship. Learn what static and dynamic testing find, why leaked secrets are so dangerous, when to fail a build, and how to protect the pipeline itself.
Por ahora esta página está en inglés.
Continuous integration and continuous delivery (CI/CD) is the automated assembly line of modern software. Every change a developer pushes is built, tested and often deployed without a person touching it. That automation is also the ideal place for security checks: they run every time, for every change, the same way. It also makes the pipeline itself a target, because whoever controls it controls what gets shipped.
The main automated checks
| Check | What it looks at | Good at finding | Limits |
|---|---|---|---|
| SAST (static analysis) | Source code, without running it | Unsafe patterns such as injection risks and insecure functions | False positives; cannot see runtime configuration |
| Dependency scanning (SCA) | Third-party libraries and their versions | Components with publicly known vulnerabilities | Only knows about vulnerabilities already published |
| Secrets scanning | Code, configuration and history | API keys, passwords and tokens committed by mistake | Unusual secret formats can slip through |
| DAST (dynamic analysis) | A running test instance, from the outside | Issues in real behaviour: headers, sessions, input handling | Needs a deployed test environment; slower |
OWASP keeps a list of source code analysis tools, and projects such as OWASP Dependency-Check and the ZAP dynamic scanner are widely used open-source options. Code hosting platforms also provide built-in secret scanning; GitHub’s version can block a push that contains a recognised secret before it ever reaches the repository.
Why leaked secrets deserve special attention
A vulnerability usually needs work to exploit. A leaked cloud key or access token does not: anyone who finds it can simply use it. Secrets committed to a repository also stay in its history even after the line is deleted, and repositories get copied, forked and made public by mistake. The OWASP Secrets Management Cheat Sheet recommends keeping secrets out of code entirely, in a dedicated secrets manager, with short lifetimes and automatic rotation.
- Scan before the commit (a pre-commit hook) and again on the server, in case the hook was skipped.
- If a secret leaks, revoke and rotate it first. Deleting the commit is not enough.
- Prefer short-lived credentials issued to the pipeline at run time over long-lived keys stored in settings.
Breaking the build, deliberately
A check only matters if its result changes what happens. “Breaking the build” means the pipeline stops and the change cannot be merged or deployed until the problem is fixed. The skill is choosing what should block. A useful rule is to block on findings that are high-confidence and high-impact, such as a verified secret or a critical known-vulnerable dependency with an available fix, and report everything else as a warning to review. Blocking on everything leads teams to disable the check.
Protecting the pipeline itself
The pipeline has access to source code, secrets and production. The OWASP CI/CD Security Cheat Sheet lists the main protections:
- Least privilege for pipeline jobs: each job gets only the permissions and secrets it needs.
- Protected branches and mandatory review, so nobody can push straight to what gets deployed.
- Pin third-party build actions and plugins to exact, reviewed versions.
- Isolate build runners, and do not run untrusted pull request code with access to secrets.
- Log pipeline changes and runs, and review who changed the pipeline definition.
Where FireAI fits
Pipelines usually run in the cloud, beyond FireAI’s reach. On the developer’s Mac, though, FireAI lets you see and control which apps and tools connect to code hosts, package registries and cloud services, and its rules can be exported to a file to back them up or reuse them on another Mac.
Lo esencial
- SAST reads code, SCA checks dependencies, secrets scanning finds credentials and DAST tests the running app.
- A leaked secret is immediately usable: revoke and rotate it, do not just delete the line.
- Break the build only on high-confidence, high-impact findings, with a recorded exception process.
- The pipeline is a target: apply least privilege, protected branches and pinned dependencies.
Ponte a prueba
1. Which check analyses source code without running it?
- DAST
- SAST — Correcto.
- Penetration testing
- Load testing
Static application security testing reads the code itself; dynamic testing exercises a running instance.
2. A developer accidentally committed a cloud access key. What is the first priority?
- Delete the line and push again
- Revoke and rotate the key — Correcto.
- Rename the repository
- Wait to see if anyone uses it
The key stays in history and may already be copied. Revoking it makes the leaked value useless.
3. What is a sensible policy for breaking the build?
- Block on every warning from every tool
- Never block, only report
- Block on high-confidence, high-impact findings and report the rest — Correcto.
- Let each developer decide
Blocking on everything leads teams to disable checks; blocking on nothing means findings are ignored.
Ponlo en práctica con FireAI
Pon esta lección en práctica en tu propio Mac.
- Reglas: app, sitio web, dominio, IP o un rango, para siempre o hasta que reinicies — Escribe una regla tan precisa como una sola dirección o tan amplia como un dominio entero.
- Importa y exporta tus reglas — Lleva tus reglas a un Mac nuevo, o respáldalas, en un par de clics.
- Cómo vigila FireAI las conexiones de tu Mac — Sabe qué app está hablando con internet, en términos claros, sin instalar nada que se ejecute como un servicio oculto en segundo plano.
- Listas de amenazas (opcional) — Compara tu tráfico con datos públicos de amenazas sin enviarlo a ningún sitio.
- El Mapa mundial — Ve a dónde va realmente tu información, no solo un nombre de host que tendrías que buscar tú mismo.
Fuentes
- OWASP CI/CD Security Cheat Sheet
- OWASP Secrets Management Cheat Sheet
- OWASP: Source Code Analysis Tools
- OWASP Dependency-Check
- ZAP (Zed Attack Proxy)
- GitHub Docs: About secret scanning
- NIST SP 800-204D: Software supply chain security in DevSecOps CI/CD pipelines
Ponlo en práctica en tu Mac
Prueba todas las funciones gratis durante 17 días, sin tarjeta.