# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
