All-In-One Open Source Security Scanner | Docker Image Analysis with Trivy

Akamai Developer
17 Mar 202320:39

Summary

TLDRThis video from the Blue Team Training series explores Docker image analysis with Trivy, emphasizing the importance of vulnerability scanning for container security. It introduces Trivy, a tool for scanning images, file systems, and Git repositories for vulnerabilities and misconfigurations. The tutorial demonstrates how to use Trivy to identify and address security issues in Docker images, showcasing its capabilities through practical examples and emphasizing the significance of incorporating vulnerability scanning into Docker workflows.

Takeaways

  • πŸ” Vulnerability scanning for Docker images is crucial for identifying security risks in packages used in Docker images.
  • πŸ› οΈ Trivi is a comprehensive tool for scanning Docker images, file systems, and Git repositories for vulnerabilities and configuration issues.
  • πŸ“‹ The process involves understanding the importance of vulnerability scanning, an introduction to Trivi, and a practical demonstration of scanning Docker images with Trivi.
  • 🐳 Docker containers are created from Docker images, which are defined by Dockerfiles that specify the packages and configurations used.
  • ⚠️ Vulnerabilities in the packages used in Docker images can lead to potential exploitation by attackers.
  • πŸ”§ It is important to scan Docker images for vulnerabilities before deploying them to ensure the security of the containerized applications.
  • πŸ”’ Trivi can also scan Infrastructure as Code (IaC) files like Terraform, Dockerfiles, and Kubernetes configurations for potential issues.
  • πŸ’Ύ A practical demonstration shows how to set up and use Trivi on an Ubuntu server with Docker installed to scan for vulnerabilities.
  • πŸ“Š Trivi outputs detailed information on detected vulnerabilities, including severity, affected packages, and fixed versions.
  • πŸ›‘οΈ Regularly scanning and updating Docker images based on Trivi's findings helps maintain secure container environments.

Q & A

  • What is the main focus of the video?

    -The main focus of the video is Docker image analysis with Trivy, specifically scanning Docker images for vulnerabilities and misconfigurations.

  • Why is vulnerability scanning for Docker images important?

    -Vulnerability scanning for Docker images is important because it helps identify security vulnerabilities in the packages used within a Docker image, preventing potential exploitation by attackers and ensuring container security.

  • What are the prerequisites for using Trivy as demonstrated in the video?

    -The prerequisites for using Trivy include basic familiarity with Docker and Docker CLI commands, as well as familiarity with Linux and various command line utilities.

  • What is Trivy and what can it be used for?

    -Trivy is a tool for scanning vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues. It can be used to scan infrastructure as code (IaC) files such as Terraform, Dockerfile, and Kubernetes to detect potential configuration issues.

  • How does Trivy help with Docker security?

    -Trivy helps with Docker security by scanning Docker images for vulnerabilities and misconfigurations, allowing users to identify and fix issues before deploying or running the images.

  • What is the significance of scanning Docker images before deployment?

    -Scanning Docker images before deployment is significant because it allows detection of vulnerabilities that could be exploited by attackers, ensuring that the images are as secure as possible before they are used in production environments.

  • What does the video demonstrate in terms of practical application of Trivy?

    -The video demonstrates a practical application of Trivy by showing how to scan Docker images for vulnerabilities and misconfigurations, including pulling the Trivy Docker image, running scans on specific images, and interpreting the results.

  • What is the Shell Shock vulnerability mentioned in the video?

    -The Shell Shock vulnerability is a family of security bugs in the Unix Bash shell, which allows attackers to remotely execute arbitrary commands. It was first disclosed in September 2014 and is considered critical due to its potential for remote exploitation.

  • How does Trivy categorize vulnerabilities in its scan results?

    -Trivy categorizes vulnerabilities in its scan results based on their severity, which can include low, medium, high, and critical levels.

  • What is the next topic covered in the series after Docker image analysis with Trivy?

    -The next topic covered in the series is incident response with FireEye Redline, a tool developed by FireEye for incident response and digital forensics.

Outlines

00:00

πŸ›‘οΈ Docker Image Security with Trivi

This paragraph introduces a training series on Docker image analysis using Trivi, a vulnerability scanner. It emphasizes the importance of scanning Docker images for security vulnerabilities before deployment. The video will cover the basics of why vulnerability scanning is essential, provide an introduction to Trivi, and demonstrate how to scan images for vulnerabilities and misconfigurations. The prerequisites for the tutorial include familiarity with Docker, its CLI commands, and Linux command line utilities. The paragraph also mentions a Docker security series for beginners and highlights the need for security measures in Docker images to prevent potential exploitation by attackers.

05:02

πŸ” Practical Demonstration of Trivi for Docker Image Scanning

The speaker begins a practical demonstration of using Trivi to scan Docker images for vulnerabilities and misconfigurations. They set up a server on Linode with Docker pre-installed and proceed to explain the process of scanning. The paragraph details the installation of the Trivi binary and how to use the Trivi Docker image to scan for vulnerabilities in OS packages. The speaker also discusses the features of Trivi, including its ability to scan for misconfigurations in IAC files such as Dockerfiles and Kubernetes configurations. The demonstration includes an attempt to scan a specific Docker image for vulnerabilities, showcasing the process and the output of the scan.

10:02

πŸ“ Scanning Docker Images with Trivi: A Step-by-Step Guide

This paragraph continues the practical demonstration by explaining the steps to scan Docker images using Trivi. The speaker clarifies the need to pull the Docker image locally before scanning and demonstrates the command to run Trivi for scanning an image. They encounter a minor issue with the command syntax but quickly resolve it and successfully scan the Ubuntu 18.04 image, displaying the vulnerabilities found, sorted by severity. The output includes details such as the affected package, vulnerability ID, severity, installed version, fixed version, and the title of the vulnerability.

15:04

🚨 Identifying High-Severity Vulnerabilities in Docker Images

The speaker continues to demonstrate the use of Trivi by scanning another Docker image, this time focusing on high-severity vulnerabilities. They show how to identify and list vulnerabilities, including a critical Shell Shock vulnerability in the bash package. The paragraph highlights the risks associated with running vulnerable Docker containers and the importance of addressing these vulnerabilities to secure the container infrastructure. The demonstration includes scanning multiple images and discussing the implications of the findings.

20:06

πŸ”š Conclusion and Preview of Incident Response with FireEye Redline

The final paragraph concludes the practical demonstration on Docker image scanning with Trivi and previews the next topic in the series, which is incident response with FireEye Redline. The speaker briefly describes FireEye Redline as a top solution for incident response and digital forensics, indicating that it will be the focus of the upcoming video. The paragraph ends with a thank you note and a musical outro, signaling the end of the current video tutorial.

Mindmap

Keywords

πŸ’‘Docker Image

A Docker image is a read-only template with instructions for creating a Docker container. It contains the necessary software, libraries, settings, and environment to run an application. In the context of the video, Docker images are the primary subject for vulnerability scanning to ensure security before deployment. The script mentions Docker images as being composed of a Dockerfile, which is a script with commands for configuring the image.

πŸ’‘Vulnerability Scanning

Vulnerability scanning is the process of identifying, quantifying, and prioritizing vulnerabilities in software or systems. In the video, it is emphasized as a critical step in Docker security to detect potential security flaws in the packages used within a Docker image. The script explains that scanning helps prevent attackers from exploiting these vulnerabilities to gain access to Docker containers.

πŸ’‘Trivi

Trivi is a tool introduced in the video for scanning container images, file systems, and Git repositories for vulnerabilities and misconfigurations. It is used to ensure that Docker images are secure before they are deployed. The script demonstrates how Trivi can be utilized to scan Docker images and provides insights into its capabilities and usage.

πŸ’‘Dockerfile

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. In the video, it is mentioned as the foundational component of a Docker image, specifying the base operating system and additional configurations that the image should include.

πŸ’‘Misconfigurations

