Skip to content

Conversation

Okeanos
Copy link
Contributor

@Okeanos Okeanos commented Mar 10, 2025

Description:

This PR implements exceptions to the generic-api-key rule to prevent false positives experienced with Yocto/BitBake projects as explained in #1775

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

Okeanos added 2 commits March 10, 2025 23:00
…chCondition

https://pkg.go.dev/text/template#hdr-Actions

> {{with pipeline}} T1 {{end}}
>	If the value of the pipeline is empty, no output is generated;
>	otherwise, dot is set to the value of the pipeline and T1 is
>	executed.

Within the `with` block `.MatchCondition` is implicit and must be omitted to
work. The fault/bug was not triggered before because this is the first
non-default MatchCondition apparently.
[[rules.allowlists]]
condition = "AND"
paths = [
'''\.bb$''','''\.bbappend$''','''\.bbclass$''','''\.inc$''',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outside of the scope for this PR but it would be nice if this formatting matched the other toml arrays where each line has an entry

@zricethezav
Copy link
Collaborator

nice work @Okeanos! Thanks for this PR

@zricethezav zricethezav merged commit 991a940 into gitleaks:master Mar 11, 2025
2 checks passed
sirakav pushed a commit to sirakav/gitleaks that referenced this pull request Apr 25, 2025
…eaks#1783)

* fix: make config template work when providing non-iota values for MatchCondition

https://pkg.go.dev/text/template#hdr-Actions

> {{with pipeline}} T1 {{end}}
>	If the value of the pipeline is empty, no output is generated;
>	otherwise, dot is set to the value of the pipeline and T1 is
>	executed.

Within the `with` block `.MatchCondition` is implicit and must be omitted to
work. The fault/bug was not triggered before because this is the first
non-default MatchCondition apparently.

* feat: exclude false positive matches for Yocto/Bitbake from generic-api-key rule

Fixes gitleaks#1775
alayne222 pushed a commit to alayne222/gitleaks that referenced this pull request May 28, 2025
…eaks#1783)

* fix: make config template work when providing non-iota values for MatchCondition

https://pkg.go.dev/text/template#hdr-Actions

> {{with pipeline}} T1 {{end}}
>	If the value of the pipeline is empty, no output is generated;
>	otherwise, dot is set to the value of the pipeline and T1 is
>	executed.

Within the `with` block `.MatchCondition` is implicit and must be omitted to
work. The fault/bug was not triggered before because this is the first
non-default MatchCondition apparently.

* feat: exclude false positive matches for Yocto/Bitbake from generic-api-key rule

Fixes gitleaks#1775
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants