Skip to content

raffaeleav/percival

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Python CLI that scans for vulnerabilities in Docker container images, developed as a project for the Penetration Testing and Ethical Hacking course, part of the Computer Science Master's Degree program at the University of Salerno

Table of Contents

Overview

perCIVAl was build to provide a valuable tool in the context of Vulnerability Assessment of container images. The CLI enables users to fetch a Docker image (given its image name and tag), scan for OS packages / language dependencies vulnerabilities and then produce a report.

Preview

Features

  1. Pull a Docker Image
  2. Scan with Trivy
  3. Scan for OS packages vulnerabilities
  4. Scan for language dependencies vulnerabilities
  5. Generate report
  6. Delete temp files (such as image layers and manifest.json)

Requirements

  • Docker
  • Trivy
  • Python dependencies are listed in the "requirements.txt" file

Project structure

percival/
│── data/                  
│   ├── images/            # Docker images
│   ├── reports/		   
│   └── temp/              # Image layers
│
│── percival/              
│
│── core/                  # React frontend
│   ├── __init.py__        
│   ├── extract.py	       # Layers / manifest.json extraction
|   ├── fetch.py           # Image pull
│   ├── parse.py           # Database file / language dependencies file parsers
|   ├── report.py.         # Report generation
|   └── scan.py            # Vulnerability scanner
│  
│ 
│── helpers/               
│   ├── __init.py__     
│   ├── api.py             # Vulnerability database queries
|   ├── folders.py__     
│   └── shell.py	       
│
│── .gitignore
|
│── main.py/               # CLI entry point
|
│── README.md
└── requirements.txt

How to replicate

  1. Clone the repository
git clone https://github.com/raffaeleav/percival.git
  1. Install dependencies (assuming conda is being used)
conda create -n "percival"
conda activate percival
pip install -r percival/requirements.txt
  1. Switch to the project directory
cd percival
  1. Start the CLI
python main.py
  1. Fetch an image (assuming Docker daemon it's running)
fetch <image-name>:<tag>
  1. Scan for vulnerabilities
vscan <image-name>:<tag>
  1. Generate report (found in percival/data/reports directory)
report <image-name>:<tag>

Built with

  • cmd2 - used for the CLI development

About

A Python CLI that scans for vulnerabilities in Docker container images, developed as a project for the Penetration Testing and Ethical Hacking course, part of the Computer Science Master's Degree program at the University of Salerno

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors