> For the complete documentation index, see [llms.txt](https://ceh-practical.cavementech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ceh-practical.cavementech.com/module-19.-cloud-computing/5.-perform-vulnerability-assessment-on-docker-images.md).

# 5. Perform Vulnerability Assessment on Docker Images

## 1. Vulnerability Assessment on Docker Images using Trivy <a href="#task-1-vulnerability-assessment-on-docker-images-using-trivy" id="task-1-vulnerability-assessment-on-docker-images-using-trivy"></a>

Trivy is a powerful security scanner that detects vulnerabilities and misconfigurations across a wide range of targets, including container images, file systems, Git repositories, virtual machine images, Kubernetes, and AWS. With its comprehensive scanners, Trivy identifies OS package vulnerabilities, sensitive information, IaC issues, and more, providing a robust security solution for your infrastructure.

In this lab we will be scanning two docker images, first the secure one and second the vulnerable one

```
docker pull ubuntu
```

Once the image is pulled we will be performing vulnerability assessment. Execute command **trivy image ubuntu**.

```
trivy image ubuntu
```

<figure><img src="/files/vnlEs2ALbkqAAaB86kbe" alt=""><figcaption></figcaption></figure>

We can observe that we have total **0** vulnerability and it's completely secure.

Now, let us pull a vulnerable image.

```
docker pull nginx:1.19.6
```

Execute command.

```
 trivy image nginx:1.19.6
```

<figure><img src="/files/hezjWV2KFffZUDi55RZk" alt=""><figcaption></figcaption></figure>

We can see that we have total **401** vulnerabilities which is categorized as well along with **CVEs** mentioned.

{% embed url="<https://www.udemy.com/course/ethical-hacker-practical/?referralCode=289CF01CF51246BCAD6C>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ceh-practical.cavementech.com/module-19.-cloud-computing/5.-perform-vulnerability-assessment-on-docker-images.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
