Skip to content

Commit 8178a1d

Browse files
committed
chore: address PR feedback
Signed-off-by: Ben Selwyn-Smith <[email protected]>
1 parent 9718aa7 commit 8178a1d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/source/pages/tutorials/npm_provenance.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ During this analysis, Macaron will retrieve two provenance files from the npm re
5252

5353
.. note:: Most of the details from the two provenance files can be found through the links provided on the artifacts page on the npm website. In particular: `Sigstore Rekor <https://search.sigstore.dev/?logIndex=92391688>`_. The provenance file itself can be found at: `npm registry <https://registry.npmjs.org/-/npm/v1/attestations/[email protected]>`_.
5454

55-
Of course to reliably say the above does what is claimed here, proof is needed. For this we can rely on the check results produced from the analysis run. In particular, we want to know the results of three checks: ``mcn_provenance_derived_repo_1``, ``mcn_provenance_derived_commit_1``, and ``mcn_provenance_verified_1``. The first two to ensure that the commit and the repository being analyzed match those found in the provenance file, and the last check to ensure that the provenance file has been verified. In order for the third of these three checks to succeed, we must tell Macaron to perform provenance verification via the ``--verify provenance`` command line argument, as shown above. This is disable by default as it can be quite time consuming in some cases.
55+
Of course to reliably say the above does what is claimed here, proof is needed. For this we can rely on the check results produced from the analysis run. In particular, we want to know the results of three checks: ``mcn_provenance_derived_repo_1``, ``mcn_provenance_derived_commit_1``, and ``mcn_provenance_verified_1``. The first two to ensure that the commit and the repository being analyzed match those found in the provenance file, and the last check to ensure that the provenance file has been verified. For the third check to succeed, you need to enable provenance verification in Macaron by using the ``--verify-provenance`` command-line argument, as demonstrated above. This verification is disabled by default because it can be slow in some cases due to I/O-bound operations.
5656

5757
.. _fig_semver_7.6.2_report:
5858

src/macaron/provenance/provenance_verifier.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from macaron.config.defaults import defaults
1818
from macaron.config.global_config import global_config
19-
from macaron.provenance.provenance_extractor import ProvenancePredicate
19+
from macaron.provenance.provenance_extractor import ProvenancePredicate, SLSAGithubGenericBuildDefinitionV01
2020
from macaron.repo_finder.commit_finder import AbstractPurlType, determine_abstract_purl_type
2121
from macaron.slsa_analyzer.analyze_context import AnalyzeContext
2222
from macaron.slsa_analyzer.asset import AssetLocator
@@ -386,7 +386,7 @@ def determine_provenance_slsa_level(
386386
if predicate:
387387
build_type = ProvenancePredicate.get_build_type(provenance_payload.statement)
388388

389-
if build_type == "https://github.com/slsa-framework/slsa-github-generator/generic@v1" and verified_l3:
389+
if build_type in {SLSAGithubGenericBuildDefinitionV01.expected_build_type} and verified_l3:
390390
# 3. Provenance is created by the SLSA GitHub generator and verified.
391391
return 3
392392

0 commit comments

Comments
 (0)