mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2026-06-15 13:24:37 +00:00
This PR modifies the GitLab source: * emits a new "groups enumerated" metric * logs more information about group enumeration * emits the repo enumeration metric inside getAllProjectRepos, which means it will work when units are flipped on * emits the repo enumeration metric more granularly
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package gitlab
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
|
|
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
|
|
)
|
|
|
|
var (
|
|
gitlabGroupsEnumerated = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "gitlab_groups_enumerated",
|
|
Help: "Total number of GitLab groups enumerated.",
|
|
},
|
|
[]string{"source_name"})
|
|
|
|
gitlabReposEnumerated = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "gitlab_repos_enumerated",
|
|
Help: "Total number of Gitlab repositories enumerated.",
|
|
},
|
|
[]string{"source_name"})
|
|
|
|
gitlabReposScanned = promauto.NewGaugeVec(prometheus.GaugeOpts{
|
|
Namespace: common.MetricsNamespace,
|
|
Subsystem: common.MetricsSubsystem,
|
|
Name: "gitlab_repos_scanned",
|
|
Help: "Total number of Gitlab repositories scanned.",
|
|
},
|
|
[]string{"source_name"})
|
|
)
|