Misconfigurations refer to incorrect or suboptimal settings in software or systems that can lead to security risks or inefficiencies. The video discusses the importance of scanning for misconfigurations in Docker images and files like Dockerfiles to prevent potential security breaches.

πŸ’‘Infrastructure as Code (IaC)

Infrastructure as Code is a methodology where infrastructure is provisioned and managed using code files, rather than manually through a user interface. In the script, Trivi's ability to scan IaC files such as Terraform and Dockerfiles for misconfigurations is highlighted, emphasizing its role in detecting issues that could lead to security vulnerabilities.

πŸ’‘Docker CLI Commands

Docker CLI commands are the command-line interface commands used to interact with Docker and manage containers and images. The video assumes that the viewer has a basic familiarity with these commands, as they are essential for interacting with Docker containers and images, especially when performing vulnerability scans with Trivi.

πŸ’‘CVE

CVE stands for Common Vulnerabilities and Exposures, which is a system for identifying and cataloging known cyber security vulnerabilities. In the video, CVE codes are used to identify specific vulnerabilities found during the scanning process with Trivi, allowing users to understand and address the severity and specifics of the vulnerabilities.

πŸ’‘Shell Shock

Shell Shock is a family of security vulnerabilities found in the Unix Bash shell, which allows attackers to execute arbitrary commands. The video uses an example of a Docker image vulnerable to Shell Shock to illustrate the importance of scanning and the potential risks associated with unaddressed vulnerabilities.

πŸ’‘Privileged Escalation

Privileged escalation refers to the act of exploiting a software vulnerability to gain higher levels of access or permissions in a system than those normally granted by the system. The script mentions a high-severity vulnerability related to privileged escalation, emphasizing the critical nature of such vulnerabilities and the need for scanning to prevent unauthorized access.

Highlights

Introduction to Docker image analysis with Trivy, emphasizing the importance of scanning for vulnerabilities.

Explanation of why vulnerability scanning for Docker images is crucial for security.

Overview of Trivy as a tool for scanning Docker images, file systems, and Git repositories.

Prerequisites for using Trivy, including familiarity with Docker, Docker CLI, and Linux command line utilities.

The process of Docker vulnerability scanning to identify security vulnerabilities in packages used within Docker images.

How Docker images are created from Dockerfiles and the significance of scanning for vulnerabilities in base images.

The importance of scanning Docker images before deployment to detect and fix vulnerabilities.

Trivy's capability to scan for misconfigurations and vulnerabilities in infrastructure as code (IaC) files.

Demonstration of how to use Trivy to scan Docker images for vulnerabilities and misconfigurations.

Setting up a lab environment with an Ubuntu 18.04 server and Docker for practical Trivy usage.

Instructions on installing and using the Trivy Docker image for scanning.

Practical example of scanning a Docker image and interpreting the results, including sorting by severity.

Identification of medium and high severity vulnerabilities in scanned Docker images.

Explanation of how to address vulnerabilities found in Docker images by patching or rebuilding images.

Discussion on the critical nature of container security and its impact on overall infrastructure security.

Use of Trivy to scan for Shell Shock vulnerability in a Docker image, illustrating the tool's practical application.

Conclusion of the practical demonstration andι’„ε‘Š of the next video on incident response with FireEye Redline.

Transcripts

play00:00

hello everyone welcome back to the blue

play00:03

team training series brought to you by

play00:05

hackersploit and linode in this video

play00:08

we'll be taking a look at Docker image

play00:10

analysis with trivi more specifically

play00:12

the process of scanning Docker images

play00:14

for vulnerabilities with trivi

play00:16

[Music]

play00:26

so in regards to what we'll be covering

play00:28

we'll firstly get an understanding as to

play00:31

why vulnerability scanning for Docker

play00:33

images is so important we'll also get an

play00:36

introduction to trivi and finally during

play00:38

the Practical demonstration we'll take a

play00:40

look at how to scan Docker images for

play00:42

vulnerabilities and misconfigurations

play00:44

with trivi in relation or in regards to

play00:48

the actual prerequisites you need to

play00:50

have a basic familiarity with Docker and

play00:53

the docker CLI commands because we're

play00:55

going to be interacting with Docker

play00:56

containers and of course you need to

play00:58

have familiarity with Linux and various

play01:00

command line utilities because we're

play01:02

going to be you know utilizing Docker on

play01:04

Linux if you're new to Docker and Docker

play01:07

security then please do take a look at

play01:10

the actual Docker security series that

play01:13

we actually uh you know did with linode

play01:16

the link to that will be added as a

play01:18

resource to this video where we covered

play01:20

the process of securing Docker from the

play01:22

ground up with that being said let's get

play01:25

an understanding as to why vulnerability

play01:27

scanning for Doc images is very

play01:28

important all right so let's understand

play01:31

the process first so Docker

play01:33

vulnerability scanning is the process of

play01:35

identifying security vulnerabilities for

play01:37

the packages that are utilized in a

play01:39

Docker image so whenever you're creating

play01:42

a Docker container the docker container

play01:44

is Created from a Docker image right and

play01:46

the docker image is essentially uh you

play01:49

know made up of a Docker file the docker

play01:52

file essentially is a is a file that

play01:55

contains commands and allows you to

play01:56

configure you know what your image what

play02:00

packages you want your image to run on

play02:02

so you know you could specify you want

play02:03

your you you want your image to utilize

play02:06

Ubuntu 18.04 as a base and then you can

play02:09

you can essentially add in additional

play02:11

configurations based on what you want

play02:14

your image to do when it is run as a

play02:17

container so

play02:19

we're essentially looking for uh you

play02:22

know security vulnerabilities and

play02:23

misconfigurations uh you know in the

play02:26

packages utilized within the docker

play02:28

image because uh you know if I utilize

play02:30

Ubuntu 18.04 as a base the packages

play02:33

included with that particular uh image

play02:36

that base image might be vulnerable to

play02:38

vulnerabilities and if they are then an

play02:41

attacker could potentially exploit that

play02:43

package and gain access to that Docker

play02:45

container and you know they could then

play02:47

uh you know perform pretty much whatever

play02:49

or perform or do pretty much whatever

play02:51

they wanted to do within that Docker

play02:54

container so this process will allow you

play02:56

to detect vulnerabilities in images

play02:58

before deploying or running them so uh

play03:01

you know with the Advent or with the

play03:03

rise of of Docker in terms of popularity

play03:06

and deployment uh Docker and containers

play03:09

uh and container security needs to be

play03:11

taken much more seriously and as I said

play03:14

if you are an organization and you're

play03:17

building your own Docker images then

play03:18

this is some that you should include

play03:20

within that workflow so whenever you've

play03:23

built a Docker image always perform a

play03:25

vulnerability scan on it so uh you know

play03:29

once you've identified these

play03:30

vulnerabilities the vulnerabilities can

play03:32

then be patched or fixed in order to

play03:34

make the image as secure as possible

play03:36

this is a very important aspect of

play03:38

Docker security primarily because all

play03:40

the security measures we have

play03:42

implemented on the host system uh you

play03:45

know can be usurped by a single

play03:46

vulnerability in one of the packages so

play03:49

again just because you've secured the

play03:51

operating system where you have Docker

play03:53

running on uh you know you know that

play03:56

isn't the end of security with relation

play03:58

to Docker uh and of course this is

play04:00

primarily going to be focused on you

play04:02

know image and container security uh

play04:05

with that being said

play04:07

um let's get an introduction to trivi

play04:09

trivia is the tool we're going to be

play04:10

using to perform these scans so trivi is

play04:13

a simple and comprehensive scanner for

play04:15

vulnerabilities in container images file

play04:18

systems and git repositories as well as

play04:21

for configuration issues so it's not

play04:23

just limited to uh you know scanning

play04:25

container images it can also be used to

play04:28

scan for misconfigurations and

play04:29

vulnerabilities in file systems get

play04:32

repos Etc so it's a very very useful

