Workflow updated #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SAST | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
scan-config: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner in IaC mode | |
uses: aquasecurity/[email protected] | |
with: | |
scan-type: 'config' | |
format: 'table' | |
hide-progress: true | |
output: 'trivy-config.txt' | |
- name: Publish Trivy Output to Summary | |
run: | | |
if [[ -s trivy-config.txt ]]; then | |
{ | |
echo "### Configuration scan" | |
echo "<details><summary>Click to expand</summary>" | |
echo "" | |
echo '```terraform' | |
cat trivy-config.txt | |
echo '```' | |
echo "</details>" | |
} >> $GITHUB_STEP_SUMMARY | |
fi | |
scan-fs: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner in IaC mode | |
uses: aquasecurity/[email protected] | |
with: | |
scan-type: 'fs' | |
format: 'table' | |
ignore-unfixed: true | |
output: 'trivy-fs.txt' | |
severity: 'LOW' | |
- name: Publish Trivy Output to Summary | |
run: | | |
if [[ -s trivy-fs.txt ]]; then | |
{ | |
echo "### FS scan" | |
echo "<details><summary>Click to expand</summary>" | |
echo "" | |
echo '```terraform' | |
cat trivy-fs.txt | |
echo '```' | |
echo "</details>" | |
} >> $GITHUB_STEP_SUMMARY | |
fi |