Woodpecker CI plugin with
trivy utility to check vulnerabilities in images.
- Go 95.1%
- Dockerfile 4.9%
|
|
||
|---|---|---|
| .gitignore | ||
| .goreleaser.yaml | ||
| .markdownlint.json | ||
| .prettierrc | ||
| .test.env | ||
| .trivyignore | ||
| action_file_list.go | ||
| action_local.go | ||
| action_repo.go | ||
| Containerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| renovate.json | ||
| template.go | ||
| trivy.go | ||
Container with trivy for Woodpecker CI
This is a plugin for Woodpecker CI that check vulnerabilities with trivy
utility. This can be used in two mode:
- Using in pipeline to validate the code itself
- Using as a cron trigger to scan the repository and belonging container images
In case of repo_scan mode, it open a vulnerability dashboard ticket and update
it accordingly. It makes a "ping comment" then a critical one was detected.
Usage
It can be used at any event.
Example to use from a release workflow to scan image and local project.
steps:
- name: Build image locally
image: code.thinkaboutit.tech/pandora/container-builder.woodpecker
settings:
debug: true
registry_push: false
- name: Check built image.tar.gz for vulnerabilities
image: code.thinkaboutit.tech/pandora/trivy.woodpecker
settings:
debug: true
- name: Scan the code of the project
image: code.thinkaboutit.tech/pandora/trivy.woodpecker
settings:
mode: local_fs_scan
debug: true
- name: Push the verified image to the repository
image: code.thinkaboutit.tech/pandora/container-builder.woodpecker
settings:
debug: true
registry_push: true
registry_push_latest: true
registry_owner: pandora
registry_user: bot-ci
registry_pwd:
from_secret: gitea-bot-ci
Example to use to scan repository:
steps:
- name: Check built image.tar.gz for vulnerabilities
image: code.thinkaboutit.tech/pandora/trivy.woodpecker
settings:
mode: repo_scan
forgejo_user:
from_secret: ci-user
forgejo_token:
from_secret: ci-password
debug: true
Settings
Base settings
| Name | Default value | Description |
|---|---|---|
| mode | local_image_scan | It can be local_image_scan, local_fs_scan, scan_file_list or repo_scan |
| repo_name | CI_REPO_NAME | Name of repository |
| repo_owner | CI_REPO_OWNER | Owner of the repository |
| forgejo_url | CI_FORGE_URL | Address of Forgejo |
Authentication settings
They are needed when repo_scan is specified.
| Name | Default value | Description |
|---|---|---|
| forgejo_user | User to handle issues | |
| forgejo_token | Access token for CI user |
File list settings
They are need when scan_file_list is specified.
| Name | Default value | Description |
|---|---|---|
| file_list | image_list | Name of the file that is read |
| forgejo_user | (optional) User to handle issues | |
| forgejo_token | (optional) Access token for CI user |