Replies: 1 comment 2 replies
-
Hi @h-l-b ! Trivy does not currently support symlinks . |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
We are migrating from tfsec to trivy and trivy is not scanning most of the nested terraform modules in one of our projects - the number of config files detected is fewer than expected and expected misconfigurations are not flagged. The reason for this seems to be that they are called in a loop based on a variable defined in a symlinked file (simplified version of our project structure below)
main.tf in root module
virtual_environments is defined in the variables file, which is actually a symlink from the root module directory
variables.tf -> ../../shared/variables.tf
The actual value for virtual_environments for an environment is in a tfvars file which is passed in as an argument to the trivy config command.
If I replace the symlink to variables.tf with an actual variables.tf file with exactly the same content, then the number of config files detected is greater and ../../modules/0_network is actually scanned, so it looks like it is the symlink that is causing the issue. We use the symlink to a shared file because we have multiple layers in the project which use the same variables, so this way we only have to update them in one place. tfsec works fine with this.
I've found #4184 which says that symlinks are not supported, but it's from last year and was wondering if it is still the case, and if there are any plans to add support?
Target
Filesystem
Scanner
Misconfiguration
Output Format
None
Mode
None
Operating System
macOS Sonoma
Version
Beta Was this translation helpful? Give feedback.
All reactions