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

[bug] Add Properties to cyclonedx.Vulnerability #38

Closed
desenna opened this issue May 18, 2022 · 0 comments · Fixed by #39
Closed

[bug] Add Properties to cyclonedx.Vulnerability #38

desenna opened this issue May 18, 2022 · 0 comments · Fixed by #39
Labels
bug Something isn't working
Milestone

Comments

@desenna
Copy link
Contributor

desenna commented May 18, 2022

Problem

This lib does not fully comply with the CycloneDX v1.4 schema.

Screen Shot 2022-05-19 at 8 50 42 AM

The CycloneDX v1.4 schema defines "Properties" property in Vulnerability:
https://github.com/CycloneDX/specification/blob/1.4/schema/bom-1.4.schema.json#L1659-L1667
https://cyclonedx.org/docs/1.4/json/#vulnerabilities_items_properties

But the cyclonedx-go library has not yet been updated to support this:
https://github.com/CycloneDX/cyclonedx-go/blob/master/cyclonedx.go#L611-L629

Expected Behavior

Given:
var vuln cyclonedx.Vulnerability

Expect:
vuln.Properties is accessible for getting or setting

Actual Behavior / Steps to Reproduce

This snippet results in compiler error "vuln.Properties undefined (type cyclonedx.Vulnerability has no field or method Properties)":

func test() {
	var vuln cyclonedx.Vulnerability
	fmt.Println("len Affects:", len(*vuln.Affects))		// no compiler error
	fmt.Println("len Properties:", len(*vuln.Properties))	// compiler error!
}

Additional Information

  1. the version you are using => github.com/CycloneDX/cyclonedx-go v0.5.2
  2. your operating system and version => macOS Big Sur version 11.6.1
  3. reproducible steps (1 2 3...) that cause the issue including any required files => see above
  4. what you expected, versus what happened => see above
  5. any relevant screenshots and other outputs => see above
@desenna desenna changed the title fix: add Properties to Vulnerability type [bug] Add Properties to cyclonedx.Vulnerability May 19, 2022
@nscuro nscuro added the bug Something isn't working label May 19, 2022
@nscuro nscuro added this to the v0.6.0 milestone May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants