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

[Marketplace Contribution] VulnDB - Content Pack Update #38727

Open
wants to merge 5 commits into
base: contrib/xsoar-contrib_nelsandr-cigna-contrib-VulnDB
Choose a base branch
from

Conversation

xsoar-bot
Copy link
Contributor

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Contributor

@nelsandr-cigna

Auto-Generated Documentation Requiring Modification

Video Link

Short demo video of the Pack usage. Speeds up the review. Optional but recommended. Use a video sharing service such as Google Drive or YouTube.

@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Xsoar Support Level Indicates that the contribution is for XSOAR supported pack labels Feb 21, 2025
@content-bot content-bot changed the base branch from master to contrib/xsoar-contrib_nelsandr-cigna-contrib-VulnDB February 21, 2025 14:59
@content-bot
Copy link
Collaborator

Thank you for your contribution. Your generosity and caring are unrivaled! Rest assured - our content wizard @sapirshuker will very shortly look over your proposed changes.
For your convenience, here is a link to the contributions SLAs document.

@content-bot
Copy link
Collaborator

Thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution, please ask the reviewer to update your information in the pack contributors file. See more information here link

@content-bot content-bot added the Contribution Form Filled Whether contribution form filled or not. label Feb 21, 2025
@xsoar-bot
Copy link
Contributor Author

Contribution Pack Resubmitted

Contributor: @nelsandr-cigna

@sapirshuker sapirshuker added the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 24, 2025
Copy link
Contributor

@sapirshuker sapirshuker left a comment

Choose a reason for hiding this comment

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

Hey, Good job! Thank you for your contribution, please see my comments.

In addition, please note I updated the release notes for you, please let me know if I missed something regrading the functionally you added in order to update the release notes. Also, I added some section headers since you can not change it from the UI.
Please feel free to reach out to me with any questions - I'm available here or on slack :)
You can add the fixes / changes by using the resubmit option resubmit-a-content-pack, or by using GitHub Codespaces - GitHub Codespaces documentation.
Thanks again!


name: vuln_id
required: true
description: Returns the PDF report for a vulnerability as generated by VulnDB.
name: vulndb-get-vuln-report-by-vuln-id
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the return value is a report please follow the following conventions

# Parse out the filename from this return
report_file_name = res.headers.get('content-disposition').split(';')[1].split('"')[1]

return_results(fileResult(report_file_name, report_file))
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the return value is a report please follow the following conventions

report_file = res.content

# 'content-disposition' comes back in the following format:
# attachment; filename="VulnDB ID 389586.pdf"; filename*=UTF-8''VulnDB%20ID%20389586.pdf
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure there is no sensitive information here or replace any sensitive information with dummy values.

Copy link
Contributor

Choose a reason for hiding this comment

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

Confirmed that is not sensitive/internal information. VulnDB is built around those integer IDs, any VulnDB customer could see the same report ID.

res = client.http_file_request(f'/vulnerabilities/{vulndb_id}.pdf')

# Byte data of the result file
report_file = res.content
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if an incorrect vuln_id is used?

Copy link
Contributor

Choose a reason for hiding this comment

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

The user receives the following error
Failed to execute vulndb-get-vuln-report-by-vuln-id command. Error: Error in API call [406] - Not Acceptable
This is similar to the existing behaivor for the vulndb-get-vuln-by-id command which returns

Failed to execute vulndb-get-vuln-by-id command. Error: Error in API call [404] - Not Found
{"error_id": 6151795, "error": "Unable to find a vulnerability with id 1234132432932928"}```

description: Returns the CPE(s) for a vulnerability, by VulnDB ID.
name: vulndb-get-cpe-by-vuln-id
outputs:
- contextPath: VulnDB.CPE
Copy link
Contributor

Choose a reason for hiding this comment

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

Context outputs should be in the form Product.Entity.Something.
Let's add the Entity. Maybe we can change it to ?
VulnDB.Vulnerability.CPE

@@ -60,6 +69,7 @@ def vulndb_vulnerability_to_entry(vuln):
'SolutionDate': vuln.get('solution_date', '').rstrip('Z'),
'DiscoveryDate': vuln.get('disclosure_date', '').rstrip('Z'),
'ExploitPublishDate': vuln.get('exploit_publish_date', '').rstrip('Z'),
'TechnicalDescription': vuln.get('t_description', '')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see that the changes you made are relevant to this function. I would appreciate an explanation of the significance of adding these items. If you can include relevant references, I would be grateful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-02-26 at 2 51 31 PM

The technical description fields includes information that has been added after the initial creation of the vuln in VulnDB. This contextual information is useful for an analyst trying to determine the risk the vulnerability represents.


timeline_details = {
'DiscoveryDate': vuln.get('discovery_date', '').rstrip('Z'),
'DisclosureDate': vuln.get('disclosure_date', '').rstrip('Z'),
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see that the changes you made are relevant to this function. I would appreciate an explanation of the significance of adding these items. If you can include relevant references, I would be grateful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Screenshot 2025-02-26 at 2 49 13 PM The timeline details are the data present in this section of a VulnDB vulnerability. These are useful when determining the risk a vulnerability presents to your org by letting you know how long a vuln has been public, if/when it was exploited, whether the vendor has acknowledged the vuln, etc.

@@ -2,7 +2,7 @@
"name": "VulnDB",
"description": "Lists all of the security vulnerabilities for various products (OS,Applications) etc)",
"support": "xsoar",
"currentVersion": "1.0.12",
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change the version revision (to 1.0.13) to according to the docs

name: vulndb-get-vuln-report-by-vuln-id
- arguments:
- description: VulnDB vulnerability ID.
name: vuln_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a way to retrieve the vuln_id with a command? Is there a command we can add to fetch the id?

Copy link
Contributor

@nelsandr-cigna nelsandr-cigna Feb 26, 2025

Choose a reason for hiding this comment

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

There are several existing commands that allow the user to fetch a vuln_id including vulndb-get-vuln-by-product-id, vulndb-get-vuln-by-vendor-and-product-id, vulndb-get-vuln-by-vendor-and-product-name,vulndb-get-vuln-by-vendor-id and lastly, my new command vulndb-get-vuln-by-cve-id

def vulndb_get_cpe_command(args: dict, client: Client):
vulndb_id = args['vuln_id']

res = client.http_request(f'/vulnerabilities/{vulndb_id}?show_cpe=true')
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this filter (show_cpe=true) customized or do all users have the same? I couldn't find it in the product documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

That param is built into VulnDB's API (https://vulndb.flashpoint.io/documentation/api). There is a section "Pulling Vulnerability Information", that shows optional params including "show_cpe=true".

Copy link
Contributor

@nelsandr-cigna nelsandr-cigna Feb 26, 2025

Choose a reason for hiding this comment

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

Screenshot 2025-02-26 at 2 46 47 PM

@sapirshuker sapirshuker added pending-contributor The PR is pending the response of its creator ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. and removed ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. labels Feb 24, 2025
@content-bot
Copy link
Collaborator

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Collaborator

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/2552889

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Feb 24, 2025
@xsoar-bot xsoar-bot force-pushed the nelsandr-cigna-contrib-VulnDB branch from 3124a20 to 85ddffd Compare February 28, 2025 16:50
@xsoar-bot
Copy link
Contributor Author

Contribution Pack Resubmitted

Contributor: @nelsandr-cigna

@sapirshuker
Copy link
Contributor

sapirshuker commented Mar 2, 2025

Hey @nelsandr-cigna
I see that there are still errors in pre-commit, please update me when the fix is ready for review.

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ sapirshuker
❌ xsoar-bot
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! External PR pending-contributor The PR is pending the response of its creator Xsoar Support Level Indicates that the contribution is for XSOAR supported pack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants