Skip to content
📦 Technology & EngineeringDevops Cloud68 lines

DevSecOps

Integrate security practices into DevOps workflows and CI/CD pipelines. Covers

Paste into your CLAUDE.md or agent config

DevSecOps

Core Philosophy

DevSecOps embeds security into every phase of the software delivery lifecycle rather than treating it as a gate at the end. Security checks that run in CI/CD pipelines, automated vulnerability scanning, and security-as-code practices enable teams to ship fast without accumulating security debt. The principle is that security is everyone's responsibility, not a separate team's checkpoint.

Key Techniques

  • SAST (Static Application Security Testing): Analyze source code for security vulnerabilities during the build phase. Catches SQL injection, XSS, and insecure patterns before code reaches production.
  • DAST (Dynamic Application Security Testing): Test running applications for vulnerabilities by simulating attacks. Catches runtime issues that static analysis misses.
  • Dependency Scanning: Continuously monitor third-party libraries for known CVEs and automatically create alerts or pull requests when vulnerabilities are disclosed.
  • Container Image Scanning: Scan container images for OS-level vulnerabilities, misconfigurations, and embedded secrets before deployment.
  • Infrastructure Security Scanning: Validate IaC templates against security policies (open ports, public buckets, missing encryption) before provisioning.
  • Secret Detection: Scan commits and repositories for accidentally committed credentials, API keys, and tokens using tools like GitLeaks or TruffleHog.

Best Practices

  • Run security scans in CI pipelines and fail builds on critical vulnerabilities. Make security a quality gate, not an afterthought.
  • Maintain a software bill of materials (SBOM) for every deployed artifact.
  • Use signed commits and verified container images to ensure supply chain integrity.
  • Implement least-privilege access for all CI/CD service accounts and deployment pipelines.
  • Rotate secrets automatically and never store them in version control.
  • Conduct regular threat modeling exercises for new features and architectural changes.
  • Treat security findings like bugs: triage, prioritize, assign, and track to resolution.

Common Patterns

  • Security Pipeline Stage: A dedicated pipeline stage that runs SAST, dependency scanning, and secret detection in parallel, blocking promotion on critical findings.
  • Policy as Code: Define security policies in OPA/Rego or Sentinel and enforce them automatically across infrastructure and application deployments.
  • Bug Bounty Integration: Feed external security researcher findings into the same tracking and remediation workflow as automated scanner results.
  • Compliance as Code: Automate compliance checks (SOC2, HIPAA, PCI) and generate audit evidence from pipeline and infrastructure state.

Anti-Patterns

  • Running security scans but ignoring the results. Unenforced scanning creates a false sense of security.
  • Blocking all builds on any finding regardless of severity. This creates alert fatigue and incentivizes teams to bypass security checks.
  • Relying solely on perimeter security rather than defense in depth.
  • Treating security as only a pre-production concern. Production environments need continuous monitoring and runtime protection.
  • Not updating dependencies because "it works." Unpatched libraries are the most common attack vector.
  • Granting CI/CD systems admin-level cloud permissions for convenience.