Replies: 3 comments 1 reply
-
Hi @armas-mk ! Could you give a minimally reproducible example? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @nikpivkin , here is an easily reproducible example
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Track #7557 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Trivy crashes during config scanning a terraform plan if a .tftpl template file with grok pattern is rendered via the
templatefile()
built-in function in Terraform.Desired Behavior
trivy shouldn't try to process keywords escaped with %%. The templatefile syntax is correct and terraform validate reports no problem and can deploy with terraform with template rendered into desired output.
Actual Behavior
When templatefile has grok_pattern: '%%{TIMESTAMP_ISO8601:time} [%%{NUMBER:pid}] %%{GREEDYDATA:message}'
trivy throws
ERROR [terraform parser] Error parsing file module="root" file_path="main.tf" err="main.tf:604,63-69: Invalid template control keyword; \"NUMBER\" is not a valid template control keyword."
Reproduction Steps
1. Place a valid grok pattern in a terraform template file with proper %% escaping 2. run trivy config on the tfplan that has the rendered template
Target
None
Scanner
Misconfiguration
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Ubuntu 22.04.4 LTS
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions