Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

include image labels in cycloneDX SBOM #2294

Merged
merged 10 commits into from
Nov 8, 2023
Merged

Conversation

noqcks
Copy link
Contributor

@noqcks noqcks commented Nov 6, 2023

This PR adds a metadata.properties field with information about image labels to cycloneDX SBOMs

resolves #2267

image

Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Benji Visser <benji@093b.org>
@wagoodman wagoodman self-assigned this Nov 8, 2023
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
wagoodman previously approved these changes Nov 8, 2023
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

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

nice add 🙌 I only added an extra test case

@wagoodman wagoodman dismissed their stale review November 8, 2023 22:52

I'm going to make one more change: remove the need to update the snapshot test (since that updates a binary in the repo)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

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

I made one more update to remove the change to the snapshot tests since they updated the golden bin that is captured in the repo. Changing this isn't a bad thing, but it seemed unnecessary since it could be captured in a lower level unit test (which I just added). Snapshot tests are great for change detection with how the component is wired together, and less about correctness of values in different circumstances.

@wagoodman wagoodman enabled auto-merge (squash) November 8, 2023 23:04
@wagoodman wagoodman merged commit 0891d35 into anchore:main Nov 8, 2023
10 checks passed
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
* include image labels in SBOM

Signed-off-by: Benji Visser <benji@093b.org>

* update tests

Signed-off-by: Benji Visser <benji@093b.org>

* gocritic

Signed-off-by: Benji Visser <benji@093b.org>

* add properties

Signed-off-by: Benji Visser <benji@093b.org>

* add decoder

Signed-off-by: Benji Visser <benji@093b.org>

* update golden snapshots

Signed-off-by: Benji Visser <benji@093b.org>

* decodeProperties

Signed-off-by: Benji Visser <benji@093b.org>

* add test

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove the snapshot test changes

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* restore snapshots

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Benji Visser <benji@093b.org>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

store image annotations inside the SBOM
2 participants