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

Implement OpenScanHub initial reporting #2543

Open
5 tasks
Tracked by #2516
lbarcziova opened this issue Sep 24, 2024 · 6 comments
Open
5 tasks
Tracked by #2516

Implement OpenScanHub initial reporting #2543

lbarcziova opened this issue Sep 24, 2024 · 6 comments
Labels
area/user-experience Usability issue complexity/single-task Regular task, should be done within days. gain/high This brings a lot of value to (not strictly a lot of) users. impact/low This issue impacts only a few users. kind/feature New feature or a request for enhancement.

Comments

@lbarcziova
Copy link
Member

lbarcziova commented Sep 24, 2024

  • in fedmsg repo, process the messages about OSH task states (see hub: add support for fedora messaging openscanhub/openscanhub#299 )
  • create new event class for that and implement parsing of these
  • create a model for a scan
  • store the task in the DB somewhere here and instead of successful status there, report in-progress
  • create a handler to report the results for the new event
    • obtain the task in our DB, update the state and report it to user
    • for now, just forward the URLs from the message (=> no additional processing)
    • take into consideration Add configurations for CI to fail on OSH scan failures and new findings #2515
    • by default don't fail the CI, have a look also into action_required conclusion from here, whether that could be used, or use neutral/successful
    • report neutral status for failed, cancelled or interrupted builds

Part of #2516

@siteshwar
Copy link
Contributor

  • by default don't fail the CI, have a look also into action_required conclusion from here, whether that could be used, or use neutral/successful
  • report neutral status for failed, cancelled or interrupted builds

Please also see Code scanning results check failures.

@mfocko mfocko added kind/feature New feature or a request for enhancement. complexity/single-task Regular task, should be done within days. impact/low This issue impacts only a few users. gain/high This brings a lot of value to (not strictly a lot of) users. area/user-experience Usability issue labels Sep 26, 2024
@siteshwar
Copy link
Contributor

siteshwar commented Oct 3, 2024

by default don't fail the CI, have a look also into action_required conclusion from here, whether that could be used, or use neutral/successful

If you want to find out if new findings were detected, follow these steps:

  • Download the added.js file.
  • Run csgrep added.js and check if output is non-empty.
  • If output is non-empty, it means there were new findings by the analzyers. Set the CI to action required state.
  • Otherwise pass the CI.

EDIT: @kdudka Is there any other way to count number of findings in the reports?

@kdudka
Copy link

kdudka commented Oct 3, 2024

@siteshwar For simple scans, we can check whether the scan-results-summary.txt file is empty or not. Unfortunately, for differential scans, we do not provide such a file that would summarize the added.* results. We can still check whether added.err is empty or not.

@siteshwar
Copy link
Contributor

And just to keep everybody in sync. The messages from OpenScanHub can be seen through:

fedora-messaging --conf /etc/fedora-messaging/fedora.toml consume --routing-key "org.fedoraproject.prod.openscanhub.task.*

@kdudka
Copy link

kdudka commented Oct 4, 2024

@siteshwar I can see that the URLs provided in Body: of messages about finished scans use the http:// scheme instead of https://. Consequently the scan results URLs, when used directly, return 302 Found instead of the real data.

@kdudka
Copy link

kdudka commented Oct 4, 2024

The problem may actually be more generic. I got an e-mail notification and the task URL also contained http:// URL. Something must be misconfigured in the Fedora deployment because the internal OSH instances use https:// URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Usability issue complexity/single-task Regular task, should be done within days. gain/high This brings a lot of value to (not strictly a lot of) users. impact/low This issue impacts only a few users. kind/feature New feature or a request for enhancement.
Projects
Status: refined
Development

No branches or pull requests

4 participants