Metadata-Version: 2.2
Name: iv_sherlock
Version: 0.1.0
Summary: This packge parses the vulnerability report(.json) generated by trivy for container images, then generate human readable report(.html or .pdf) 
Author-email: Pengfei <pengfei.liu@casd.eu>
License: MIT License
        
        Copyright (c) 2018 Real Python
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: repository, https://github.com/CASD-EU/ImageVulnAnalyzer
Project-URL: documentation, https://github.com/CASD-EU/ImageVulnAnalyzer
Keywords: docker image vulnerability,trivy
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: jinja2
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pandas-stubs; extra == "dev"

# ImageVulnAnalyzer

This tool can parse the raw vulnerabilities report of container image generated by **trivy** and generate a human-readable HTML page.


## Installation 

```shell
pip install iv_sherlock
```

## Use the tool

This tool comes with a default `config.toml`, it's designed for running in `linux OS`.

```toml
[report]
# directory to put raw report generated by trivy
source_path = "/tmp/iv_sherlock/data"

# direcotry 
out_path = "/tmp/iv_sherlock/report"
default_encoding = "utf-8"
export_pdf = false

[cvss]
score_mapping = '{"AV": {"N": 0.85, "A": 0.62}, "AC": {"L": 0.77, "H": 0.44}, "PR": {"N": 0.85, "L": 0.62, "H": 0.27}, "UI": {"N": 0.85, "R": 0.62}, "S": {"U": 1.0, "C": 1.08}, "C": {"H": 0.56, "L": 0.22, "N": 0.0}, "I": {"H": 0.56, "L": 0.22, "N": 0.0}, "A": {"H": 0.56, "L": 0.22, "N": 0.0}}'


```

You can overload the default configuration file by using the `-c` or `--conf` option.

```shell
# run the application with default conf, only works in Linux OS
iv_sherlock

# run the application with custom conf
iv_sherlock -c path/to/custom_conf.toml
```

To generate some raw report for image in trivy, you can use the below command

```shell
$ trivy image -f json -o redis.json redis
```

> You can have more details of trivy from [here](https://aquasecurity.github.io/trivy/v0.55/docs/configuration/reporting/)

## The image vulnerabilities 

The image vulnerabilities can be divided into two categories:

- The vulnerabilities from base OS
- The vulnerabilities from the applications (or dependencies of the application)

## Rendering 

The application will generate one report per image and one general report (summary)
It is possible to get such a report in PDF too because it prints badly in browsers from HTML

To do that, install playwright and use : 

```shell
playwright install
```

Otherwise, you can deactivate this functionality in the `config.toml` by setting `export_pdf` to `false`.

The app will run without playwright then
