DevSecOps Lifecycle
A pipeline that signs what it builds, and a cluster that checks for itself
Read the thesis (Harokopio University repository, opens in a new tab)
The problem
Most CI/CD pipelines that call themselves secure are a list of scanners bolted to a build. They report on what the pipeline saw, and the cluster takes their word for it. Nothing downstream checks that what runs is what was scanned.
The question I cared about most was narrower: can the cluster check, on its own, that what it runs is what the pipeline built and signed? Not “did the pipeline pass”, but “does the signature verify at admission, checked by something other than the pipeline?”
Answering it properly meant owning the whole path: the scanners, the signing, the deployment mechanism, the admission controller, and the cluster underneath all of it.
Scope
This thesis is the platform, not the application. The application it protects is BoostFlow, a team productivity platform I had previously built with two others for a university DevOps course. It is the target, deliberately chosen because it was already a realistic multi-service app rather than a toy.
The thesis work is everything after the team-submission-final tag, and
every commit after it is mineREADME.mdboostflow-thesisREADME.md, from December 2025 to July 2026.
It spans two repositories on purpose, because GitOps requires the desired state to live somewhere the pipeline can write and the cluster can read:
boostflow-thesis: all pipeline definitions, scanner configuration, OPA policies, and the Ansible that provisions the cluster.boostflow-thesis-config: the GitOps source of truth. ArgoCD watches it. Jenkins writes image digests into it.
The approach
The loop closes in seven steps, and the interesting property is that step 6 does not trust step 4.
- Pre-commit. A Husky hook runs Gitleaks on the staged changes against a custom ruleset, then lint-staged and the type checker, before a commit is allowedpre-commitboostflow-thesis.husky/pre-commit, so secrets are stopped at the developer’s machine rather than discovered in history. A machine without Gitleaks skips that check with a warning, which is one reason the pull-request checks run it again.
- Scan. Nine tools across five categories, split between the pull-request checks on GitHub and the Jenkins pipeline, with differentiated block-versus-warn policies rather than a uniform fail: Semgrep and CodeQL for SAST, Gitleaks and GitGuardian for secrets, npm audit and Trivy for dependencies, Checkov for IaC, and Conftest against hand-written Rego policieskubernetes.regoboostflow-thesispolicies/kubernetes.rego covering Dockerfiles, Kubernetes manifests, and Firebase rules. SonarQube enforces a quality gate.
- Build. A multi-stage Docker build producing a distroless, non-root image, with BuildKit secrets so no credential is baked into a layerDockerfileboostflow-thesisDockerfile.
- Attest. Syft generates two CycloneDX SBOMs, Trivy scans them, and Cosign signs the image by digest, never by tag, using keys pulled from Vault at runtime. The SBOM and SLSA provenance are attached as verified attestationsJenkinsfileboostflow-thesisJenkinsfile:468-681.
- Promote. Jenkins clones the config repository, writes the new digest into the deployment manifest, and pushes. That commit is the deployment request.
- Admit. ArgoCD reconciles the change, and Kyverno independently verifies the Cosign signature at admissionprovision-cluster.ymlboostflow-thesisansible/playbooks/provision-cluster.yml:673-715. This is the part that matters: the cluster does not take the pipeline’s word for it. The policy runs in Audit mode, as the thesis specifies for a test environment: an image pushed by any other route, or signed by any other key, is admitted but recorded as a violation. Switching it to Enforce, so that such an image is refused, is the step the thesis leaves for production.
- Verify. The pipeline then blocks until the digest actually running in the cluster matches the one it built, and only then triggers the DAST pipeline (OWASP ZAP, Nuclei and testssl.sh), which itself refuses to scan unless the deployed digest is the one it was asked aboutJenkinsfile.dastboostflow-thesisJenkinsfile.dast:70-124.
The cluster all of this runs on was not clicked together. It is built by a single Ansible playbookprovision-cluster.ymlboostflow-thesisansible/playbooks/provision-cluster.yml: kubeadm, Calico CNI, and six pinned Helm releases, among them Vault (with its own role), Kyverno and ArgoCD, to which the playbook then hands the cluster. Everything after that deploys from the config repository: Prometheus and Grafana, the Elastic stack, Jaeger, Falco, NeuVector, and a nightly CIS kube-bench CronJob. The platform is reproducible rather than a pet.
Decisions
Signing by digest, not by tag. A tag is a mutable pointer; signing one proves nothing about what later resolves from it. Digest signing is more awkward, because it means threading an immutable reference through five stages and into another repository, but it is the only version of this that is actually sound. This one choice is what makes step 6 meaningful.
Verifying at admission rather than trusting the pipeline. The pipeline could have simply deployed and reported success. Putting Kyverno in the path means the check sits in the cluster, where it also covers deployments the pipeline never made. The pipeline became one client of the policy rather than the policy itself.
Differentiated block-versus-warn. Failing the build on every finding sounds rigorous and produces a pipeline people disable within a week. Findings are triaged by category and severity so that the blocking set stays small enough to be credible, which is what keeps the gate switched on.
Two repositories rather than one. The deployment never comes from the build.
Jenkins writes a digest to a git repository that ArgoCD reconciles, so the
cluster pulls, the deployment history is a git log, and a rollback is a revert.
The machine-authored deploy: commits in the config repository are that audit
trail. Jenkins does hold a kubeconfig, but uses it only to watch the rollout and
to run the CIS benchmark.
Outcome
The loop runs end to end. The config repository holds 78 automated
deployments, the last 54 of them pinned by digest, reaching build #108, and the
live manifest is pinned to
ghcr.io/kdim67/boostflow@sha256:79b8054…app-deployment.yamlboostflow-thesis-configapp-deployment.yaml: a digest, not a tag, which is
the whole argument in one line.
The thesis then attacked its own cluster three ways. Opening a shell in the running application pod fails, because the distroless image has no shell to start. A privileged pod running as root is rejected at admission by NeuVector’s webhook, in line with the namespace’s restricted Pod Security Standard. And an unlisted binary started inside a live pod is killed by NeuVector’s zero-drift profile while Falco raises the alert.
Around it: OpenTelemetry traces into Jaeger, a Grafana dashboard in five sections over six Prometheus scrape jobs, the Elastic stack (Elasticsearch, Logstash, Filebeat, Kibana) for logs, Falco with custom rules at runtime, and a CIS benchmark on a schedule. On the application side, a nonce-based CSP and COOP/COEP headers in a custom proxy layerproxy.tsboostflow-thesissrc/proxy.ts, double-submit CSRF protection, and structured audit logging across 13 event types.
What I would do differently
The admission policy only audits. Kyverno verifies the signature on every
application pod, but with validationFailureAction: Audit and
failurePolicy: Ignore: an unsigned image is recorded rather than refused, and
if Kyverno itself is down the check is skipped. Moving both to their strict
settings is the change that turns the verification loop into a gate, and the one
I would make first.
The test suite is the weak point. Sixty-four Jest tests across five suites
is thin for an application this size, and coverage is
deliberately scoped to a handful of library files. A pipeline this careful about
what it ships should be equally careful about what it proves works. The
Quality Gate - Tests stage deserves a real Playwright suite over authentication
and organisation creation behind it. After the admission policy, that is the
highest-value thing missing.
The AI rate limiter is an in-memory Map. It allows five requests a minute
per IP on the two AI routesrateLimit.tsboostflow-thesissrc/lib/rateLimit.ts, but each replica keeps its own count and the
autoscaler runs two to five of them, so the real limit is anywhere up to
twenty-five. It belongs in Redis, like anything else that has to agree across
replicas.
The cluster is a single node. Everything here (the admission policy, the GitOps loop, the observability stack) is architecturally sound but has never been tested against node failure, and there is a MinIO backup CronJob whose restore path I have never exercised. An untested backup is not a backup.
Nine scanners is a lot of surface to keep green. Each one has its own configuration, its own way of suppressing a finding, and its own upgrade cadence, and keeping the blocking set honest took more of the eight months than building the pipeline did. If I ran this for a team rather than a thesis, I would consolidate before adding anything.