Replies: 5 comments 4 replies
-
|
with the ghcr.io/aquasecurity/trivy:canary i get better debug output but also not helping: |
Beta Was this translation helpful? Give feedback.
-
|
btw same error with just |
Beta Was this translation helpful? Give feedback.
-
|
Hi @hloeffler ! Based on the error, do you seem to be using templates? Can you share a plan or original hcl config to investigate the issue? |
Beta Was this translation helpful? Give feedback.
-
|
I've faced with a similar error when converting Terraform (Azure infra) output to JSON format: In my case the file included the lines Trivy could not parse correctly: "tags": {
"environment": "...",
"hidden-link: /app-insights-resource-id": "/subscriptions/...",
"managed_by": "...",
"owner": "...",
"project": "..."
}I used this workaround to clean JSON file (just remove the line jq 'walk(
if type == "object" then
with_entries(select(.key | test("[/:]") | not))
else
.
end
)' tfplan.json > tfplan-cleaned.jsonThen I was able to run the command with no issues: |
Beta Was this translation helpful? Give feedback.
-
|
Track #9635 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
trivy config ./tfplan.json --debug
leads to error:
2024-11-28T14:42:26+01:00 ERROR [terraform parser] Error parsing file module="root" file_path="main.tf" err="main.tf:2214,2-3: Invalid expression; Expected the start of an expression, but found an invalid expression token."
Desired Behavior
its just works
Actual Behavior
trivy config ./tfplan.json --debug
leads to error:
2024-11-28T14:42:26+01:00 ERROR [terraform parser] Error parsing file module="root" file_path="main.tf" err="main.tf:2214,2-3: Invalid expression; Expected the start of an expression, but found an invalid expression token."
Reproduction Steps
terraform plan --out tfplan.binary terraform show -json tfplan.binary > tfplan.json trivy config ./tfplan.jsonTarget
None
Scanner
Misconfiguration
Output Format
None
Mode
Standalone
Debug Output
Operating System
Ubuntu 24.04.1 LTS
Version
Checklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions