Skip to content

feat(materials): add tool information #1999

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

Merged
merged 6 commits into from
Apr 24, 2025
Merged

Conversation

jiparis
Copy link
Member

@jiparis jiparis commented Apr 23, 2025

This PR adds tool information (name and version) to generic type materials (SARIF, CDX, SPDX, CSAF). It does a best effort to find the relevant properties.

The values are as annotations with names:

  • chainloop.material.tool-name
  • chainloop.material.tool-version

Examples:

INF push completed
┌───────────────────────────┬─────────────────────────────────────────────────────────────────────────┐
│ Initialized At            │ 23 Apr 25 23:38 UTC                                                     │
├───────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Attestation ID            │ 9d702308-715c-487a-a1c4-907755651776                                    │
│ Digest                    │ sha256:64e2cb8bf877b2ebab9b54c1ca74e944b200f7ee45724d699301d34e9c30de75 │
│ Organization              │ my-org                                                                  │
│ Name                      │ mywf                                                                    │
│ Project                   │ myproject                                                               │
│ Version                   │ v1.0.0-rc.11 (prerelease)                                               │
│ Contract                  │ myproject-mywf (revision 96)                                            │
│ Policy violation strategy │ ADVISORY                                                                │
│ Policies                  │ ------                                                                  │
│                           │ sbom-present: Ok                                                        │
└───────────────────────────┴─────────────────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────────────────────────────┐
│ Materials                                                                             │
├─────────────┬─────────────────────────────────────────────────────────────────────────┤
│ Name        │ material-1745451494244795000                                            │
│ Type        │ SBOM_SPDX_JSON                                                          │
│ Set         │ Yes                                                                     │
│ Required    │ No                                                                      │
│ Value       │ sbom-spdx.json                                                          │
│ Digest      │ sha256:ef1b65cc67a1b49edf7ea11a707f0d0b54218e422ebc94fdcbb68bbc93349094 │
│ Annotations │ ------                                                                  │
│             │ chainloop.material.tool-name: trivy                                     │
│             │ chainloop.material.tool-version: 0.73.0                                 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Name        │ material-1745451502221644000                                            │
│ Type        │ SBOM_CYCLONEDX_JSON                                                     │
│ Set         │ Yes                                                                     │
│ Required    │ No                                                                      │
│ Value       │ cyclonedx.json                                                          │
│ Digest      │ sha256:7502f43a5f4c312006d2cbbbd2d6b555121b7e21cc03ef6d86808db73725d930 │
│ Annotations │ ------                                                                  │
│             │ chainloop.material.tool-name: trivy                                     │
│             │ chainloop.material.tool-version: 0.53.0                                 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Name        │ material-1745451510821127000                                            │
│ Type        │ SARIF                                                                   │
│ Set         │ Yes                                                                     │
│ Required    │ No                                                                      │
│ Value       │ sarif-trivy.json                                                        │
│ Digest      │ sha256:47391cc1eb6186736d9607cfd69e9eaf76af1f1732d1d531bc6229d94be7d9f8 │
│ Annotations │ ------                                                                  │
│             │ chainloop.material.tool-name: Trivy                                     │
│             │ chainloop.material.tool-version: 0.53.0                                 │
├─────────────┼─────────────────────────────────────────────────────────────────────────┤
│ Name        │ material-1745451518173000000                                            │
│ Type        │ CSAF_SECURITY_ADVISORY                                                  │
│ Set         │ Yes                                                                     │
│ Required    │ No                                                                      │
│ Value       │ csaf_security_advisory.json                                             │
│ Digest      │ sha256:f1b3429e94e2e3b470402fa436b89f432d5209c6c8a12164cfccc90ec2637324 │
│ Annotations │ ------                                                                  │
│             │ chainloop.material.tool-name: Red Hat SDEngine                          │
│             │ chainloop.material.tool-version: 3.4.3                                  │
└─────────────┴─────────────────────────────────────────────────────────────────────────┘
> chainloop att status
...
┌────────────────────────────────────────────────────────┐
│ Materials                                              │
├─────────────┬──────────────────────────────────────────┤
│ Name        │ material-1745452676535013000             │
│ Type        │ SARIF                                    │
│ Set         │ Yes                                      │
│ Required    │ No                                       │
│ Annotations │ ------                                   │
│             │ chainloop.material.tool-name: Checkov    │
│             │ chainloop.material.tool-version: 3.2.232 │
├─────────────┼──────────────────────────────────────────┤
│ Name        │ material-1745452684229696000             │
│ Type        │ SARIF                                    │
│ Set         │ Yes                                      │
│ Required    │ No                                       │
│ Annotations │ ------                                   │
│             │ chainloop.material.tool-version: 1.9.4.0 │
│             │ chainloop.material.tool-name: BinSkim    │
└─────────────┴──────────────────────────────────────────┘

Fixes #1997

jiparis added 2 commits April 24, 2025 01:39
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested review from migmartri and javirln April 23, 2025 23:43
jiparis added 2 commits April 24, 2025 01:54
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Copy link
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

awesome

@javirln
Copy link
Member

javirln commented Apr 24, 2025

This is really cool!!

jiparis added 2 commits April 24, 2025 10:43
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis merged commit 711f466 into chainloop-dev:main Apr 24, 2025
13 checks passed
@jiparis jiparis deleted the 1997-vendor branch April 24, 2025 12:51
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.

extract vendor from generic report formats
3 participants