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

Populate vulnerability.reference with a link to NVD #1303

Conversation

maxcold
Copy link
Contributor

@maxcold maxcold commented Aug 31, 2023

Summary of your changes

This PR moves the logic existing in Kibana to Cloudbeat of populating the NVD link instead of the Aquasec link in vulnerability.reference field.

Screenshot/Data

the field should look like the following after the change

{
...
"reference": "https://nvd.nist.gov/vuln/detail/CVE-2022-3080",
...
}

Related Issues

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary README/documentation (if appropriate)

@@ -73,3 +73,4 @@ terraform.rc
# Vulnerability management
db/
fanal/
java-db/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if it's smth specific to my machine or not, but I had this untracked dir after running cloudbeat locally with vulnerabilities yaml

return vul.PrimaryURL
}

if _, ok := vul.CVSS[trivyVul.NVD]; ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming that if there is a NVD in CVSS then this vulnerability exists in NVD database and the link will be valid. It's a bit brittle in my opinion, but if we want to replace aquasec links that's the simplest way I could find

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, as far as I understand this is the same solution we have today in kibana, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, exactly!

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: invert the if

if _, ok := vul.CVSS[trivyVul.NVD]; !ok {
  return vul.PrimaryURL
}

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

📊 Allure Report - 💚 No failures were reported.

Result Count
🟥 Failed 0
🟩 Passed 39
⬜ Skipped 1

return vul.PrimaryURL
}

if _, ok := vul.CVSS[trivyVul.NVD]; ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: invert the if

if _, ok := vul.CVSS[trivyVul.NVD]; !ok {
  return vul.PrimaryURL
}

@maxcold
Copy link
Contributor Author

maxcold commented Sep 11, 2023

@amirbenun updated in case you want to take a look

@maxcold maxcold force-pushed the 869-populate-vulnerabilityreference-with-a-link-to-nvd-rather-then-aquasec-domain branch from 1151388 to 00a6faa Compare September 11, 2023 13:18
@maxcold maxcold enabled auto-merge (squash) September 12, 2023 08:41
@maxcold maxcold merged commit 752b630 into elastic:main Sep 12, 2023
@maxcold maxcold deleted the 869-populate-vulnerabilityreference-with-a-link-to-nvd-rather-then-aquasec-domain branch September 12, 2023 11:16
maxcold added a commit to elastic/kibana that referenced this pull request Sep 12, 2023
## Summary

- fixes: elastic/security-team#7490

The NVD generation logic will be happening on the `cloudbeat` side after
elastic/cloudbeat#869 (comment) is done and
elastic/cloudbeat#1303 is merged, so we can
remove the logic from Kibana and use what's in `vulnerability.reference`

---------

Co-authored-by: kibanamachine <[email protected]>
orestisfl pushed a commit to jeniawhite/cloudbeat that referenced this pull request Sep 18, 2023
* opulate vulnerability.reference with a link to NVD

* revert the if statemenet
jeniawhite added a commit that referenced this pull request Sep 22, 2023
* Implement Azure benchmark

* Fixing CR

* fixes

* [CloudFormation] Verify installation of cfn-signal (#1328)

* Bump magefile/mage-action from 2 to 3 in /.github/workflows (#1333)

Bumps [magefile/mage-action](https://github.com/magefile/mage-action) from 2 to 3.
- [Release notes](https://github.com/magefile/mage-action/releases)
- [Commits](magefile/mage-action@v2...v3)

---
updated-dependencies:
- dependency-name: magefile/mage-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* go.mod: Organize require blocks and update SDKs (#1330)

* Organize go.mod require blocks
* Update SDKs
* Remove go-errors/errors usage

* [CIS GCP] Add log bucket type to asset fetcher (#1327)

* add log bucket type

* bump cis policies version

* Rename factory package to preset (#1334)

* pre-commit: golangci-lint: Auto fix supported failures (#1336)

* Create a dedicated AWS organization preset (#1335)

* factory.NewCisAzureFactory

* Remove extra build step (#1337)

* AWS CSPM Resources add ECS data (#1312)

* Populate vulnerability.reference with a link to NVD (#1303)

* opulate vulnerability.reference with a link to NVD

* revert the if statemenet

* [Cloud Security] [Telemetry] fix package policy vars to use posture field (#1325)

fix package policy vars to use posture field

* Use branches to get bundles (#1332)

* Refactor to be compatible with main and fix compilation

* Fixing linter

* Adding unit tests

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Orestis Floros <[email protected]>
Co-authored-by: Amir Ben Nun <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Uri Weisman <[email protected]>
Co-authored-by: Or Ouziel <[email protected]>
Co-authored-by: Maxim Kholod <[email protected]>
Co-authored-by: Lola <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Populate vulnerability.reference with a link to NVD rather then aquasec domain
2 participants