Lint / golangci-lint (push) Waiting to run
Lint / semgrep (push) Waiting to run
Release / Release (push) Waiting to run
Scan for secrets / test (push) Waiting to run
Snifftest / Run Snifftest (push) Waiting to run
Test / test (push) Waiting to run
Test / test-community (push) Waiting to run
* 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.
35 lines
1.0 KiB
Go
35 lines
1.0 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"})
|
|
)
|