Skip to content

Commit 9ed42f8

Browse files
committed
fix(ort-scan): Run Evaluator after Advisor
Policy rules for security vulnerabilities do not work as expected prior to this change as the Evaluator is executed before the Advisor e.g. rules are checked before known vulnerabilities for packages are retrieved. Signed-off-by: Thomas Steenbergen <[email protected]>
1 parent fc8a5ea commit 9ed42f8

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

templates/ort-scan.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -355,31 +355,6 @@
355355
[[ ${ORT_CLI_SCANNER_EXIT_CODE} -eq 1 ]] && exit 1
356356
fi
357357
358-
# Run ORT's Evaluator to evaluate custom policy rules along with custom license classifications against the data gathered
359-
# in preceding ORT stages and returns a list of policy violations (e.g. flags license or vulnerability findings).
360-
- |
361-
if [[ ${ORT_RUN_COMMANDS} == *"evaluator"* ]]; then
362-
echo -e "\e[1;33m Running ORT Evaluator... "
363-
364-
${ORT_CLI} \
365-
--${ORT_LOG_LEVEL} \
366-
${ORT_CLI_ARGS} \
367-
evaluate \
368-
-i ${ORT_RESULTS_CURRENT_PATH} \
369-
-o ${ORT_RESULTS_PATH} \
370-
-f JSON \
371-
${ORT_CLI_EVALUATE_ARGS} \
372-
|| ORT_CLI_EVALUATE_EXIT_CODE=$? \
373-
&& export ORT_CLI_EVALUATE_EXIT_CODE="${ORT_CLI_EVALUATE_EXIT_CODE:-0}" \
374-
&& printenv >> vars.env
375-
376-
[[ -f ${ORT_RESULTS_EVALUATOR_PATH} ]] \
377-
&& ln -frs $ORT_RESULTS_EVALUATOR_PATH $ORT_RESULTS_CURRENT_PATH \
378-
|| echo -e "\e[1;31m File $ORT_RESULTS_EVALUATOR_PATH not found."
379-
380-
[[ ${ORT_CLI_EVALUATE_EXIT_CODE} -eq 1 ]] && exit 1
381-
fi
382-
383358
# Run ORT's Advisor to retrieve security advisories for used dependencies from configured vulnerability data services.
384359
- |
385360
if [[ ${ORT_RUN_COMMANDS} == *"advisor"* ]]; then
@@ -405,6 +380,31 @@
405380
[[ ${ORT_CLI_ADVISE_EXIT_CODE} -eq 1 ]] && exit 1
406381
fi
407382
383+
# Run ORT's Evaluator to evaluate custom policy rules along with custom license classifications against the data gathered
384+
# in preceding ORT stages and returns a list of policy violations (e.g. flags license or vulnerability findings).
385+
- |
386+
if [[ ${ORT_RUN_COMMANDS} == *"evaluator"* ]]; then
387+
echo -e "\e[1;33m Running ORT Evaluator... "
388+
389+
${ORT_CLI} \
390+
--${ORT_LOG_LEVEL} \
391+
${ORT_CLI_ARGS} \
392+
evaluate \
393+
-i ${ORT_RESULTS_CURRENT_PATH} \
394+
-o ${ORT_RESULTS_PATH} \
395+
-f JSON \
396+
${ORT_CLI_EVALUATE_ARGS} \
397+
|| ORT_CLI_EVALUATE_EXIT_CODE=$? \
398+
&& export ORT_CLI_EVALUATE_EXIT_CODE="${ORT_CLI_EVALUATE_EXIT_CODE:-0}" \
399+
&& printenv >> vars.env
400+
401+
[[ -f ${ORT_RESULTS_EVALUATOR_PATH} ]] \
402+
&& ln -frs $ORT_RESULTS_EVALUATOR_PATH $ORT_RESULTS_CURRENT_PATH \
403+
|| echo -e "\e[1;31m File $ORT_RESULTS_EVALUATOR_PATH not found."
404+
405+
[[ ${ORT_CLI_EVALUATE_EXIT_CODE} -eq 1 ]] && exit 1
406+
fi
407+
408408
# Run ORT's Reporter to present scan results in various formats such as visual reports,
409409
# Open Source notices or Software Bill-Of-Materials (SBOMs).
410410
- |

0 commit comments

Comments
 (0)