Skip to content
$ lynuxpro
← DevSecOps

LESSON 1 OF 22 · BEGINNER · 10 MIN

Shifting security left

Free previewLesson 1 of the 2 free lessons in this Pro course.Unlock all 22

HOW IT WORKSFind problems early

Plancheap to fixCodecheapBuildmediumTestcostlyProductionvery costlyShift leftchecks start here
1/5

A security bug found in production costs the most to fix.

In simple words

  • DevSecOps: building security into every step of development and delivery, instead of checking it only at the end.
  • Shift left: finding security problems earlier (while coding and in CI), when they are cheaper and easier to fix.
  • Shift right: watching for security problems in production as well.
  • Guardrail: an automatic safety check that guides people without slowing them down.

Big picture

DevSecOps means security is part of every step of building software, not a gate at the end. "Shift left" means moving security checks earlier on the timeline, toward the developer.

Think of building a house. It is cheap to move a wall on the drawing. It is expensive to move it after the house is built. A security bug is the same: the later you find it, the more it costs.

Plan -> Code -> Build -> Test -> Release -> Deploy -> Run ^       ^       ^       ^                              ^ |       |       |       |                              |threat   IDE +   SAST +  DAST         sign + scan       runtimemodel    secrets SCA     API tests    admission         monitoring
OUTPUTterminalutf-8 · 5L

Old way and new way

Old wayDevSecOps
When security looksOnce, before releaseAt every commit and every stage
Who is responsibleA separate security teamEveryone; security teams give tools and advice
FeedbackA long report weeks laterA message in the pull request within minutes
FixingA big, risky rushSmall fixes while the code is fresh

What "left" and "right" mean

  • Left is early: design, coding, pull requests. Checks here are cheap and fast.
  • Right is late: running in production. Checks here see real attacks but fix things slowly.
  • You need both. Shifting left does not mean dropping runtime protection. It means adding checks earlier.

The checks you will learn

StageCheckLesson
DesignThreat modeling03
CodeSecret scanning04
CodeSAST (reads your source code)05
BuildSCA (checks libraries you use)06
BuildContainer image scanning07
BuildInfrastructure as code scanning08
PipelineSecure the CI/CD system itself10
DeployPolicy and admission control12
ReleaseSigning and supply chain13
TestDAST (attacks a running app)14
RunRuntime detection16

A first small step

A tiny change gives you a real result. This pipeline job scans the repository for leaked secrets on every push:

secret-scan:  stage: test  image: zricethezav/gitleaks:latest  script:    - gitleaks detect --source . --verbose
NORMALyamlutf-8 · 5L
Finding:     AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCY...RuleID:      aws-access-tokenFile:        config/dev.envLine:        4Commit:      9f1c2ab1 leaks found
OUTPUTterminalutf-8 · 6L

The job fails, the developer sees the file and line, and the secret is removed before it reaches production. Pin a real version tag instead of latest in your own pipeline.

Make security easy

Developers skip checks that are slow or noisy. Good DevSecOps teams follow a few rules:

RuleWhy
Keep fast checks in the pull request (under 5 minutes)Slow checks get skipped
Run slow checks (full DAST) on a schedule or before releaseKeeps the feedback loop quick
Start in "report only" mode, then turn on blockingAvoids surprise failures on day one
Only block on high and critical findings at firstCuts noise
Show results in the pull request, with a fix hintDevelopers act on what they can see

The three layers of defense

  1. Prevent: make mistakes hard (templates, safe defaults, secure libraries).
  2. Detect: find problems fast (scanners, logs, alerts).
  3. Respond: fix and learn (incident process, post-incident review).

A mature program has all three. Most beginners only build detect.

Common mistakes

  • Buying a scanner and calling it done. A scanner nobody reads is only noise.
  • Turning on every rule at once. The team drowns in findings and ignores all of them.
  • Making security a blocker with no help. Give fix guidance, not only "failed".
  • Forgetting the pipeline itself. Attackers target CI/CD systems too (lesson 10).
  • Measuring only the number of findings. Measure time to fix (lesson 18).

Summary

  • DevSecOps puts security into every step, owned by everyone.
  • Shift left to find problems early, when they are cheap to fix.
  • Keep checks fast, clear and gradual so people accept them.
  • Prevent, detect and respond. You need all three.
  • The rest of this course walks left to right through the pipeline.

CHECK YOUR UNDERSTANDING

3 quick questions

  1. 1. What does "shift left" mean in DevSecOps?

  2. 2. A new scanner finds hundreds of issues on day one. What is a good first step?

  3. 3. Which set describes the three layers of defense?