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

refactor(sbom): use multiline json for spdx-json format #4404

Merged
merged 1 commit into from
May 16, 2023

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented May 16, 2023

Description

golang-tools uses 1 line json format.
I created #213 to add option to use multiline json.
Until these changes are released, we need to use our function for this.

Before:

➜ trivy -q image -f spdx-json alpine 
{"spdxVersion":"SPDX-2.3","dataLicense":"CC0-1.0","SPDXID":"SPDXRef-DOCUMENT","name":"alpine","documentNamespace":"http://aquasecurity.github.io/trivy/container_image/alpine-22e7aac3-d0ec-4836-bd56-015f1bc757e4","creationInfo":{"licenseListVersion" ...

After:

➜ ./trivy -q image -f spdx-json alpine
{
  "spdxVersion": "SPDX-2.3",
  "dataLicense": "CC0-1.0",
  "SPDXID": "SPDXRef-DOCUMENT",
  "name": "alpine",
  "documentNamespace": "http://aquasecurity.github.io/trivy/container_image/alpine-b5575ff7-bb7f-4b9a-9e68-c2f057bbb6f2",
  "creationInfo": {
    "licenseListVersion": "",
    "creators": [
      "Organization: aquasecurity",
      "Tool: trivy-0.36.2-73-g31b19264"
    ],
    "created": "2023-05-16T04:07:09Z"
  },
...

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this May 16, 2023
@DmitriyLewen DmitriyLewen marked this pull request as ready for review May 16, 2023 04:23
@knqyf263 knqyf263 merged commit 7a20d96 into aquasecurity:main May 16, 2023
9 checks passed
@DmitriyLewen DmitriyLewen deleted the fix/miltiline-spdx-json branch May 16, 2023 05:23
john-d8r pushed a commit to deepfactor-io/trivy that referenced this pull request Sep 7, 2023
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.

None yet

2 participants