DevSecOps Pipeline
Security gates developers can live with: secrets, SAST and image scanning in GitLab CI and Jenkins.
3 articles · 3 labs
Articles
Practical, in-depth guides on DevOps, DevSecOps, Kubernetes, cloud security and infrastructure — with real commands, working examples and lessons from production.
Written and maintained by Sachin Chaurasiya DevOps & DevSecOps Engineer · CKS · CKA · Azure DevOps Practical content for engineers who build, secure and operate real systems.
Prefer a structured route? Start with one of these paths, or browse all 9.
Security gates developers can live with: secrets, SAST and image scanning in GitLab CI and Jenkins.
3 articles · 3 labs
How a delivery pipeline really runs: build, test, artifact, deployment and rollback.
4 articles · 2 labs
Run workloads on a real cluster: controllers, probes and limits, real failures, Services and DNS, scaling.
5 articles · 2 labs
Hand-picked articles to get the most value from the site.
One Go service built two ways, then compared on size, packages, scanner findings and the user it runs as.
Tested with Docker 29.1.5, Trivy 0.68.2 , Go 1.27.1, distroless static-debian13
Frozen installs, parallel quality gates, Trivy, SAST and secret detection, one deployment owner.
Tested with GitLab.com shared runners, Node 22 , pnpm 12.4, Trivy 0.65
CEL-based validate, mutate and generate policies for non-root pods, image tags and registries, audit-first.
Tested with Kubernetes 1.35 (kind 0.31), Kyverno 1.19.1 (chart 3.9.1) , Helm 4.1
Explore all articles, guides and technical deep dives.
One application, three environments, one ApplicationSet: generated Applications, a manual gate on production, deletion policy.
Tested with Argo CD 3.5.3, Kubernetes 1.35 (kind 0.31) , kubectl 1.32, Gitea 1.24.7, Kustomize (built into Argo CD)
Attach the SBOM to the image digest as a signed in-toto attestation, verify it, and see what build provenance adds.
Tested with Cosign 3.1.3 (ghcr.io/sigstore/cosign/cosign image), Syft 1.51.1 SBOM (CycloneDX 1.7) , registry:2, Docker 29.1
Why a static access key is the wrong shape for a credential, and what short-lived, workload-bound identity looks like in practice.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , Terraform 1.14.9, Checkov 3.3.17, AWS provider 6.64.0
Public versus private, inbound versus outbound, and a three-tier layout where every boundary is proven with a connection test.
Tested with Docker 29.1 (OrbStack 2.0.5), nginx 1.31.5 , Redis 8.2, Terraform 1.14.9, AWS provider 6.64.0, Checkov 3.3.17, OpenSSL 3.6.1
CrashLoopBackOff, ImagePullBackOff, a missing ConfigMap and an empty Service, each reproduced and fixed with six commands.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , ci-demo:1.4.2, busybox:1.37 and curlimages/curl:8.14.1 images
Inventory a real image, find out why one dependency became 234 packages, and keep the SBOM where it will be needed.
Tested with Syft 1.51.1 (anchore/syft image), ci-demo:1.4.0 image on node:22.20.0-alpine3.22 , Docker 29.1, Python 3.14 for reading the JSON
Readiness, liveness and startup probes, requests and limits, OOMKilled, Pending and CPU throttling, each reproduced on a cluster.
Tested with Kubernetes 1.35 (kind 0.31, 1 control plane + 2 workers), kubectl 1.32 , busybox:1.37 and python:3.13-slim images
kube-prometheus-stack, Loki and Alloy on kind, then a workload OOM-killed every two minutes diagnosed from metrics, logs, events.
Tested with Kubernetes 1.35 (kind 0.31), kube-prometheus-stack 91.4.1 (Prometheus 3.14.0, Grafana 13.2.2, Alertmanager 0.34.0, kube-state-metrics 2.20.0, prometheus-operator 0.94.0) , loki chart 7.3.0 (Loki 3.6.11), alloy chart 1.12.1 (Alloy 1.19.2), Helm 4.1
Scale by hand, roll out and roll back with the CI/CD path commands, then let a real HorizontalPodAutoscaler do it under load.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , metrics-server v0.9.0, curlimages/curl:8.14.1 for load
From a Service name through DNS, ClusterIP and EndpointSlice to a pod, with the two mistakes that break the path most often.
Tested with Kubernetes 1.35 (kind 0.31, kindnet CNI, CoreDNS), kubectl 1.32 , busybox:1.37 and curlimages/curl:8.14.1 images
Deployment, StatefulSet, DaemonSet, Job and CronJob on a three-node kind cluster, and what each one does when a pod dies.
Tested with Kubernetes 1.35 (kind 0.31, 1 control plane + 2 workers), kubectl 1.32 , postgres:17-alpine, alpine:3.22 and busybox:1.37 images
Application, infrastructure and audit logs record different things. Kubernetes audit logging turned on, tuned and read.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , Prometheus promtool 3.14.0, nginx 1.31.5, Vault 1.21.4
What an internal platform provides, what it deliberately does not, and the contract between platform and application teams.
Tested with gitlab-ci-local 4.75.1, Argo CD 3.5.3 , Kyverno 1.19.1, kube-prometheus-stack 91.4.1, Kubernetes 1.35 (kind 0.31)
Baseline and production policy layers delivered by Argo CD, rolled out audit-first, with scoped expiring exceptions. Run on kind.
Tested with Kyverno 1.19.1 (chart 3.9.1), Argo CD 3.5.3 , Kubernetes 1.35 (kind 0.31), kubectl 1.32, Gitea 1.24.7
Identity, exposure, TLS, headers, secrets, patching, logs, backups and recovery as one list with a verification command per line.
Tested with curl 8.7.1, OpenSSL 3.6.1 , Kubernetes 1.35 (kind 0.31), etcd 3.6.0, Trivy 0.74.0, Checkov 3.3.17
A platform-owned pipeline template with inputs, a versioned include, extension points and a five-line consumer, run locally.
Tested with gitlab-ci-local 4.75.1, Gitea 1.24.7 (as the Git remote) , node:22.23.2-alpine3.24, Trivy 0.74.0, Gitleaks 8.30.1, Docker 29.1
Scan the SBOM, read severity and fix data, change the base image and the Dockerfile, and rescan until the gate passes.
Tested with Grype 0.118.0 (anchore/grype image, DB schema v6, built 2026-09-15), Syft 1.51.1 , node:22.20.0-alpine3.22 and node:22.23.2-alpine3.24 images, Docker 29.1
Where a credential leaks on its way to a running process, what a Kubernetes Secret really stores, and what a secret manager adds.
Tested with Docker 29.1 (BuildKit), Trivy 0.74.0 , Gitleaks 8.30.1, Kubernetes 1.35 (kind 0.31), etcd 3.6.0, Vault 1.21.4
Sign an image by digest, verify it, move the tag to a different image and watch verification fail, then place the check in CI.
Tested with Cosign 3.1.3 (ghcr.io/sigstore/cosign/cosign image), registry:2 (Docker Distribution) , Docker 29.1
Where compromise enters between source and a running container, and which control applies at each step.
Tested with Syft 1.51.1, Grype 0.118.0 , Cosign 3.1.3, Docker 29.1
Deterministic builds, caches that speed things up without lying, artifacts, needs, retries and timeouts.
Tested with gitlab-ci-local 4.75.1, node:22.20.0-alpine3.22 image , npm 10 (bundled with Node 22), Docker 29.1
Stages, jobs, runners, artifacts and environments, shown on a real pipeline you can run on your laptop.
Tested with gitlab-ci-local 4.75.1, node:22.20.0-alpine3.22 image , Docker 29.1
Run all three on a kind cluster, watch the traffic move, and learn which one each situation calls for.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , nginx 1.27.5-alpine and 1.29.1-alpine images, curl 8.14.1 image
A merge-request pipeline that blocks insecure Terraform, tolerates the known debt, and cannot be quietly bypassed.
Tested with Checkov 3.3.17 (bridgecrew/checkov image), Terraform 1.14.9 (hashicorp/terraform:1.14 image) , gitlab-ci-local 4.75.1, Docker 29.1
Detect a failed rollout, reverse it with what you already have, and keep data changes out of the blast radius.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , nginx 1.27.5-alpine and 1.29.1-alpine images
Scan a deliberately insecure Terraform configuration, read the findings, fix them, and prove the fix with a second scan.
Tested with Checkov 3.3.17 (bridgecrew/checkov image), Terraform 1.14.9 , Docker 29.1
The Terraform habits that keep infrastructure changes reviewable, reproducible and free of secrets in Git.
Tested with Terraform 1.14.9 (hashicorp/terraform:1.14 image), AWS provider 6.64.0 , Docker 29.1
One Go service built two ways, then compared on size, packages, scanner findings and the user it runs as.
Tested with Docker 29.1.5, Trivy 0.68.2 , Go 1.27.1, distroless static-debian13
Frozen installs, parallel quality gates, Trivy, SAST and secret detection, one deployment owner.
Tested with GitLab.com shared runners, Node 22 , pnpm 12.4, Trivy 0.65
Install Argo CD, model applications, enable automated sync and make Git the only way to change the cluster.
Tested with Argo CD 3.5.2, Kubernetes 1.35 (kind 0.31)
A per-page CSP with script hashes, hardening headers from Workers and the zone settings behind them.
Tested with Astro 7.3, Wrangler 4.131 , Cloudflare Workers static assets
CEL-based validate, mutate and generate policies for non-root pods, image tags and registries, audit-first.
Tested with Kubernetes 1.35 (kind 0.31), Kyverno 1.19.1 (chart 3.9.1) , Helm 4.1
Control plane, workloads, network, secrets, supply chain and runtime, each with a command that verifies it.
Tested with Kubernetes 1.35 (kind 0.31), kubectl 1.32 , jq 1.8
Gitleaks in pre-commit hooks and CI, tuned rules and allowlists, and what to do when a secret has already leaked.
Tested with Gitleaks 8.30.1, Git 2.50 , GitLab.com Secret Detection template
What Trivy finds in an image, how to make the findings actionable, and how to wire it into CI.
Tested with Trivy 0.68.2, Docker 29 , GitLab.com shared runners
A declarative pipeline with secrets scanning, SAST, image scanning and least-privilege credentials.
Tested with Jenkins 2.568.3 LTS (declarative linter), Gitleaks 8.30 , Trivy 0.68
Showing all 36 articles.