<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>DevSecOps on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/devsecops/</link>
        <description>Recent content in DevSecOps on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Sat, 06 Jun 2026 22:26:00 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/devsecops/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>How to use Trivy? Container, Kubernetes and repository security scanning tools</title>
        <link>https://knightli.com/en/2026/06/06/trivy-container-kubernetes-security-scanner/</link>
        <pubDate>Sat, 06 Jun 2026 22:26:00 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/06/06/trivy-container-kubernetes-security-scanner/</guid>
        <description>&lt;p&gt;&lt;code&gt;aquasecurity/trivy&lt;/code&gt; is a very commonly used open source security scanning tool. It can scan container images, Kubernetes, code repositories, cloud configurations, IaC, Secrets, SBOMs, vulnerabilities and misconfigurations.&lt;/p&gt;
&lt;p&gt;If you are doing Docker, Kubernetes or CI/CD, Trivy is basically a tool that you will encounter sooner or later.&lt;/p&gt;
&lt;h2 id=&#34;what-can-it-scan&#34;&gt;What can it scan?
&lt;/h2&gt;&lt;p&gt;Trivy covers a wide range of areas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Container image vulnerability;&lt;/li&gt;
&lt;li&gt;File system and code repository;&lt;/li&gt;
&lt;li&gt;Kubernetes resources;&lt;/li&gt;
&lt;li&gt;IaC such as Terraform, Kubernetes YAML;&lt;/li&gt;
&lt;li&gt;Secret leaked;&lt;/li&gt;
&lt;li&gt;License risk;&lt;/li&gt;
&lt;li&gt;SBOM generation and scanning;&lt;/li&gt;
&lt;li&gt;Cloud resource configuration issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Its value lies in unifying multiple types of security checks into one tool, rather than installing a scanner for each type of risk.&lt;/p&gt;
&lt;h2 id=&#34;where-to-put-it&#34;&gt;Where to put it?
&lt;/h2&gt;&lt;p&gt;Common access points:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Scan images during local development;&lt;/li&gt;
&lt;li&gt;Block high-risk vulnerabilities in CI;&lt;/li&gt;
&lt;li&gt;Regular scanning of mirror warehouse;&lt;/li&gt;
&lt;li&gt;Check YAML before Kubernetes deployment;&lt;/li&gt;
&lt;li&gt;Generate SBOM for audit or supply chain security use;&lt;/li&gt;
&lt;li&gt;Scan Secrets in the code repository regularly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The worst thing about a security scan is that it only runs once. A better approach is to put it into the pipeline, continue to scan, and continue to repair.&lt;/p&gt;
&lt;h2 id=&#34;what-should-you-pay-attention-to-when-using-it&#34;&gt;What should you pay attention to when using it?
&lt;/h2&gt;&lt;p&gt;Trivy will tell you the risks, but will not make risk decisions for you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Whether the vulnerability can be exploited depends on the operating environment;&lt;/li&gt;
&lt;li&gt;The basic image version must be upgraded regularly;&lt;/li&gt;
&lt;li&gt;Blocking strategies can be set for high-risk vulnerabilities;&lt;/li&gt;
&lt;li&gt;Low-risk and false alarms should be managed by exception;&lt;/li&gt;
&lt;li&gt;The secret must be rotated immediately after Secret is hit;&lt;/li&gt;
&lt;li&gt;SBOM is not a compliance decoration and must be able to trace the source of dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Don’t treat scan reports as KPIs. What’s really valuable is repairing closed loops.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;Trivy is a very practical knife in DevSecOps. It is not complicated, but has wide coverage, and is suitable for gradual access from personal projects to enterprise assembly lines.&lt;/p&gt;
&lt;p&gt;If you are deploying containers or Kubernetes services, you should at least include Trivy in your build and release process.&lt;/p&gt;
&lt;h2 id=&#34;reference-sources&#34;&gt;Reference sources
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://github.com/aquasecurity/trivy&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;aquasecurity/trivy - GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
