Skip to content

--no-git inspects .gitleaks.toml config file  #708

@adamdecaf

Description

@adamdecaf

Describe the bug
I ran gitleaks v8.0.2 with --no-git and found it detected secrets in its own config file.
Example: moov-io/infra#233

To Reproduce

  1. Run gitleaks detect --no-git (so it writes the config file)
  2. Run the command again
{
	"Description": "Generic API Key",
	"StartLine": 12,
	"EndLine": 12,
	"StartColumn": 21,
	"EndColumn": 63,
	"Context": "#   discord_client_secret = \"8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ\"",
	"Secret": "secret = \"8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ\"",
	"File": ".gitleaks.toml",
	"Commit": "",
	"Entropy": 4.41391,
	"Author": "",
	"Email": "",
	"Date": "",
	"Message": "",
	"Tags": [],
	"RuleID": "generic-api-key"
}
{
	"Description": "Discord client secret",
	"StartLine": 12,
	"EndLine": 12,
	"StartColumn": 6,
	"EndColumn": 63,
	"Context": "#   discord_client_secret = \"8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ\"",
	"Secret": "discord_client_secret = \"8dyfuiRyq=vVc3RRr_edRk-fK__JItpZ\"",
	"File": ".gitleaks.toml",
	"Commit": "",
	"Entropy": 0,
	"Author": "",
	"Email": "",
	"Date": "",
	"Message": "",
	"Tags": [],
	"RuleID": ""
}

Expected behavior
gitleaks should ignore its own configuration file.

Basic Info (please complete the following information):

  • OS: macOS 11.3.1
  • Gitleaks Version: v8.0.2

cc @zricethezav

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions