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

🌱 convert vulnerabilities check to probe #3487

Merged
merged 11 commits into from
Oct 25, 2023

Conversation

AdamKorcz
Copy link
Contributor

What kind of change does this PR introduce?

Migration of Vulnerabilities check to probe.

  • PR title follows the guidelines defined in our pull request documentation

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

NONE

Special notes for your reviewer

Does this PR introduce a user-facing change?

No

checks/evaluation/vulnerabilities.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities_test.go Show resolved Hide resolved
checks/vulnerabilities.go Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/def.yml Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/def.yml Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/def.yml Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/def.yml Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/impl.go Outdated Show resolved Hide resolved
probes/hasKnownVulnerabilities/impl.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #3487 (e0ff285) into main (f2bbd0a) will decrease coverage by 12.65%.
The diff coverage is 79.66%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3487       +/-   ##
===========================================
- Coverage   76.12%   63.48%   -12.65%     
===========================================
  Files         198      187       -11     
  Lines       13700    12914      -786     
===========================================
- Hits        10429     8198     -2231     
- Misses       2663     4198     +1535     
+ Partials      608      518       -90     

@AdamKorcz AdamKorcz temporarily deployed to gitlab September 29, 2023 09:38 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab September 29, 2023 10:21 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 3, 2023 13:18 — with GitHub Actions Inactive
@AdamKorcz
Copy link
Contributor Author

@laurentsimon @spencerschrock PTAL again.

checks/evaluation/finding.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities_test.go Show resolved Hide resolved
checks/evaluation/vulnerabilities_test.go Outdated Show resolved Hide resolved
checks/evaluation/vulnerabilities_test.go Outdated Show resolved Hide resolved
probes/hasOSVVulnerabilities/def.yml Show resolved Hide resolved
probes/hasOSVVulnerabilities/impl.go Outdated Show resolved Hide resolved
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 11, 2023 11:21 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 11, 2023 11:36 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 11, 2023 13:41 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to integration-test October 11, 2023 13:42 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 11, 2023 13:49 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 24, 2023 21:41 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to integration-test October 24, 2023 21:41 — with GitHub Actions Inactive
checks/evaluation/vulnerabilities.go Outdated Show resolved Hide resolved
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: AdamKorcz <adam@adalogics.com>
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 25, 2023 10:36 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to integration-test October 25, 2023 10:36 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 25, 2023 10:40 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to integration-test October 25, 2023 10:40 — with GitHub Actions Inactive
Signed-off-by: AdamKorcz <adam@adalogics.com>
@AdamKorcz AdamKorcz temporarily deployed to gitlab October 25, 2023 10:41 — with GitHub Actions Inactive
@AdamKorcz AdamKorcz temporarily deployed to integration-test October 25, 2023 10:42 — with GitHub Actions Inactive
@spencerschrock spencerschrock merged commit de022da into ossf:main Oct 25, 2023
38 checks passed
f = f.WithMessage(fmt.Sprintf("Project is vulnerable to: %s",
strings.Join(vuln.IDs, " / ")))
f = f.WithRemediationMetadata(map[string]string{
"osvid": strings.Join(vuln.IDs[:], ","),
Copy link
Contributor

@laurentsimon laurentsimon Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are there multiple IDs returned for each vulnerability? Will the URL work properly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be, depending on if there are aliases, in which case we'd want to grab just one.

Copy link
Contributor

@laurentsimon laurentsimon Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fix in a follow-up PR then. Created #3609 for tracking

diogoteles08 pushed a commit to diogoteles08/scorecard that referenced this pull request Nov 13, 2023
* 🌱 convert vulnerabilities check to probe

Signed-off-by: AdamKorcz <adam@adalogics.com>

* rename probe + nits

Signed-off-by: AdamKorcz <adam@adalogics.com>

* edit def.yml

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Add vuln ID dynamically to def.yml

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Elaborate the purpose of test data in unit test

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Move logging out of loop and change logic of negativeFindings()

Signed-off-by: AdamKorcz <adam@adalogics.com>

* preserve number of vulns found in output

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Preserve grouping of vulns

Signed-off-by: AdamKorcz <adam@adalogics.com>

* fix linter issues

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Add remediation data

Signed-off-by: AdamKorcz <adam@adalogics.com>

* use checker.LogFindings()

Signed-off-by: AdamKorcz <adam@adalogics.com>

---------

Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
ashearin pushed a commit to kgangerlm/scorecard-gitlab that referenced this pull request Nov 13, 2023
* 🌱 convert vulnerabilities check to probe

Signed-off-by: AdamKorcz <adam@adalogics.com>

* rename probe + nits

Signed-off-by: AdamKorcz <adam@adalogics.com>

* edit def.yml

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Add vuln ID dynamically to def.yml

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Elaborate the purpose of test data in unit test

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Move logging out of loop and change logic of negativeFindings()

Signed-off-by: AdamKorcz <adam@adalogics.com>

* preserve number of vulns found in output

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Preserve grouping of vulns

Signed-off-by: AdamKorcz <adam@adalogics.com>

* fix linter issues

Signed-off-by: AdamKorcz <adam@adalogics.com>

* Add remediation data

Signed-off-by: AdamKorcz <adam@adalogics.com>

* use checker.LogFindings()

Signed-off-by: AdamKorcz <adam@adalogics.com>

---------

Signed-off-by: AdamKorcz <adam@adalogics.com>
Signed-off-by: Allen Shearin <allen.p.shearin@gmail.com>
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

Successfully merging this pull request may close these issues.

4 participants