fix(misconf): make identifiers in ignore rules case-insensitive#10375
Open
nikpivkin wants to merge 2 commits intoaquasecurity:mainfrom
Open
fix(misconf): make identifiers in ignore rules case-insensitive#10375nikpivkin wants to merge 2 commits intoaquasecurity:mainfrom
nikpivkin wants to merge 2 commits intoaquasecurity:mainfrom
Conversation
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
afdesk
requested changes
Apr 27, 2026
Comment on lines
+120
to
+121
| re := "(?i)^" + strings.ReplaceAll(regexp.QuoteMeta(pattern), "\\*", ".*") + "$" | ||
| matched, err := regexp.MatchString(re, input) |
Contributor
There was a problem hiding this comment.
won't it affect on this call?
trivy/pkg/iac/scanners/terraform/executor/executor.go
Lines 234 to 240 in b775a1b
| func MatchPattern(input, pattern string) bool { | ||
| matched, err := regexp.MatchString(regexpFromPattern(pattern), input) | ||
| re := "(?i)^" + strings.ReplaceAll(regexp.QuoteMeta(pattern), "\\*", ".*") + "$" | ||
| matched, err := regexp.MatchString(re, input) |
Contributor
There was a problem hiding this comment.
regexp.MatchString is re-complied too often here, isn't it? maybe should we add ToDo to improve it?
|
|
||
|
|
||
| The ignore rule must contain one of the possible check IDs that can be found in its metadata: ID, short code or alias. The `id` from the metadata is not case-sensitive, so you can specify, for example, `AVD-AWS-0089` or `avd-aws-0089`. | ||
| The ignore rule must contain one of the possible check identifiers that can be found in its metadata: ID, long id, or aliases. All of these identifiers are case-insensitive, so you can specify, for example, `AWS-0089`, `aws-0089`, or any combination of upper/lowercase letters. |
Contributor
There was a problem hiding this comment.
won't this be breaking change migrating from short code to long id?
Contributor
Author
There was a problem hiding this comment.
The migration has already been completed and now the short code is in aliases, so this is a fix of outdated documentation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Make identifiers used in ignore rules case-insensitive.
Related issues
Checklist