mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 07:40:48 -08:00
fix(misconf): respect .yml files when Helm charts are detected (#9912)
Signed-off-by: nikpivkin <nikita.pivkin@smartforce.io>
This commit is contained in:
@@ -16,7 +16,7 @@ Trivy scans Infrastructure as Code (IaC) files for
|
|||||||
| [Terraform Plan](terraform.md) | tfplan, \*.tfplan, \*.json |
|
| [Terraform Plan](terraform.md) | tfplan, \*.tfplan, \*.json |
|
||||||
| [CloudFormation](cloudformation.md) | \*.yml, \*.yaml, \*.json |
|
| [CloudFormation](cloudformation.md) | \*.yml, \*.yaml, \*.json |
|
||||||
| [Azure ARM Template](azure-arm.md) | \*.json |
|
| [Azure ARM Template](azure-arm.md) | \*.json |
|
||||||
| [Helm](helm.md) | \*.yaml, \*.tpl, \*.tar.gz, etc. |
|
| [Helm](helm.md) | \*.yml, \*.yaml, \*.tpl, \*.tar.gz, etc. |
|
||||||
| [YAML][json-and-yaml] | \*.yaml, \*.yml |
|
| [YAML][json-and-yaml] | \*.yaml, \*.yml |
|
||||||
| [JSON][json-and-yaml] | \*.json |
|
| [JSON][json-and-yaml] | \*.json |
|
||||||
| [Ansible](ansible.md) | \*.yml, \*.yaml, \*.json, \*.ini, without extension |
|
| [Ansible](ansible.md) | \*.yml, \*.yaml, \*.json, \*.ini, without extension |
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ func init() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
helmFileExtensions := []string{".yaml", ".tpl"}
|
helmFileExtensions := []string{".yml", ".yaml", ".tpl"}
|
||||||
ext := filepath.Ext(filepath.Base(name))
|
ext := filepath.Ext(filepath.Base(name))
|
||||||
for _, expected := range helmFileExtensions {
|
for _, expected := range helmFileExtensions {
|
||||||
if strings.EqualFold(ext, expected) {
|
if strings.EqualFold(ext, expected) {
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ Resources:
|
|||||||
r: nil,
|
r: nil,
|
||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
FileTypeAnsible,
|
FileTypeAnsible,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -276,6 +277,7 @@ spec:
|
|||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeKubernetes,
|
FileTypeKubernetes,
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
FileTypeAnsible,
|
FileTypeAnsible,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -342,6 +344,7 @@ spec:
|
|||||||
r: nil,
|
r: nil,
|
||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
FileTypeAnsible,
|
FileTypeAnsible,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -351,6 +354,7 @@ spec:
|
|||||||
r: nil,
|
r: nil,
|
||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -384,6 +388,7 @@ data:
|
|||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeKubernetes,
|
FileTypeKubernetes,
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
FileTypeAnsible,
|
FileTypeAnsible,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -413,6 +418,7 @@ rules:
|
|||||||
expected: []FileType{
|
expected: []FileType{
|
||||||
FileTypeKubernetes,
|
FileTypeKubernetes,
|
||||||
FileTypeYAML,
|
FileTypeYAML,
|
||||||
|
FileTypeHelm,
|
||||||
FileTypeAnsible,
|
FileTypeAnsible,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user