feat(trivy): Enhance Trivy report generation and metrics handling

- Updated `generate_report.sh` to include additional scanners and output paths.
- Enhanced `send_report.py` with new data classes for misconfigurations and vulnerabilities.
- Improved parsing logic for Trivy output, supporting both Kubernetes and image scans.
- Added Prometheus metrics generation for various scan results, including misconfigurations and vulnerabilities.
- Introduced unit tests for parsing Trivy output and generating Prometheus metrics.
- Modified Terraform variables for SMTP port type and added Pushgateway URL variable.
This commit is contained in:
2026-05-22 23:41:26 +02:00
parent 829ab48919
commit 255ba6aec9
25 changed files with 410938 additions and 71 deletions
+7 -2
View File
@@ -10,7 +10,7 @@ variable "smtp_host" {
variable "smtp_port" {
description = "The SMTP relay port"
type = number
type = string
}
variable "smtp_username" {
@@ -43,7 +43,6 @@ variable "cron_schedule" {
variable "tag" {
description = "The version of Trivy to install"
type = string
default = "latest"
}
variable "report_type" {
@@ -57,3 +56,9 @@ variable "levels" {
type = string
default = "HIGH,CRITICAL"
}
variable "pushgateway_url" {
description = "URL of the Prometheus Pushgateway including /metrics/job/<job> path"
type = string
default = "http://pushgateway.prometheus.svc.cluster.local:9091/metrics/job/trivy-metrics"
}