Save products you love by clicking the heart icon.
What Flux v2.8 and Helm v4 change for GitOps users — server-side apply, kstatus health checks, CEL expressions, .status.inventory, Cosign v3, and the post-renderer breaking change.
A complete learning path from absolute beginner to production-ready DevOps professional. Start with Linux fundamentals, progress through containers and Kubernetes, add observability and automation, and finish with AI infrastructure. All open-source, vendor-neutral, with mapped certifications and production-ready stacks.
We analyzed 2,080 open-source DevSecOps repositories across GitHub, GitLab, and Codeberg — a corpus built from 150+ search queries spanning every subdomain from build pipelines to runtime monitoring. The security category alone contains 491 repositories (23.6% of the total), making it the largest single category in the corpus.
Within security, the Kubernetes-specific subset comprises 39 repositories spanning scanning, admission control, runtime detection, and RBAC management. When we cross-reference against the research paper corpus (2,840 academic papers), Kubernetes security generates 188 paper mentions — more than any other single technology.
But adoption ≠ understanding. The most starred security tools have zero dedicated academic evaluation papers in the corpus. Teams are deploying production security stacks based on community reputation, not empirical evidence.
Here's the breakdown of the 491 security repositories by subcategory:
| Subcategory | Repos | Description |
|---|---|---|
| Application tools | 225 | Scanners, auditors, pentesting frameworks |
| Security systems | 133 | Platforms, orchestrators, management dashboards |
| Theory & standards | 51 | Specifications, threat models, taxonomies |
| Systems integrations | 47 | CSI plugins, admission controllers, operators |
| Review & comparison | 19 | Awesome lists, benchmarks, evaluations |
This guide maps the actual tool ecosystem — organized by defense layer — so you can build a security stack backed by adoption data, not marketing.
Kubernetes security isn't one tool. It's a layered defense where each stage catches different threat classes:
┌─────────────────────────────────────────────┐
│ Layer 5: Supply Chain Integrity │ cosign, sigstore, rekor
├─────────────────────────────────────────────┤
│ Layer 4: Runtime Detection & Response │ falco, tetragon, tracee
├─────────────────────────────────────────────┤
│ Layer 3: Policy Enforcement (Admission) │ kyverno, gatekeeper, kubewarden
├─────────────────────────────────────────────┤
│ Layer 2: Secrets Management │ vault, sops, sealed-secrets, infisical
├─────────────────────────────────────────────┤
│ Layer 1: Image & Dependency Scanning │ trivy, grype, syft, semgrep
├─────────────────────────────────────────────┤
│ Build / CI Pipeline │ buildah, kaniko, buildkit
└─────────────────────────────────────────────┘
Each layer has a dominant open-source tool (or two). But "dominant" doesn't mean "only option." The corpus reveals a healthy ecosystem with real alternatives at every layer.
This is where most teams start — and where the tool landscape is richest. The corpus contains 21 scanning repositories with a combined 132,000+ stars.
| Tool | Stars | Scans | Integration | License |
|---|---|---|---|---|
| Trivy | 37,384 | Images, FS, IaC, licenses, secrets | CLI, CI/CD, K8s operator, GitHub Action | Apache-2.0 |
| Grype | 12,724 | Images, SBOMs, directories | CLI, GitHub Action | Apache-2.0 |
| Semgrep | 16,209 | Source code (SAST) | CLI, CI/CD, pre-commit | LGPL-2.1 |
Trivy dominates with 37K stars — more than Grype and Semgrep combined. It scans container images, filesystems, Git repositories, Kubernetes configurations, and even cloud infrastructure. The trivy-operator (1,920 ⭐) runs continuous scanning inside clusters via Kubernetes CRDs.
But dominance doesn't make it universally right. Semgrep excels at custom rule authoring for proprietary code patterns. Grype is purpose-built for SBOM-first workflows — pair it with Syft (9,397 ⭐) to generate SBOMs, then feed them to Grype for vulnerability matching.
# Generate SBOM with Syft
syft packages dir:./src -o spdx-json > sbom.spdx.json
# Scan SBOM with Grype
grype sbom:sbom.spdx.json --fail-on critical
# Or: one-shot Trivy scan (image + config + secrets)
trivy image --severity HIGH,CRITICAL \
--exit-code 1 \
--ignore-unfixed \
myregistry.com/app:v1.2.3
| Scenario | Recommendation |
|---|---|
| "Just scan images in CI" | Trivy (fastest setup, widest coverage) |
| "SBOM-first compliance" | Syft + Grype (CycloneDX/SPDX output, policy-driven) |
| "Custom SAST rules for proprietary code" | Semgrep (pattern language, registry of community rules) |
| "Terraform/IaC scanning too" | Trivy or Checkov (Checkov has 8,935 ⭐, stronger IaC rules) |
| "Everything in one CI pipeline" | Trivy image + semgrep source + checkov iac |
No academic benchmark exists for these tools (see Research Gaps below), but community-reported data from blog posts and CNCF working groups gives us approximate figures:
| Tool | Full Image Scan | SBOM Scan | False Positive Rate | CI Integration Cost |
|---|---|---|---|---|
| Trivy | 10–30s | 2–5s | Moderate (improving) | Near-zero (single binary) |
| Grype | 5–15s | 1–3s | Low (Grype DB is conservative) | Low (Go binary + SBOM file) |
| Semgrep | 30–120s (SAST is inherently slower) | N/A | Low (pattern matching is precise) | Medium (needs rule management) |
Trivy's speed advantage comes from its standalone architecture — no SBOM generation step required. But Grype + Syft wins on SBOM portability: you can scan the same SBOM with multiple engines, share it with stakeholders, and store it for compliance audits. For teams subject to NIST SP 800-218 (Secure Software Development Framework), the SBOM-first approach is increasingly mandatory.
For a deeper dive into container image building and hardening alongside scanning, see Container Building and Hardening: A Production-Ready Guide.
Secrets in Kubernetes have a well-known problem: base64-encoded Secret objects are not encrypted at rest by default. The corpus tracks 35 secrets-focused repositories, and the ecosystem has converged on three distinct approaches.
| Approach | Tool | Stars | Model | Kubernetes Integration |
|---|---|---|---|---|
| External secret store | HashiCorp Vault | 36,116 | Centralized vault, dynamic secrets | CSI provider, injector, Helm chart |
| GitOps-native encryption | Mozilla SOPS | 22,797 | File-level age/GPG/KMS encryption | Flux integration, external-secrets |
| Kubernetes-native | Sealed Secrets | 9,243 | Asymmetric encryption, native CRD | Kubernets controller only |
| Modern alternative | Infisical | 28,752 | EKS-style model, open-source | Operator, Helm, external-secrets |
Vault remains the most-adopted secrets manager in the corpus. It supports dynamic secrets (database credentials that auto-rotate), transit encryption (encrypt-as-a-service), and PKI backends.
# Vault Agent Injector annotation — no code changes needed
apiVersion: v1
kind: Pod
metadata:
name: app-with-vault
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "my-app"
vault.hashicorp.com/secret-volume-path: "/etc/secrets"
spec:
containers:
- name: app
image: myapp:latest
The Vault CSI provider (349 ⭐) offers an alternative to the mutating webhook injector — mounts secrets as files via the standard Kubernetes CSI interface.
For GitOps purists who want everything in Git (including encrypted secrets), SOPS is the standard. This approach encrypts secrets at the file level before they enter version control, so your Git repo contains only ciphertext — the decryption key lives in your CI platform's secrets store or a KMS.
When to choose SOPS over Vault:
# Encrypt a Kubernetes secret with SOPS
sops --encrypt \
--kms "arn:aws:kms:us-east-1:123456:key/abcd" \
--encrypted-regex '^(data|stringData)$' \
my-secret.yaml > my-secret.enc.yaml
# Decrypt at apply time with Flux
flux reconcile kustomization apps --with-source
The external-secrets operator (6,786 ⭐) bridges external secret stores (Vault, AWS SM, GCP SM, Azure KV, Infisical, Doppler) into Kubernetes Secret objects. It's the most flexible option if you use multiple secret stores.
The simplest approach: encrypt a Secret into a SealedSecret CRD that only the cluster controller can decrypt. No external dependencies.
# Encrypt from a file
kubeseal --format=yaml \
-f my-secret.yaml \
-w my-sealed-secret.yaml
# Apply — the controller decrypts in-cluster
kubectl apply -f my-sealed-secret.yaml
When to choose Sealed Secrets:
Secret objects and want the simplest lift-and-shift pathThe three approaches aren't mutually exclusive. In the corpus, the most mature production setups typically use two or more in combination:
| Team Profile | Primary | Secondary | Why |
|---|---|---|---|
| Small team, single cluster | Sealed Secrets | — | Minimal ops, no external dependencies |
| GitOps-native, multi-cluster | SOPS + External Secrets | — | Git-audit trail, per-cluster KMS keys |
| Enterprise, multi-team | Vault + External Secrets | SOPS for GitOps teams | Centralized governance, dynamic secrets for DBs |
| Startup, fast iteration | Infisical | — | Developer-friendly UX, EKS-style model, free tier |
The external-secrets operator (6,786 ⭐) acts as the universal bridge — it can source from Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, Infisical, Doppler, 1Password, and even Kubernetes itself. This means you can start with one backend and migrate to another without changing your application manifests.
For a complete GitOps secrets management walkthrough, see GitOps Secrets Management in Production.
This is the most fragmented layer — the corpus tracks 73 policy-as-code repositories, reflecting the ongoing debate between Rego, CEL, and WASM-based approaches.
| Tool | Stars | Policy Language | Enforcement | Learning Curve |
|---|---|---|---|---|
| Kyverno | 8,031 | YAML (no new language) | Mutating + Validating webhook | Low |
| OPA Gatekeeper | 4,263 | Rego (DSL) | Validating webhook | High |
| Kubewarden | N/A | Any language → WASM | Validating webhook | Medium |
Kyverno's killer advantage: policies are just Kubernetes resources. No Rego to learn, no WASM compilation, no custom DSLs. A typical policy:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-resource-limits
spec:
validationFailureAction: Enforce
rules:
- name: check-limits
match:
any:
- resources:
kinds:
- Pod
validate:
message: "CPU and memory limits are required"
pattern:
spec:
containers:
- resources:
limits:
cpu: "?*"
memory: "?*"
The official Kyverno policies library (499 ⭐) ships 60+ production-ready policies covering CIS benchmarks, pod security standards, and best practices.
Gatekeeper (OPA) excels when you need:
Kubewarden takes a fundamentally different approach: policies are compiled to WebAssembly (WASM) modules and executed in a sandboxed runtime inside the admission webhook. This means you can write policies in Rust, Go, Swift, or any language that compiles to WASM — not just YAML or Rego.
Kubewarden's advantages:
The trade-off: you need to compile policies before deploying, and the ecosystem of pre-built policies is smaller than Kyverno's 60+ library. For teams writing complex custom policies (custom resource validation, multi-cluster admission logic, business-rule enforcement), Kubewarden is worth the steeper setup cost.
Migrating between policy engines is non-trivial. Practical guidance from the corpus:
# Kyverno policy to block privileged containers (enforce)
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: block-privileged
spec:
validationFailureAction: Enforce
rules:
- name: deny-privileged
match:
any:
- resources:
kinds:
- Pod
validate:
message: "Privileged containers are forbidden"
pattern:
spec:
containers:
- (securityContext):
privileged: "false"
# Equivalent OPA/Gatekeeper constraint
apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
name: k8sblockprivileged
spec:
crd:
spec:
names:
kind: K8sBlockPrivileged
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8sblockprivileged
violation[{{"msg": msg}}] {
container := input.review.object.spec.containers[_]
container.securityContext.privileged == true
msg := sprintf("Privileged container %v is forbidden", [container.name])
}
---
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sBlockPrivileged
metadata:
name: block-privileged
Notice the Rego version requires both a ConstraintTemplate and a Constraint instance, plus an entirely new DSL to learn. This verbosity is why Kyverno dominates in adoption — the 8K stars vs 4K stars for Gatekeeper reflect this developer-experience gap.
For a deep comparison of Kyverno's approach to Kubernetes security in the AI era, see Kubescape 4.0: Kubernetes Security in the AI Era.
Scanning catches known vulnerabilities. Runtime security catches unknown threats — malicious behavior, crypto mining, privilege escalation, and data exfiltration happening inside running containers.
| Tool | Stars | Approach | Detection Types |
|---|---|---|---|
| Falco | 9,264 | Syscall monitoring | System calls, file access, network, container drift |
| Tetragon | 4,918 | eBPF | System calls, process execution, network, tracing |
| Tracee | 4,582 | eBPF | System calls, containers, signatures, in-app attacks |
| Kubescape | 11,601 | Hybrid (scan + runtime) | CIS/NIST, image scanning, RBAC analysis |
Falco is the CNCF graduation project for runtime security. It monitors Linux system calls and matches them against rules:
# Detect a shell spawned inside a container
- rule: Terminal Shell in Container
condition: >
spawned_process and container and
proc.name in (bash, sh, zsh) and
proc.pname != docker-entrypoint and
proc.pname != containerd
output: >
Terminal shell spawned in container
(user=%user.name container=%container.name
shell=%proc.name parent=%proc.pname cmdline=%proc.cmdline)
priority: WARNING
Falco outputs to standard streams, which you can route to Elasticsearch, Loki, Slack, or any alerting system.
Tetragon (from the Cilium team, 25K ⭐ for Cilium itself) uses eBPF instead of kernel modules — no kernel headers, no out-of-tree module compilation, better performance. It's the direction the ecosystem is heading.
This is the most common question in the runtime security space, and the corpus data doesn't answer it — neither tool has comparative academic evaluation. Here's what practitioners report:
| Factor | Falco | Tetragon |
|---|---|---|
| Maturity | CNCF graduated, 6+ years in production | CNCF incubating, 2+ years |
| Detection model | Rule-based (declarative YAML rules) | Tracing-based (policy hooks on process lifecycle) |
| Custom rules | Easy — write YAML rules, extensive community library | Harder — requires Go/JSON policies, fewer examples |
| Performance | Good, but adds kernel module overhead | Better — eBPF has lower overhead, especially at high event rates |
| Kernel compatibility | Requires kernel headers or prebuilt module | Better out-of-the-box (eBPF CO-RE reduces header dependency) |
| Visibility | Syscall-level (what happened) | Process lineage + network (what happened and what called it) |
| Multi-cluster | Falco Talon (sidecar) for federated alerting | Native Kubernetes-native architecture |
| Alerting | Rich: file output, webhook, Slack, ES, Loki | Built-in Grafana integration via Cilium Hubble |
Practical recommendation: If you're starting fresh and already use Cilium for networking, Tetragon integrates seamlessly — same daemonset model, same observability pipeline. If you have existing Falco rules or need the broader community rule library, stay with Falco. Both are production-viable.
Kubescape (11,601 ⭐) deserves special mention because it spans multiple layers simultaneously: image scanning (Layer 1), RBAC/pod security analysis (Layer 3), and compliance checking. It's the only tool in the corpus that attempts to cover the entire defense stack in one binary.
For teams that want a single tool to deploy and get "good enough" coverage across all layers, Kubescape is a pragmatic choice. For teams that want best-of-breed at each layer, the individual tools recommended in this guide will outperform it — but at the cost of managing multiple integrations.
For monitoring the observability stack that surfaces these security signals, see Production Observability Stack: Grafana, Prometheus, Loki.
Container supply chain attacks are the fastest-growing threat vector in the corpus data. The ecosystem has converged around the Sigstore project (535 ⭐ core, 6,206 ⭐ for cosign).
| Component | Stars | Purpose |
|---|---|---|
| Cosign | 6,206 | Container image signing and verification |
| Rekor | 1,193 | Transparency log (tamper-evident signing record) |
| Fulcio | — | Certificate authority (binds OIDC identity to signing key) |
# Sign an image after build (in CI pipeline)
cosign sign --key env://COSIGN_PRIVATE_KEY \
myregistry.com/app:v1.2.3
# Verify before deployment (in admission controller or deploy script)
cosign verify --key cosign.pub \
myregistry.com/app:v1.2.3
# Keyless signing (OIDC-based, no key management)
cosign sign --yes myregistry.com/app:v1.2.3
cosign verify --certificate-identity=ci@github.com/myorg \
--certificate-oidc-issuer=https://token.actions.githubusercontent.com \
myregistry.com/app:v1.2.3
For real-world examples of supply chain attacks in the npm ecosystem, see TanStack npm Supply Chain Attack: Anatomy of a Compromise.
Based on the corpus adoption data, here's a decision matrix for building a production Kubernetes security stack:
| Decision | Recommendation | Stars | Why |
|---|---|---|---|
| Image scanning | Trivy | 37K | Fastest, widest coverage, K8s operator |
| IaC scanning | Checkov | 9K | 800+ built-in checks, Terraform + K8s + Cloud |
| Source SAST | Semgrep | 16K | Custom rules, community registry |
| Secrets | Vault or Infisical | 36K / 29K | Vault for complex infra, Infisical for developer experience |
| Policy enforcement | Kyverno | 8K | YAML policies, no new language, mutating + validating |
| Runtime security | Falco (stable), Tetragon (modern) | 9K / 5K | Falco has maturity; Tetragon has eBPF performance |
| Supply chain | Cosign (keyless) | 6K | Sigstore ecosystem, OIDC-based, zero key management |
| Vulnerability management | Trivy Operator | 2K | Continuous cluster scanning with CRDs |
| RBAC audit | kubescape | 12K | CIS/NIST benchmarks, RBAC analysis, free tier |
Here's a production security pipeline that layers all five defenses:
# 1. PRE-COMMIT: SAST + secrets detection
# .pre-commit-config.yaml
repos:
- repo: https://github.com/returntocorp/semgrep
hooks:
- id: semgrep
args: ["--config", "p/security-audit", "--error"]
- repo: https://github.com/gitleaks/gitleaks
hooks:
- id: gitleaks
# 2. CI PIPELINE: Image scan + sign (GitHub Actions)
jobs:
security:
steps:
- name: Build
run: buildah bud -t myregistry.com/app:$SHA .
- name: Scan
uses: aquasecurity/trivy-action@master
with:
image-ref: myregistry.com/app:$SHA
severity: CRITICAL,HIGH
exit-code: 1
- name: Sign
uses: sigstore/cosign-installer@main
- run: cosign sign --yes myregistry.com/app:$SHA
- name: IaC Check
uses: bridgecrewio/checkov-action@master
with:
directory: kubernetes/
# 3. ADMISSION: Kyverno image signature verification
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: verify-image-signature
spec:
validationFailureAction: Enforce
webhookTimeoutSeconds: 30
rules:
- name: verify-cosign-signature
match:
any:
- resources:
kinds:
- Pod
verifyImages:
- imageReferences:
- "myregistry.com/*"
attestors:
- entries:
- keys:
publicKeys: |-
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
attestations:
- type: https://scan.example.com/attestation/trivy
conditions:
- all:
- key: "{{components[].vulnerabilities[].severity}}"
operator: NotEquals
value: CRITICAL
# 4. RUNTIME: Falco config snippet
- source: syscall
condition: >
(container.id != host) and
(open_write and fd.name startswith /etc) and
not package_mgmt_apt_processes and
not user_known_write_configs
output: >
Suspicious file write to config directory
(user=%user.name container=%container.name
file=%fd.name)
priority: WARNING
# 5. SECRETS: External Secrets Operator
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: db-credentials
spec:
refreshInterval: 1h
secretStoreRef:
name: vault-backend
kind: ClusterSecretStore
target:
name: db-credentials
data:
- secretKey: password
remoteRef:
key: secret/data/db/prod
property: password
Based on the corpus adoption patterns, most teams add security layers incrementally. Here's a maturity model mapping team size and cluster scale to the minimum viable security stack:
# Minimum viable security stack
trivy image --exit-code 1 --severity CRITICAL myregistry.com/app:latest # Scanning
kubeseal < secret.yaml | kubectl apply -f - # Secrets
kyverno apply clusterpolicy --resource Pod=block-privileged # Policy
Three tools, three layers covered. Cost: ~1 day of engineering setup. This catches 80% of common misconfigurations.
Add Trivy Operator for continuous scanning, SOPS for GitOps-native secrets, and a basic Falco deployment for runtime detection. Add Cosign signing in CI pipelines. This is the stack where most production teams end up.
Add Vault for centralized secrets governance with dynamic database credentials. Add Tetragon alongside Falco for eBPF-based tracing. Deploy Checkov for infrastructure-as-code scanning. Implement network policies via Cilium. Add Kubescape for CIS/NIST compliance audits.
All of Level 3 plus: Rekor transparency logs for supply chain provenance, Kubewarden for complex multi-tenant admission policies, external-secrets operator for hybrid secret store environments, and custom Falco/Tetragon rules tuned to your specific threat model. Continuous compliance reporting pipeline feeding SIEM.
| Maturity Level | Tools (approx.) | Setup Effort | Layers Covered |
|---|---|---|---|
| 1: Foundation | 3 (Trivy, Kyverno, Sealed Secrets) | 1 day | 1, 2, 3 |
| 2: Standard | 7 (+Trivy Operator, SOPS, Falco, Cosign) | 1 week | 1–5 |
| 3: Hardened | 12 (+Vault, Tetragon, Checkov, Cilium, Kubescape) | 1 month | 1–5 + network |
| 4: Enterprise | 18+ (+Rekor, Kubewarden, external-secrets, SIEM) | 3+ months | All + compliance |
For tuning the resource requirements of security sidecars (Falco daemonsets, Trivy Operator) at each maturity level, see VM/Container/Pod Resource Tuning: A Comprehensive Production Guide.
The cross-corpus analysis — comparing 2,080 repos against 2,840 papers — reveals significant research gaps in the most widely deployed tools:
| Tool | Stars | Paper Mentions | Gap |
|---|---|---|---|
| Trivy | 37K | 0 | Dominant scanner, zero academic evaluation |
| Kyverno | 8K | 0 | Growing policy engine, no comparison studies |
| Falco | 9K | 0 | CNCF graduated, unstudied |
| Cosign | 6K | 0 | Supply chain standard, no empirical studies |
| Vault | 36K | 0 | Most adopted secrets tool, no formal evaluation |
| Infisical | 29K | 0 | Fastest-growing vault alternative, no research |
This means production teams are making tooling decisions based entirely on community signals — stars, GitHub activity, blog posts — with no formal evaluation comparing detection rates, false positive rates, performance overhead, or configuration completeness.
The research gap has concrete implications:
No false-positive benchmarks. You can't compare Trivy vs. Grype detection rates with published data. Teams must run their own evaluations using the same image set and comparing outputs — a time-consuming but necessary exercise for regulated industries.
Performance claims are unverified. Falco's claimed overhead of "<5% CPU" and Tetragon's eBPF advantage are widely cited but never formally measured in controlled environments. The one academic paper on eBPF monitoring overhead is from the Xen project (2018), not Kubernetes.
Configuration completeness is unknown. Kyverno's policy library covers 60+ scenarios, but nobody has published an analysis of what percentage of CIS Kubernetes Benchmark controls are actually enforced by the community policies.
Supply chain signing adoption is invisible. Cosign has 6K stars, but we don't know what percentage of production clusters actually verify image signatures at admission. The tools exist; the operational adoption data doesn't.
The absence isn't necessarily a problem for teams building today (community adoption is a real signal), but it means our understanding of these tools' actual effectiveness is limited to anecdotal evidence. If you're in a position to publish comparative data, the community desperately needs it.
For the original cross-corpus analysis, see the GitHub Research Corpus Analysis.