Prevent Yocto/BitBake false positives with generic-api-key rule (#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 #1775
This commit is contained in:
Nikolas Grottendieck authored and GitHub committed 2025-03-11 09:58:56 -05:00
1 parent ade376ab77
commit 991a940412
3 files changed
+31 -1

No files matched your search

+11
View File
@@ -2077,6 +2077,17 @@ regexTarget = "line"
regexes = [
'''--mount=type=secret,''',
]
[[rules.allowlists]]
condition = "AND"
paths = [
'''\.bb$''','''\.bbappend$''','''\.bbclass$''','''\.inc$''',
]
regexTarget = "line"
regexes = [
'''LICENSE[^=]*=\s*"[^"]+''',
'''LIC_FILES_CHKSUM[^=]*=\s*"[^"]+''',
'''SRC[^=]*=\s*"[a-zA-Z0-9]+''',
]
[[rules]]
id = "github-app-token"