Skip to content

[K9VULN-1175] Validate purl#1499

Merged
juli1 merged 2 commits into
masterfrom
juli1/K9VULN-1175
Dec 9, 2024
Merged

[K9VULN-1175] Validate purl#1499
juli1 merged 2 commits into
masterfrom
juli1/K9VULN-1175

Conversation

@juli1

@juli1 juli1 commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

What problem are you trying to solve?

We want to prevent customer from uploading invalid requests (for example, with invalid purl).

Solution

Filter the data and prevent uploading payload with invalid package url.

Testing

Added one unit test.

Running locally

$ yarn launch sbom upload ./src/commands/sbom/__tests__/fixtures/sbom-invalid-purl.json             
invalid purl invalid purl: Invalid purl: missing required "pkg" scheme component
❌ Invalid SBOM report file [./src/commands/sbom/__tests__/fixtures/sbom-invalid-purl.json].
The report is not a valid SBOM or is not compliant with our json schema.

@juli1 juli1 requested review from a team as code owners December 4, 2024 20:34
@juli1 juli1 requested a review from amaanq December 4, 2024 20:34
@juli1 juli1 added the static-analysis Related to [sarif, sbom] label Dec 4, 2024
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Dec 4, 2024

Copy link
Copy Markdown

Datadog Report

Branch report: juli1/K9VULN-1175
Commit report: 6a81f37
Test service: datadog-ci-tests

✅ 0 Failed, 1839 Passed, 0 Skipped, 1m 45.74s Total duration (2m 22.6s time saved)

@Drarig29 Drarig29 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

static-analysis Related to [sarif, sbom]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants