Skip to content

Commit 655fa4f

Browse files
add checkov
1 parent 8d78786 commit 655fa4f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/terraform.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,33 @@ jobs:
8585
- name: Run TFLint
8686
run: tflint -f compact --recursive --minimum-failure-severity=error
8787

88+
scan:
89+
permissions:
90+
contents: read # for actions/checkout to fetch code
91+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
92+
runs-on: ubuntu-latest
93+
name: "checkov"
94+
steps:
95+
- uses: actions/checkout@v3
96+
97+
- name: Checkov GitHub Action
98+
uses: bridgecrewio/checkov-action@v12
99+
with:
100+
# This will add both a CLI output to the console and create a results.sarif file
101+
output_format: cli,sarif
102+
output_file_path: console,results.sarif
103+
104+
- name: Upload SARIF file
105+
uses: github/codeql-action/upload-sarif@v2
106+
# Results are generated only on a success or failure
107+
# this is required since GitHub by default won't run the next step
108+
# when the previous one has failed. Security checks that do not pass will 'fail'.
109+
# An alternative is to add `continue-on-error: true` to the previous step
110+
# Or 'soft_fail: true' to checkov.
111+
if: success() || failure()
112+
with:
113+
sarif_file: results.sarif
114+
88115
terraform:
89116
name: "Terraform"
90117
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)