package rules import ( "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/regexp" ) func NugetConfigPassword() *config.Rule { r := config.Rule{ Description: "Identified a password within a Nuget config file, potentially compromising package management access.", RuleID: "nuget-config-password", Regex: regexp.MustCompile(`(?i)`), Path: regexp.MustCompile(`(?i)nuget\.config$`), Keywords: []string{"`, "Nuget.config": ``, "Nuget.Config": ``, "Nuget.COnfig": ``, "Nuget.CONfig": ``, "Nuget.CONFig": ``, } fps := map[string]string{ "some.xml": ``, // wrong filename "nuget.config": ``, // low entropy "Nuget.config": ``, // too short "Nuget.Config": ``, // environment variable "NUget.Config": ``, // known sample "NUGet.Config": ``, // known sample } return utils.ValidateWithPaths(r, tps, fps) }