我想知道是否有可能从一次逃逸扫描中得到风险分数输出?我知道我们可以在github操作的命令中使用参数"-t 25“,但是如果风险评分高于阈值,我希望使用警告或者返回退出错误。
这里是我想要的东西的快速概述:
jobs:
warning_message:
runs-on: ubuntu-latest
#code for getting the risk-score output
steps:
- name: check_comparaison_risk-score
if: ${{ risk_output }} > 25
run: echo "::warning ::Risk-score is above 25%"你可以提出另一种解决方案/替代方案。
发布于 2022-11-21 15:33:35
您应该使用GitHub的官方行动,并添加failedThreshold,如输入部分所示:
name: Kubescape scanning for misconfigurations
on: [push, pull_request]
jobs:
kubescape:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: kubescape/github-action@main
with:
format: sarif
outputFile: results.sarif
# # Optional: Specify the Kubescape cloud account ID
# account: ${{secrets.KUBESCAPE_ACCOUNT}}
# Fail when the risk-score is higher than X
failedThreshold: 25
- name: Upload Kubescape scan results to Github Code Scanning
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarifhttps://stackoverflow.com/questions/72256214
复制相似问题