Using Trivy to Secure Your UpCloud Workloads: A DevSecOps Guide for Modern Infrastructure
-
About
- Type
- Blog
- Categories
- Cloud InfrastructureData SecurityLong reads
About
Table of contents
Posted on 4 June 2026
Securing Kubernetes environments goes beyond scanning container images. Today, it demands deep architectural visibility, aggressive automation, and continuous runtime monitoring. The scale of the risk is staggering. According to the 2022 Sysdig Cloud-Native Security and Usage Report, 54% of container images hosted on Docker Hub leak sensitive information, including hardcoded secrets and credentials, leading to unauthorized access, data breaches, and identity theft.
For senior engineers and DevSecOps architects, the challenge isn’t just stopping these threats but doing so without slowing development. Teams are shifting left in security by leveraging tools like Trivy to inspect containers, identify threats, and mitigate security risks before they manifest in production.
However, relying on it alone without understanding its limitations on cloud platforms like UpCloud will likely introduce blind spots in your workload. This brings us to a critical question: Can a single, open-source tool like Trivy serve as the foundational security scanner for an entire workload on UpCloud?
In this article, we will explore Trivy’s core features and critically evaluate its ability to secure your UpCloud environment, from initial infrastructure code through to live Kubernetes workloads.
Trivy is an open-source vulnerability scanner for container images, file systems, and application dependencies developed by Aqua Security. It applies a shift-left philosophy, moving security testing and validation processes to the beginning of the software development lifecycle (SDLC) rather than waiting until deployment day.
Think of it as a versatile security lens that can be applied at multiple checkpoints in your delivery pipeline to identify and avoid security risks in your Kubernetes cluster.
While it built its reputation as a container image scanner, Trivy has evolved into a comprehensive multi-target tool. When integrated into a cloud pipeline, its multi-scanning capabilities simultaneously address the following:
In traditional environments, organizations could afford to run quarterly vulnerability assessments against relatively static infrastructure. However, modern cloud infrastructure moves far too quickly for periodic security audits to remain effective.
Containers are rebuilt daily, Kubernetes workloads scale dynamically, Infrastructure-as-Code continuously modifies environments, and application dependencies evolve faster than most teams can track manually. This is structurally dangerous, especially for teams deploying workloads on high-performance cloud environments like UpCloud.
To keep up, organizations need continuous scanning capabilities that can evaluate infrastructure, workloads, and configurations automatically to ensure:
A security tool is only as effective as its integration strategy. One of the most common reasons security programs struggle is not because the tools lack capabilities, but because they are introduced too late in the software delivery process. Vulnerabilities discovered after deployment are inherently more expensive to fix than vulnerabilities caught during development, and vulnerabilities discovered during incidents are the most expensive of all. The challenge for DevSecOps teams is therefore not simply identifying security issues. It is identifying them at the earliest practical point in the delivery lifecycle.
Hence, a production-ready DevSecOps pipeline should utilize a layered defense strategy, deploying Trivy across three primary operational checkpoints:
The ideal time to discover a vulnerability is before the code ever leaves a developer’s local machine. Integrating Trivy into pre-commit hooks enables developers to automatically scan infrastructure-as-code configurations, container definitions, and application dependencies before changes are committed to source control. This creates an early feedback loop that prevents many common issues from progressing further into the pipeline.
For instance, a developer provisioning resources on UpCloud through Terraform may accidentally introduce an overly permissive security rule or expose a service publicly. Detecting that issue locally takes seconds to resolve, but it will take longer after deployment. So a pre-commit config file like this comes in handy.
repos:
- repo: https://github.com/aquasecurity/trivy
rev: v0.50.0 \# Use the latest stable version
hooks:
- id: trivy-config
name: Trivy IaC & Manifest Scanner
args:
- '--severity'
- HIGH
- CRITICAL
- '--exit-code'
- '1'
This integrates Trivy into your Git workflow so you cannot commit insecure infrastructure or Kubernetes manifests without Trivy checking them first.
Not every issue can be caught on a developer’s machine, which is why the continuous integration pipeline serves as the next logical enforcement point. It ensures that workloads entering the cluster have already passed a baseline security review.
So when code is pushed to a remote repository, your CI/CD platform (GitHub Actions, GitLab CI, or Jenkins) serves as the final quality gate before resources are provisioned on UpCloud. By the time an image reaches production, engineers should already understand its vulnerability profile and dependency risks. Your CI script should have strategic exit codes and triage logic like this:
# Snippet for GitHub Actions / GitLab CI step
- name: Run Trivy vulnerability scanner
run: |
trivy image \
--cache-dir .trivycache \
--ignore-unfixed \
--severity HIGH,CRITICAL \
--exit-code 1 \
upcloud-registry.com/finance-app:${{ github.sha }}
Kubernetes environments are dynamic systems. So even if a cluster were perfectly secure on deployment day, there is a likelihood of configuration drift occurring in production. Continuous auditing provides a mechanism for identifying security drift, surfacing misconfigurations, and maintaining awareness of newly disclosed vulnerabilities even after applications have entered production.
The Trivy Operator natively integrates with the Kubernetes control loop. Running directly inside a Kubernetes cluster transforms security scanning into a continuous auditing process. It automatically watches for workload state changes (like a new Pod deployment or a configuration update) and spins up ephemeral, lightweight background workers to scan the resource. The operator translates security findings directly into native Kubernetes Custom Resource Definitions (CRDs). This allows DevSecOps engineers to query the actual security posture of their live production environment using standard Kubernetes tooling like this:
# Audit the security vulnerabilities of all live applications in a specific namespace
kubectl get vulnerabilityreports \-n production
# Audit cluster compliance against CIS Benchmarks or NSA hardening guidelines
kubectl get clusterconfigauditreports
Even with a powerful tool like Trivy, organizations can fall into common traps that reduce the effectiveness of their security program. When deploying automated scanners across your cloud infrastructure, here are some mistakes to watch out for:
Trivy has become one of the most widely adopted security tools in the DevSecOps ecosystem for its user-friendly interface, fast scanning, and broad compatibility. It is ideal for teams looking to embed security into their existing delivery workflows without introducing significant operational overhead. Its capabilities extend beyond deployment pipelines.
For many organizations running workloads on UpCloud, this combination of vulnerability management, infrastructure-as-code scanning, container security, Kubernetes posture assessment, and software supply chain visibility provides a strong security foundation.
Despite its extensive capabilities, relying solely on Trivy as your defense might expose your UpCloud infrastructure to significant security risks. It has two hard architectural limitations that it was simply never designed to solve.
The biggest mistake organizations make when adopting security tooling is expecting a single product to solve every security problem. While Trivy addresses a comprehensive list of security needs, it was intentionally designed as a preventive security tool rather than an all-in-one security platform. Therefore, DevSecOps teams should consider using Trivy as the foundation of a layered security architecture and pair it with the following:
While Trivy ensures that your declarative Terraform manifests define a secure state, you must ensure that your live cloud environment doesn’t change behind your back. Pair Trivy with native UpCloud Audit Logs streamed to a centralized log management tool or SIEM (Security Information and Event Management). This ensures that Trivy flags whether a security group manifest is properly locked down, while your audit logs track whether someone manually altered that firewall rule directly inside the live UpCloud console.
For production workloads running on UpCloud Kubernetes Service (UKS), runtime monitoring should also be considered. By leveraging eBPF technology directly inside the Linux kernel of your worker nodes, you gain real-time visibility into system behavior. While Trivy ensures your base container images are clean before deployment, eBPF monitors the live environment. This ensures instant alerting or blocking of workloads if a shell is suddenly spawned inside a production pod or if an unapproved binary attempts to overwrite a system file.
Together, these layers create a far more resilient security model than any individual tool can provide.
Security in modern cloud-native systems is no longer about finding the right tool but about building a layered, effective defense strategy. Trivy stands out because it consolidates multiple security concerns into a single, developer-friendly workflow. For teams running workloads on UpCloud or operating Kubernetes through UpCloud Kubernetes Service, that comprehensiveness alone is an effective step toward reducing operational security debt.
The decision framework for using Trivy in your cloud workloads depends on whether It provides sufficient coverage to serve as the security foundation on which additional controls can be layered.
Hence, if an organization relies on manual reviews, periodic audits, or fragmented scanning tools, Trivy represents a significant improvement and will likely address most preventive security needs. On the contrary, if an organization operates regulated workloads, manages sensitive customer data, or runs large-scale production systems, Trivy should be viewed as one layer within a broader security architecture.