Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at startup #6

Open
mario-teq opened this issue Jan 28, 2024 · 4 comments
Open

Error at startup #6

mario-teq opened this issue Jan 28, 2024 · 4 comments
Assignees

Comments

@mario-teq
Copy link

mario-teq commented Jan 28, 2024

Hello

The app is not running with last version of semgrep and prospector-html.

semgrep scan --json --output semgrep-native-report.json --config=auto myapp

prospector-html --input semgrep-native-report --output filtered-report.html --filter semgrep

(.venv) ~ [ prospector-html --input semgrep-native-report.json --output filtered-report.json --json 
Traceback (most recent call last):
  File "/home/mario/.venv/bin/prospector-html", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/mario/.venv/lib/python3.11/site-packages/prospector2html/__main__.py", line 9, in main
    sys.exit(prh.main())
             ^^^^^^^^^^
  File "/home/mario/.venv/lib/python3.11/site-packages/prospector2html/prospector2html.py", line 141, in main
    msgs = json_obj['vulnerabilities']
           ~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'vulnerabilities'
@amdei amdei self-assigned this Jan 31, 2024
@amdei
Copy link
Owner

amdei commented Jan 31, 2024

Sorry to hear that something is not working for you.

The issue appears in lack of proper error reporting on different output formats form different SAST tools.

Try to add --filter semgrep to your last command line.
E.g.

prospector-html --input semgrep-native-report.json --output filtered-report.json --json --filter semgrep

@amdei
Copy link
Owner

amdei commented Jan 31, 2024

Gota enhance error reporting and update samples in documentation, though.

@mario-teq
Copy link
Author

thank you the command line is running well produce a json, so how to produce an HTML?

@amdei
Copy link
Owner

amdei commented Jun 4, 2024

so how to produce an HTML?

In order to produce HTML instead of JSON - just avoid --json paramter

E.g.

prospector-html --input semgrep-native-report.json --output filtered-report.html --filter semgrep

Result will be in file filtered-report.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants