mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-14 00:47:21 +00:00
0024b6ce77
* feat: support docker image history scanning * refactor: collapse error handling into return Style suggestion from review feedback. * fix: associate layers with history entries Where possible, add the associated layer to the history entry record. This may help tracing any issues discovered. This also changes the entry reference format to `image-metadata:history:%d:created-by` which _may_ be more self-explanatory.
34 lines
1 KiB
Go
34 lines
1 KiB
Go
package docker
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
|
|
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
|
|
)
|
|
|
|
var (
|
|
dockerLayersScanned = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "docker_layers_scanned",
|
|
Help: "Total number of Docker layers scanned.",
|
|
},
|
|
[]string{"source_name"})
|
|
|
|
dockerHistoryEntriesScanned = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "docker_history_entries_scanned",
|
|
Help: "Total number of Docker image history entries scanned.",
|
|
},
|
|
[]string{"source_name"})
|
|
|
|
dockerImagesScanned = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "docker_images_scanned",
|
|
Help: "Total number of Docker images scanned.",
|
|
},
|
|
[]string{"source_name"})
|
|
)
|