feat(crafter): support multiple tools in chainloop metadata#2481
Merged
migmartri merged 6 commits intochainloop-dev:mainfrom Oct 27, 2025
Merged
feat(crafter): support multiple tools in chainloop metadata#2481migmartri merged 6 commits intochainloop-dev:mainfrom
migmartri merged 6 commits intochainloop-dev:mainfrom
Conversation
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
Member
|
I am not a fan of keys with dynamic namespacing, it makes it very hard to consume, but @jiparis might have a different opinion. I'd rather to have smth like |
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
migmartri
reviewed
Oct 27, 2025
| m.Annotations[AnnotationToolNameKey] = meta.Tools[0].Name | ||
| m.Annotations[AnnotationToolVersionKey] = meta.Tools[0].Version | ||
| // Extract all tools and set annotations | ||
| var tools []Tool |
Member
There was a problem hiding this comment.
so even if we have one tool, it will use also the new annotation correct?
Collaborator
Author
There was a problem hiding this comment.
Correct, example:
WRN API contacted in insecure mode
INF uploading sbom.cyclonedx-1.5.json - sha256:5ca3508f02893b0419b266927f66c7b9dd8b11dbea7faf7cdb9169df8f69d8e3
INF material added to attestation
┌─────────────┬─────────────────────────────────────────────────────────────────────────┐
│ Name │ skynet-sbom │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Type │ SBOM_CYCLONEDX_JSON │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Required │ No │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Value │ sbom.cyclonedx-1.5.json │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Digest │ sha256:5ca3508f02893b0419b266927f66c7b9dd8b11dbea7faf7cdb9169df8f69d8e3 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Annotations │ ------ │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ │ chainloop.material.tools: ["syft@0.101.1"] │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ │ chainloop.material.tool.name: syft │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ │ chainloop.material.tool.version: 0.101.1 │
└─────────────┴─────────────────────────────────────────────────────────────────────────┘
Member
There was a problem hiding this comment.
should we hide the deprecated method from the output?
Collaborator
Author
There was a problem hiding this comment.
Updated, hidden from att add and att status
# add
┌─────────────┬─────────────────────────────────────────────────────────────────────────┐
│ Name │ skynet-sbom │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Type │ SBOM_CYCLONEDX_JSON │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Required │ No │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Value │ sbom.cyclonedx-1.5.json │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Digest │ sha256:5ca3508f02893b0419b266927f66c7b9dd8b11dbea7faf7cdb9169df8f69d8e3 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Annotations │ ------ │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ │ chainloop.material.tools: ["syft@0.101.1"] │
└─────────────┴─────────────────────────────────────────────────────────────────────────┘
# status
┌───────────────────────────┬──────────────────────────────────────┐
│ Initialized At │ 27 Oct 25 13:42 UTC │
├───────────────────────────┼──────────────────────────────────────┤
│ Attestation ID │ a3d4ffcc-68f5-4d2e-b3b0-b96cf65922a4 │
│ Organization │ myorg │
│ Name │ policyatttest │
│ Project │ myproject │
│ Version │ v1.49.0 (prerelease) │
│ Contract │ contractinvpoll (revision 1) │
│ Policy violation strategy │ ADVISORY │
└───────────────────────────┴──────────────────────────────────────┘
┌──────────────────────────────────────────────────────────┐
│ Materials │
├─────────────┬────────────────────────────────────────────┤
│ Name │ skynet-sbom │
│ Type │ SBOM_CYCLONEDX_JSON │
│ Set │ Yes │
│ Required │ No │
│ Annotations │ ------ │
│ │ chainloop.material.tools: ["syft@0.101.1"] │
└─────────────┴────────────────────────────────────────────┘
migmartri
approved these changes
Oct 27, 2025
| wantDigest: "sha256:fe2636fb6c698a29a315278b762b2000efd5959afe776ee4f79f1ed523365a33", | ||
| wantFilename: "sbom-spdx.json", | ||
| annotations: map[string]string{ | ||
| "chainloop.material.tool.name": "syft", |
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for multiple tools extraction to metadata, while maintaining backwards compatibility.
Example