play04:34

tool uh in that sense trivia can be used

play04:38

to scan infrastructure as code or IAC

play04:40

files such as terraform dockerfile and

play04:42

kubernetes to detect potential

play04:45

configuration issues that expose your

play04:47

deployments to the risk of attack we can

play04:49

util lies trivia to scan Docker files

play04:51

for misconfigurations and

play04:52

vulnerabilities that could potentially

play04:54

lead to exploitation or data exposure so

play04:57

the objective here is you know to

play04:59

essentially scan a particular Docker

play05:01

file or in this case would be scanning

play05:03

the images themselves with trivi to

play05:06

identify misconfigurations that can then

play05:08

be fixed within the original Docker file

play05:10

from which that image was built from

play05:13

so let's get started with the Practical

play05:15

demonstration as for the lab environment

play05:17

I've set up a server on linode it's a

play05:20

simple Ubuntu 18.04 server with Docker

play05:23

already installed and that's where we're

play05:25

going to be running all of these checks

play05:26

so let me just switch over to my Ubuntu

play05:28

VM

play05:30

all right so I'm back on my Ubuntu VM

play05:32

and you can see I've created a Ubuntu

play05:35

Server called Docker host and it doesn't

play05:37

really have anything running on it the

play05:39

only thing I've done is installed Docker

play05:41

and you know essentially enable the

play05:43

service and start it just to make sure

play05:45

that Docker is running as I said we're

play05:47

going to be utilizing trivi so this is

play05:49

the trivia GitHub repository all the

play05:51

links are mentioned within this video

play05:53

going to be added as a resource uh you

play05:56

know for this video so don't worry about

play05:57

that trivi is created by a company

play06:00

called aquasec as you can see the

play06:02

description is fairly simple here

play06:04

scanner for vulnerabilities and

play06:06

container images file systems and git

play06:08

repositories as well as for

play06:11

configuration issues and then it

play06:13

provides you with a really really cool

play06:14

ASCII video here or just a simple screen

play06:18

capture as to how you can scan for

play06:20

vulnerabilities in container images here

play06:22

as well as uh you know scanning for

play06:25

misconfigurations in IAC files and of

play06:28

course it gives you a quick start in

play06:30

regard out to you know how you can

play06:32

utilize it so

play06:33

in the context of Docker you can see

play06:37

that right over here as it says here

play06:41

scan directory for Miss configurations

play06:43

uh simply specify directory containing

play06:45

the ISE files such as terraform and

play06:48

Docker files so in this case you need

play06:50

the trivi binary and you can easily

play06:53

install uh you know the trivi binary

play06:56

however in this case because we're

play06:59

primarily focused on Docker images if we

play07:01

take a look at the trivia documentation

play07:03

you can see that you know we can scan

play07:07

Docker images using the following syntax

play07:10

and if we click on vulnerability

play07:11

detection you can see that we all we can

play07:15

essentially check for vulnerabilities in

play07:17

OS packages so in order to do this we're

play07:20

going to be utilizing the trivi docker

play07:23

image here so let me just refresh that

play07:25

for some reason the images aren't being

play07:28

displayed which is uh I think that's

play07:31

fine but let me just disable my ad

play07:32

blocker here and let's refresh the page

play07:35

just to see or just to make sure that

play07:37

that is the case

play07:38

all right so we'll be utilizing the uh

play07:41

the actual trivi uh image here so there

play07:45

we are you can see a simple and

play07:46

comprehensive vulnerability scanner for

play07:48

containers

play07:49

so

play07:51

what we're going to do here is we take a

play07:53

look at the documentation you can see

play07:55

that the features it provides us with

play07:58

here so detect comprehensive

play07:59

vulnerabilities in operating system

play08:00

packages and you know we can easily go

play08:05

through this right so you know you can

play08:07

take a look at the installation

play08:08

instructions here for trivi so uh you

play08:11

know we can essentially add the actual

play08:14

Source here and we can then install

play08:17

preview but as I said we're going to be

play08:19

using the docker image so I will just

play08:21

pull this Docker image on my Docker host

play08:24

here so I've already logged into the

play08:25

server so I'll say Docker pull and it's

play08:27

going to pull the latest image there

play08:30

and we'll give that a couple of seconds

play08:34

once that is done we can actually get

play08:36

started with the scan so now uh the

play08:39

objective would be to identify an image

play08:41

that you'd like to scan for

play08:43

misconfigurations it could be a local

play08:45

image that you created yourself

play08:47

or you can essentially perform a scan on

play08:50

some of the other ones here so for

play08:51

example uh we'll be using this

play08:54

vulnerable uh image in a couple of

play08:55

seconds but you know we can scan for

play08:57

vulnerabilities in any other images so

play09:00

you know I can search for let's see

play09:03

um we can search for maybe one of my own

play09:06

so

play09:06

let's see if we can find some of my own

play09:09

images here so for example the bug

play09:11

Bounty toolkit I think that will

play09:13

actually be too too large to perform

play09:17

this uh you know

play09:18

but we can search for the ones I created

play09:21

I know I did create a log4j1

play09:25

um

play09:26

we can actually scan this one here so

play09:29

uh for every Docker image there's going

play09:32

to be a Docker file right so you know we

play09:34

can click on the latest release there

play09:37

and you can see that this is essentially

play09:38

the docker file there so

play09:41

um

play09:42

what we can do is if we wanted to scan

play09:45

this particular image I can essentially

play09:47

just copy the name here so you know I

play09:50

can just say hack exploit bewap Docker

play09:52

that's just a simple image that allows

play09:55

you to spin up a an instance of the

play09:57

extremely buggy web application so in

play10:01

order to do this we're going to say

play10:02

Docker run and we're going to remove

play10:04

this when we're done and we are going to

play10:07

say

play10:08

um you know

play10:10

we want to run trivia

play10:12

so trivi and that is going to be

play10:17

um we are going to specify the cache

play10:19

directory here which we need to when

play10:21

running trivia so root and we can just

play10:24

say cache there we are and we then

play10:27

specify

play10:29

uh the actual uh the actual 3v image

play10:32

that we pulled so aquasec

play10:35

trivia

play10:37

and then specify the actual image you

play10:39

would like to scan so in this case hack

play10:41

exploit by Docker hit enter

play10:43

uh in this case it doesn't look like uh

play10:47

that is going to allow us to do that so

play10:51

uh let me see if I we need to change

play10:53

anything here can we actually scan

play10:55

Ubuntu

play10:56

um so I'm going to say Ubuntu let's try

play10:59

18.04 here

play11:01

uh do we need to get that so pull uh

play11:05

Docker pull

play11:07

uh not soccer we want to type in Docker

play11:09

pull

play11:11

Ubuntu 18.04 does it need to be local

play11:14

first I think it does need to be local

play11:16

so yes you actually need to pull the

play11:18

image and have it locally so I'm going

play11:20

to still say hack exploit

play11:23

um b-wap docker

play11:30

that's going to pull that as well this

play11:32

is quite large even

play11:34

better so that's done and it's then

play11:37

going to extract so I'm just going to

play11:40

wait for this to complete here

play11:43

and once that is done

play11:46

we can say Docker images

play11:48

and we have the images here so if we run

play11:50

that again against the Ubuntu image

play11:54

which for some reason it's not letting

play11:56

me do because we are specifying the

play11:58

arguments correctly

play12:01

um so what we can do is try and run the

play12:03

actual docker the actual trivia Docker

play12:06

image here and uh yeah so that works and

play12:09

we need to specify the options so we can

play12:12

say in this case we're scanning an image

play12:15

so we can say image and then specify

play12:18

Ubuntu

play12:21

18.04 and let's see if that works that

play12:24

indeed does work so it's going to

play12:25

download the database here uh once that

play12:28

is done it should scan that image for

play12:31

vulnerabilities and indeed we can see

play12:33

that we have all the vulnerabilities

play12:35

listed here as well as their respective

play12:38

cve code so because this image is so old

play12:42

you can see that they're sorted the

play12:44

vulnerabilities are sorted based on

play12:46

their severity so we have low medium and

play12:48

high as well as critical and it looks

play12:51

like a majority of them are you know

play12:53

have a low severity there and then of

play12:56

course we have a few medium severity

play12:58

vulnerabilities so the the table

play13:00

displayed to you here will essentially

play13:02

will be sorted into various columns so

play13:05

you have the library or the package

play13:06

that's affected and then the

play13:08

vulnerability ID the severity the

play13:11

installed version and the version where

play13:13

this was fixed so that you can update

play13:15

that and then of course the title of the

play13:17

vulnerability so uh you can see that

play13:20

let's see if we can find any of the

play13:22

medium of severity vulnerabilities here

play13:25

it looks like that's a privileged

play13:27

escalation vulnerability medium here

play13:30

again same thing and the other medium

play13:33

one here so again this gives you an idea

play13:35

as to what needs to be patched in this

play13:37

case this still looks relatively safer

play13:40

than than other Docker images so we can

play13:44

actually run this against some of my

play13:46

other images so I'm going to say Docker

play13:48

images and the screen might be a little

play13:50

bit small for you but that's because you

play13:53

know I want the table displayed fully so

play13:56

I'll say image and in this case we can

play13:59

say hackersploit and you know B web

play14:02

docker

play14:03

uh B web docker

play14:06

hit enter let's see it's going to

play14:09

download the database there

play14:12

and that's the vulnerability database so

play14:14

we'll give this a couple of seconds

play14:17

and yup as expected this one is going to

play14:20

have quite a lot of vulnerabilities uh

play14:23

and you can see that we can actually uh

play14:27

you know

play14:28

we have scrolling not set up correctly

play14:30

here so I'm just going to head over into

play14:32

profiles and into scrolling I'm going to

play14:35

set that to infinite scroll back and

play14:37

we're just going to run this again so

play14:39

I'll clear out my terminal there we are

play14:41

just so that we can see all the output

play14:43

for that particular image there so

play14:48

I'm just going to let this complete here

play14:51

and there we go so we have a high

play14:53

severity vulnerability now we're talking

play14:55

so you can see the sudo package in this

play14:57

Docker image uh you can see right over

play15:00

here

play15:01

has the relative cve code and the

play15:04

severity is high uh now if I would have

play15:06

just run this Docker image without

play15:08

knowing this then you know I would not

play15:10

uh you know I would essentially be

play15:12

running a vulnerable Docker container

play15:15

that you know in in the case of this

play15:17

vulnerability this is a privileged

play15:18

escalation vulnerability so it's really

play15:21

not that important but you know you get

play15:23

the idea these are vulnerabilities that

play15:25

could uh negatively impact your

play15:28

container infrastructure so

play15:30

let's take a look at some of the other

play15:32

ones here so these are all low low

play15:35

severity vulnerabilities we have a

play15:37

couple of medium ones here

play15:39

and as you can see it performs a check

play15:41

on all the packages or libraries

play15:43

regardless of whether they're you know

play15:45

Linux utilities or libraries uh but also

play15:49

you know if it is running PHP or the

play15:52

docker container is utilizing Frameworks

play15:54

uh

play15:56

web Frameworks so you can see there's

play15:58

quite a few vulnerabilities for this

play16:01

particular image and in this case you

play16:04

can see we have a few buff overflows

play16:06

there

play16:07

let's see if we can find a couple more

play16:11

so we have another high one here that's

play16:14

really not a remote code execution of

play16:17

vulnerability there

play16:20

and we have a couple of other ones here

play16:22

so you get the idea now the to show you

play16:25

that uh you know in the case of uh to

play16:28

actually give you a better example we're

play16:30

going to be utilizing a Docker image

play16:32

here that is used to essentially set up

play16:35

a vulnerable web application or a web

play16:39

application that is vulnerable to Shell

play16:40

Shock so uh if you're not familiar with

play16:43

shell shock Shell Shock is a family of

play16:46

security bugs in the widely used Unix

play16:48

bash shell the first of which was

play16:50

disclosed on the 24th of September 2014

play16:53

and it essentially allows attackers to

play16:55

remotely execute arbitrary commands so

play16:57

this will be a perfect example to show

play16:59

you how this works so uh you know I'll

play17:02

just get rid of that there and we'll say

play17:03

Docker pull and we're going to pull that

play17:05

image there

play17:07

so there we are

play17:12

and we can now uh you know specify that

play17:15

we want to run that particular so I'm

play17:17

going to say we're going to run the

play17:18

trivia

play17:20

image there's a container and that is we

play17:25

are essentially just going to copy the

play17:26

name there

play17:28

and we'll hit enter and let's see what

play17:32

vulnerabilities affect this particular

play17:34

Docker image

play17:36

so there we are we have quite a few and

play17:38

let's see if we can identify the shell

play17:39

shock vulnerability

play17:41

so I'm just going to go through all of

play17:43

these here and I'll just go to the top

play17:46

here and we should be able to see the

play17:48

total number of vulnerabilities uh that

play17:50

affects this particular Docker image so

play17:53

if we take a look at bash here we can

play17:55

see that this is the shell shock

play17:57

vulnerability so this is set to critical

play17:59

as you can obviously tell and it tells

play18:01

you what version this was fixed in so

play18:04

you can actually install that version so

play18:06

a specially crafted environment

play18:08

variables can be used to inject shell

play18:09

commands and you know this is critical

play18:11

because uh this attack or this

play18:14

vulnerability can be exploited remotely

play18:16

so if this a Docker container and the

play18:18

web application hosted within it was

play18:20

hosted uh or you know was was actually

play18:23

being hosted to serve customers and you

play18:27

know an attacker could potentially you

play18:29

know identify the vulnerability and

play18:31

exploit it and consequently gain access

play18:33

to your Docker container so the most

play18:37

important thing to note here is that

play18:38

Docker containers are part of the

play18:41

infrastructure and as a result their

play18:42

security or the security of your Docker

play18:45

or containers needs to be taken into

play18:47

consideration uh you know directly or

play18:51

from the actual uh point where you're

play18:53

actually creating the images yourself

play18:55

now in this case I've I've performed

play18:57

scans on images that I are not mine

play19:00

apart from the actual uh B web apart

play19:04

from the B web image and in that case I

play19:06

would be able to go through that report

play19:08

or you know take a look at all the

play19:10

vulnerabilities uh you know within that

play19:12

particular Docker image and I'll be able

play19:14

to fix those or make amendments to the

play19:17

original dock of file I can then build

play19:19

the new Docker image and run a scan on

play19:21

it again to see whether those patches

play19:23

have been implemented and the actual

play19:26

process of the cycle repeats itself so

play19:29

go ahead you can take a look at you know

play19:32

the actual trivia documentation if

play19:34

you're interested in using it to scan

play19:36

for misconfigurations in git

play19:38

repositories as well as Docker files

play19:41

themselves

play19:42

uh which uh you know can also be very

play19:44

very useful as I said all the links

play19:46

utilized in this video will also be

play19:48

provided as an additional resource uh

play19:51

with that said that is going to conclude

play19:53

the

play19:54

practical demonstration side of this

play19:57

video

play19:58

so in the next video and the final video

play20:01

within this series we're going to be

play20:03

taking a look at incident response with

play20:05

FireEye Redline all right so the actual

play20:08

red line tool made or developed by Phi I

play20:12

is pretty much one of the best Solutions

play20:14

out there when it comes down to incident

play20:16

response and digital forensics so that

play20:19

is what we'll be exploring in the next

play20:21

video

play20:25

[Music]

play20:32

thank you

play20:34

[Music]

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Docker SecurityTrivy ScannerVulnerability AssessmentContainer ImagesLinux CLICybersecurityDevOpsIT InfrastructureSecurity TrainingHackersploit