Containers are amazing and allow you to not only package up your application but parts of the OS too. With that in mind, it's really important that you understand any vulnerabilities that might exist in that container. This is where Clair comes in. Clair is an amazing container scanning tool that fits into your CI/CD pipeline and this action scans your image for known vulnerabilities.
This action executes clair scanning by using the official clair Docker image and
restricted only to a given updater
This action creates a virtual environment based on Docker containers in order to execute a scan, using Clair, of an image you specify.
Once started, the necessary volumes required by the containers are created and started. Clair makes use of a database of vulnerabilities based on the updater
input parameter. The image is then uploaded to the local Docker Registry, using the and First, the action creates the volumes needed by the containers and start them.
The database used by Clair is populated with vulnerabilities for the given
technology in the updater
input parameter. Then, the action uploads the image specified in the image
parameter (it doesn't matter if it is local or not) and start the scanning process. The report is stored using the value specified in the report_path
.
Once the action has been added into your workflow, there's a number of variables you need to edit, namely:
Required: What container image should be analyzed?.
E.g.: vulnerables/web-dvwa
Optional: It tells the action if it should perform the container image pull or not. Values: yes | no
Default value: `yes'
Optional: What report format should be used?. Values: xml | json | text
Default value: json
E.g.: json
Required: Where should the report be saved?
E.g.: clairReport.json
Optional: This is userful when you have slow runners or a larger image. You can specify a timeout value here.
Default: value: 120
E.g.: 300
Required: The updater name for scanning as specified in the Clair config documentation
E.g.: debian
- name: Clair Scan
uses: santander-group/clair-scan-action@main
with:
image: vulnerables/web-dvwa
local: no
report_format: json
report_path: clair-report.json
updater: debian
This project is far from being perfect, so any help is always welcome. Please, review our CONTRIBUTING file to know how to get involved.
Reporting a bug is also a way of contributing, so you can review our CONTRIBUTING guide to know how to create a ticket or get help.