Welcome to Day 27 of the 30 Days AWS Security Challenge, and the start of our final stretch on process, compliance, and career. Yesterday we tied together the Well-Architected Security Pillar. Today we look at where security actually gets applied day to day: your CI/CD pipeline.
What DevSecOps Actually Means
DevSecOps is the idea of building security checks directly into your existing development and deployment pipeline, rather than treating security as a separate review that happens right before, or worse, right after, something goes to production. The name itself tells you the goal: security becomes part of Dev and Ops, not a separate gate bolted on at the end.
The alternative, catching security issues only through a manual review late in the process, is slow and unreliable. By the time a human reviewer looks at a change, it might already be deployed, or the fix might require unwinding several later commits. Automating security checks earlier catches problems while they're still cheap and easy to fix.
Shifting Security Left
You'll often hear this called "shifting left," meaning security checks move earlier, or further left, on a typical pipeline diagram that flows from code to build to deploy. The earlier a problem is caught, ideally before code is even merged, the cheaper and less disruptive it is to fix.
Where Security Checks Fit in an AWS Pipeline
A typical AWS based CI/CD pipeline using CodePipeline and CodeBuild has several natural points to add automated security checks:
- Static code analysis, scanning your actual source code for common vulnerability patterns before it's even built, catching issues like hardcoded credentials or unsafe code patterns
- Dependency scanning, checking third party libraries your code relies on for known vulnerabilities, similar in spirit to what Inspector does for running workloads, but applied before deployment
- Container image scanning, using ECR's scan on push feature (from Day 23) as part of your build process, failing the pipeline if a critical vulnerability is found in the image before it's ever deployed
- Infrastructure as code scanning, checking your CloudFormation or Terraform templates for misconfigurations, like an S3 bucket definition that would create a publicly accessible resource, before that infrastructure is ever provisioned
- Automated compliance checks, using Config Rules (from Day 16) to validate that newly deployed resources meet your organization's standards immediately after deployment
A Practical Pipeline Example
Imagine a pipeline that builds a containerized application. Code is pushed to a repository, triggering CodeBuild, which runs a dependency scan and fails the build if a critical vulnerability is found. If that passes, the container image is built and pushed to ECR, where scan on push runs automatically. The pipeline waits for that scan result and refuses to proceed to deployment if a critical finding comes back. Once deployed, Config Rules confirm the new resources meet baseline security requirements, and any noncompliant resource generates an immediate alert through the setup from Day 16.
Notice how each of these checks maps back to a service we've already covered this month. DevSecOps isn't really a new set of tools, it's about wiring the tools you already have into the pipeline instead of running them separately after the fact.
Failing Builds vs Just Warning
A key design decision is whether a security finding should actually block a deployment or just generate a warning. Blocking on every finding, including low severity ones, quickly frustrates developers and often leads to people looking for ways around the pipeline entirely. A more practical approach is blocking on Critical and High severity findings, while logging Medium and Low findings for review without stopping the deployment. This mirrors the same prioritization approach we used with Inspector findings on Day 19.
Making It a Team Effort
DevSecOps also has a cultural dimension, not just a technical one. It works best when security isn't something imposed on developers from outside, but something built into the tools they already use daily. Fast feedback matters here: a developer who finds out about a hardcoded credential within minutes, during their own pull request, is far more likely to fix it immediately than one who receives a security report three weeks after the fact.
Key Takeaways
- DevSecOps means embedding security checks directly into your existing CI/CD pipeline, not treating security as a separate later step
- Shifting checks earlier catches problems while they're still cheap and easy to fix
- Static analysis, dependency scanning, container scanning, and infrastructure as code scanning all have natural places in an AWS pipeline
- Block deployments on Critical and High findings, while logging lower severity findings for review
- Most of the tools involved are ones we've already covered this month, DevSecOps is about integration, not new tools
Tomorrow we look at what happens when prevention and detection aren't enough, with a practical guide to incident response on AWS.
Loading article