@@ -203,7 +203,7 @@ spec:
203203 - name : VSA_UPLOAD
204204 type : string
205205 description : VSA upload destination
206- default : " local@/var/workdir/vsa"
206+ default : " local@/var/workdir/conforma/ vsa"
207207
208208 - name : ociStorage
209209 type : string
@@ -322,22 +322,44 @@ spec:
322322 if [[ "$(params.ENABLE_VSA)" == "true" ]]; then
323323 EC_ARGS+=(--vsa --attestation-format=$(params.ATTESTATION_FORMAT))
324324
325+ # Extract local path from VSA_UPLOAD for output directory
326+ # VSA_UPLOAD format is "local@/path/to/dir"
327+ VSA_LOCAL_PATH=$(echo "$(params.VSA_UPLOAD)" | grep -oE '^local@[^ ]+' | sed 's/^local@//' | head -n1 || true)
328+
325329 if [[ "$(params.ATTESTATION_FORMAT)" == "dsse" ]]; then
326330 if [[ -z "$(params.VSA_SIGNING_KEY)" ]]; then
327331 echo "ERROR: VSA_SIGNING_KEY required for format=dsse" >&2
328332 exit 1
329333 fi
330334 EC_ARGS+=(--vsa-signing-key "$(params.VSA_SIGNING_KEY)")
335+ EC_ARGS+=(--vsa-upload "$(params.VSA_UPLOAD)")
331336 fi
332337
333- EC_ARGS+=(--vsa-upload "$(params.VSA_UPLOAD)")
334- echo "true" > $(results.VSA_GENERATED.path)
338+ # ec requires --attestation-output-dir to be under /tmp or cwd.
339+ # Write there first, then copy to the workdir so
340+ # create-trusted-artifact includes them in the archive.
341+ VSA_TMP_DIR="/tmp/vsa-output"
342+ mkdir -p "$VSA_TMP_DIR"
343+ EC_ARGS+=(--attestation-output-dir "$VSA_TMP_DIR")
344+
345+ echo -n "true" > $(results.VSA_GENERATED.path)
335346 else
336- echo "false" > $(results.VSA_GENERATED.path)
347+ echo -n "false" > $(results.VSA_GENERATED.path)
337348 fi
338349
339350 # Execute EC with constructed arguments
340351 ec "${EC_ARGS[@]}"
352+
353+ # Copy VSA output from /tmp to workdir for trusted artifact archival
354+ if [[ "$(params.ENABLE_VSA)" == "true" ]]; then
355+ VSA_LOCAL_PATH=$(echo "$(params.VSA_UPLOAD)" | grep -oE '^local@[^ ]+' | sed 's/^local@//' | head -n1 || true)
356+ if [[ -n "$VSA_LOCAL_PATH" && -d "/tmp/vsa-output" ]]; then
357+ mkdir -p "$VSA_LOCAL_PATH"
358+ cp -r /tmp/vsa-output/* "$VSA_LOCAL_PATH"/ 2>/dev/null || true
359+ # Include raw JSON report for downstream SLSA VSA generation
360+ cp "$(params.HOMEDIR)/report-json.json" "$VSA_LOCAL_PATH"/ 2>/dev/null || true
361+ fi
362+ fi
341363 env :
342364 # POLICY_CONFIGURATION is passed via environment variable to safely handle JSON strings
343365 # This avoids shell quoting issues when Tekton substitutes parameter values directly in scripts
@@ -449,7 +471,9 @@ spec:
449471 - name : ociStorage
450472 value : $(params.ociStorage)
451473 - name : workDir
452- value : /var/workdir
474+ value : $(params.TRUSTED_ARTIFACTS_EXTRACT_DIR)
475+ - name : sourceDataArtifact
476+ value : $(results.sourceDataArtifact.path)
453477
454478 volumes :
455479 - name : trusted-ca
0 commit comments