@@ -79,37 +79,35 @@ def run_check(self, ctx: AnalyzeContext) -> CheckResultData:
79
79
if predicate :
80
80
build_type = json_extract (predicate , ["buildType" ], str )
81
81
82
- if build_type and build_type == "https://github.com/slsa-framework/slsa-github-generator/generic@v1" :
83
- # Provenance is created by the SLSA GitHub generator and therefore verified.
82
+ if not ctx . dynamic_data [ "provenance_verified" ] :
83
+ # Provenance is not verified.
84
84
return CheckResultData (
85
85
result_tables = [
86
- ProvenanceVerifiedFacts (build_level = 3 , build_type = build_type , confidence = Confidence .HIGH )
86
+ ProvenanceVerifiedFacts (
87
+ build_level = 1 ,
88
+ build_type = build_type ,
89
+ confidence = Confidence .HIGH ,
90
+ )
87
91
],
88
- result_type = CheckResultType .PASSED ,
92
+ result_type = CheckResultType .FAILED ,
89
93
)
90
94
91
- if not ctx . dynamic_data [ "provenance_verified" ] :
92
- # Provenance is not verified.
95
+ if not ( build_type and build_type == "https://github.com/slsa-framework/slsa-github-generator/generic@v1" ) :
96
+ # Provenance is verified.
93
97
return CheckResultData (
94
98
result_tables = [
95
99
ProvenanceVerifiedFacts (
96
- build_level = 1 ,
100
+ build_level = 2 ,
97
101
build_type = build_type ,
98
102
confidence = Confidence .HIGH ,
99
103
)
100
104
],
101
- result_type = CheckResultType .FAILED ,
105
+ result_type = CheckResultType .PASSED ,
102
106
)
103
107
104
- # Provenance is verified.
108
+ # Provenance is created by the SLSA GitHub generator and verified.
105
109
return CheckResultData (
106
- result_tables = [
107
- ProvenanceVerifiedFacts (
108
- build_level = 2 ,
109
- build_type = build_type ,
110
- confidence = Confidence .HIGH ,
111
- )
112
- ],
110
+ result_tables = [ProvenanceVerifiedFacts (build_level = 3 , build_type = build_type , confidence = Confidence .HIGH )],
113
111
result_type = CheckResultType .PASSED ,
114
112
)
115
113
0 commit comments