Docker, Trivy, and KICS: A Practical Defense Against Supply Chain Attacks
A practical guide to using Docker, Trivy, and KICS together to reduce container and IaC risk and build stronger defenses against software supply chain attacks.
If 2026 has made one thing painfully obvious, it is this: the software supply chain is now a primary attack surface, not a side quest. If attackers can poison a trusted image, compromise a CI pipeline, or slip credentials out through a security tool, they do not need to break production directly. They just let our own automation open the door for them.
Teams building with containers need a more disciplined posture now. Not fear. Not vendor bingo. Just a tighter loop around visibility, misconfiguration detection, artifact hygiene, and verification.
That is where Docker, Trivy, and KICS fit together surprisingly well.
Why this matters more now
Recent 2026 incidents around trusted tooling and publishing flows are a brutal reminder that supply chain attacks do not always start with an application vulnerability. Sometimes the attack lands in the layers around the application: CI jobs, registry tags, extensions, tokens, package metadata, or automation credentials.
Docker's recent write-up on Trivy, KICS, and the broader shape of supply chain attacks in 2026 highlighted a pattern many teams are finally being forced to accept: trust is no longer binary. A tool can be legitimate and still become a distribution channel for malicious changes if publisher credentials, build workflows, or release paths are compromised.
That changes the question from "Did I scan my container?" to "Can I trust how this artifact was built, what it contains, and how it got here?"
Docker gives you the packaging layer and the visibility entry point
Containers made software delivery more consistent, but they also gave us a new place to accumulate risk. Base images, application dependencies, embedded packages, copied secrets, and inherited configuration all ride together in the same artifact.
Docker Scout is useful here because it turns an image into an inventory. Docker describes Scout as a software supply chain security solution that analyzes images, compiles an SBOM, and matches components against continuously updated vulnerability data. That matters because you cannot secure what you have not enumerated.
In practice, Docker becomes the operational surface where many teams already build, tag, distribute, and inspect artifacts. That makes it a natural place to enforce better habits:
- use minimal, trusted base images
- keep image tags immutable in release workflows
- generate and review SBOMs
- wire scanning into pull requests and CI
- treat registry content as something to verify, not blindly trust
This is the boring stuff that quietly saves you from exciting incidents.
Trivy covers the artifact, not just the CVE list
A lot of engineers still think of Trivy as "that container vulnerability scanner." That undersells it.
Trivy's documentation positions it as an all-in-one security scanner that can detect vulnerabilities and misconfigurations across repositories, container images, artifacts, and Kubernetes clusters. It also supports secret scanning and SBOM workflows. That broader scope is exactly why it is so useful in modern pipelines.
A practical Trivy pass can tell you several different things at once:
- whether your image includes vulnerable OS or language packages
- whether your repository or image contains exposed secrets
- whether Kubernetes or IaC definitions include risky settings
- whether the artifact can produce or consume SBOM data for downstream verification
One of the more interesting design choices in Trivy is that it prioritizes precision in vulnerability detection. For OS packages, it prefers vendor advisories over generic upstream data to reduce false positives caused by backported fixes. That is not sexy marketing copy, but it is deeply useful when your team is drowning in noise and ignoring scanners out of self-defense.
A simple example in CI might look like this:
docker build -t myapp:ci .
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:ci
trivy fs --scanners misconfig,secret --exit-code 1 .
That alone will not make you supply-chain secure. But it will catch a shocking amount of nonsense before it gets merged, published, or deployed.
KICS is where IaC risk stops hiding in plain sight
A clean container image does not help much if the infrastructure around it is wildly permissive.
KICS, short for Keeping Infrastructure as Code Secure, focuses on finding security vulnerabilities, compliance issues, and infrastructure misconfigurations early in the development cycle. Its documentation shows broad platform support across Terraform, Kubernetes, Docker, Helm, CloudFormation, Ansible, and more. That makes it a strong complement to image-focused tooling.
This is important because many real-world incidents are not just about malicious packages. They are about weak guardrails:
- public storage created by default
- over-permissive IAM policies
- privileged containers
- Kubernetes manifests with dangerous defaults
- Dockerfiles that bake in bad assumptions
- CI definitions that leak too much authority to automation
KICS is good at dragging those issues into daylight before they become runtime headlines.
A simple KICS gate is refreshingly straightforward:
docker run --rm -t -v "$PWD":/path checkmarx/kics:latest scan -p /path
Of course, and this is the deeply 2026 part, you should also be careful about what you pull and trust in the first place. Security tooling now lives inside the same supply chain threat model it is supposed to defend.
The real lesson from 2026: scanning is necessary, but verification is the upgrade
This is the part too many teams skip.
Scanning tells you whether known badness is present. Verification tells you whether the artifact itself deserves trust.
The supply chain conversation is moving beyond visibility alone. Frameworks like SLSA push teams toward stronger provenance, tamper resistance, and artifact integrity across the build lifecycle. CISA has also continued to emphasize secure software development, protective checks, and continuous response practices for suppliers and customers alike.
That means a mature workflow should include more than "run scanner, count CVEs, ship if under threshold." A better approach looks like this:
1. Reduce what enters the build
Start with trusted base images. Keep them small. Prefer reproducible builds where possible. Pin versions intentionally. Avoid random curl-pipe habits that turn Dockerfiles into fan fiction.
2. Generate visibility artifacts
Create SBOMs for what you ship. Docker Scout and Trivy both help here. SBOMs are not magic, but they are the inventory layer you need when the next advisory lands at 2:13 AM and someone asks, "Are we affected?"
3. Scan at multiple layers
Use Trivy for container, repo, secret, and misconfiguration scanning. Use KICS for IaC-specific checks across Terraform, Kubernetes manifests, Helm charts, and Docker definitions. Different tools catch different classes of mistakes. That overlap is healthy.
4. Verify provenance and publishing flow
This is where many teams are still behind. Strengthen CI credentials. Restrict release permissions. Protect tags. Audit GitHub Actions and build runners. Sign and verify artifacts where your tooling supports it. If your pipeline can silently publish a poisoned image after one token leak, your problem is not a missing scanner. It is excessive trust.
5. Enforce policy before deployment
Do not leave results sitting in dashboards like sad museum exhibits. Break builds on critical findings where appropriate. Block deployments for untrusted images, unsigned artifacts, or dangerous IaC patterns. Security without enforcement is just documentation with better branding.
A practical stack that works without becoming unbearable
If I were setting a pragmatic baseline for a team shipping Dockerized workloads today, I would do this:
Build phase
- build images from minimal, maintained base images
- pin dependency and base image versions
- generate SBOMs during build or artifact inspection
Code and config phase
- run Trivy on the repository for secrets and misconfigurations
- run KICS on Terraform, Kubernetes manifests, Helm charts, and Dockerfiles
- review risky CI workflow permissions like code, not boilerplate
Artifact phase
- run Trivy on built images
- inspect image composition with Docker Scout
- avoid mutable release tags where possible
Delivery phase
- verify provenance and signatures when supported
- restrict who and what can publish images
- gate deployment on severity thresholds and policy checks
Operations phase
- rescan continuously as new advisories land
- rotate exposed credentials aggressively
- rebuild images regularly instead of treating containers like frozen relics
This is not perfect security. There is no such thing. But it is a very real reduction in blast radius.
Where teams still get this wrong
The most common mistake is assuming one scanner equals a strategy.
It does not.
Another mistake is using security tools while ignoring the security of the tools, release workflows, and registries themselves. The 2026 incident pattern should kill that assumption for good. Your security stack is part of your supply chain. Treat it that way.
The third mistake is letting alert fatigue win. If everything is critical, nothing is. Tune rules. Understand severity sources. Separate fix-now issues from background churn. Precision matters because ignored scanners are basically decorative.
Final thought
Docker, Trivy, and KICS are not interchangeable. That is exactly why they are useful together.
Docker gives you a practical software delivery boundary. Trivy gives you broad visibility into vulnerabilities, secrets, SBOMs, and misconfigurations. KICS gives you focused pressure on the Infrastructure as Code layer where risky defaults love to hide. Add provenance, policy, and stricter publishing controls on top, and you move from reactive scanning to actual supply chain defense.
That is the shift 2026 is demanding from all of us.
Not more dashboards.
More trust verification. Less blind faith.
If you are already using Docker in your workflow, this is a good time to tighten the loop: inspect what you build, scan what you ship, validate how it was produced, and stop assuming that trusted tools are automatically trustworthy forever.
References
- Trivy, KICS, and the shape of supply chain attacks so far in 2026
- Docker Scout documentation
- Trivy documentation
- Trivy vulnerability scanning documentation
- Trivy secret scanning documentation
- KICS documentation
- SLSA: Supply-chain Levels for Software Artifacts
- CISA: Securing the Software Supply Chain Recommended Practices Guide for Suppliers