Skip to content

Trivy K8s Scans fail due to parser (wrapper) issues #1982

@J12934

Description

@J12934

🐞 Bug report

Describe the bug

Trivy K8s Scans are currently failing.

Steps To Reproduce

cd scanners/trivy/
helm install trivy ./ --set="parser.image.tag=4.0.1"

kubectl apply -f examples/k8s/scan.yaml

kubectl logs pod/parse-trivy-k8s-f6zlw-tmrrb

Outputs (for me)

Starting Parser
Fetching result file
Fetched result file
Parser failed with error:
ReferenceError: Cannot access 'findings' before initialization
    at parse (/home/app/parser-wrapper/parser/parser.js:16:5)
    at main (/home/app/parser-wrapper/parser-wrapper.js:127:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Expected behavior

works

System (please complete the following information):

  • secureCodeBox Version/Release main (b6bb9e8)
  • OS: macos
  • Kubernetes Version 1.28.0

Additional context

Error is pretty weird. The error doesn't really seem to make sense when looking at the line where it is failing as findings is defined right above: https://github.com/secureCodeBox/secureCodeBox/blob/v4.0.1/parser-sdk/nodejs/parser-wrapper.js#L127

Might be some weird behavious caused by the (very) large result of trivy. For me it's about 2Mb.
But we had other big results before and they didn't cause these problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugsscannerImplement or update a security scanner

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions