Skip to content

Parser fails when no findings in results #1489

@domcar

Description

@domcar

🐞 Bug report

Describe the bug

The parser has a failed state when in the results there are no findings

Steps To Reproduce

Apply scan (trivy in my case) to a image

System (please complete the following information):

Screenshots / Logs

Scan configuration:

apiVersion: execution.securecodebox.io/v1
kind: Scan
metadata:
  finalizers:
  - s3.storage.securecodebox.io
  name: redacted
  namespace: securecodebox-system
spec:
  parameters:
  - --security-checks
  - vuln
  - redacted
  resources: {}
  scanType: trivy-image
status:
  errorDescription: Failed to run the Parser. This is likely a Bug, we would like
    to know about. Please open up a Issue on GitHub.
  findingDownloadLink: redacted
  findingHeadLink: redacted
  findings:
    severities: {}
  rawResultDownloadLink: redacted
  rawResultFile: trivy-results.json
  rawResultHeadLink: redacted
  rawResultType: trivy-json
  state: Errored

And the error from the parser pod:

Starting Parser
Fetching result file
Fetched result file
Parser failed with error:
TypeError: scanResults.Results is not iterable
    at parse (/home/app/parser-wrapper/parser/parser.js:16:65)
    at main (/home/app/parser-wrapper/parser-wrapper.js:127:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Additional context

Metadata

Metadata

Assignees

Labels

bugBugsscannerImplement or update a security scanner

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions