imagescan_action
This commit is contained in:
@@ -16,31 +16,10 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
release-image:
|
release-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container: aquasec/trivy:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Scan image with trivy
|
- name: Scan image with trivy
|
||||||
uses: aquasecurity/trivy-action@0.33.1
|
|
||||||
with:
|
|
||||||
image-ref: "${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }}"
|
|
||||||
scan-type: image
|
|
||||||
hide-progress: false
|
|
||||||
ignore-unfixed: true
|
|
||||||
severity: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL"
|
|
||||||
scanners: "vuln,misconfig,secrets"
|
|
||||||
output: trivy.txt
|
|
||||||
env:
|
|
||||||
TRIVY_USERNAME: "${{ env.user }}"
|
|
||||||
TRIVY_PASSWORD: "${{ secrets.DOCKER_PULL_TOKEN }}"
|
|
||||||
- name: Publish Trivy Output to Summary
|
|
||||||
run: |
|
run: |
|
||||||
if [[ -s trivy.txt ]]; then
|
trivy image --username ${{ env.user }} --password ${{ secrets.DOCKER_PULL_TOKEN }} --exit-code 1 \
|
||||||
{
|
--scanners vuln,misconfig,secret \
|
||||||
echo "### Security Output"
|
${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }}
|
||||||
echo "<details><summary>Click to expand</summary>"
|
|
||||||
echo ""
|
|
||||||
echo '```terraform'
|
|
||||||
cat trivy.txt
|
|
||||||
echo '```'
|
|
||||||
echo "</details>"
|
|
||||||
} >> $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user