-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (40 loc) · 1.31 KB
/
IaC_Sec_checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: IaC Sec checks performed with Checkov
permissions: read-all
on:
pull_request:
types: [opened, reopened]
push:
branches:
- 'final-assessment'
paths:
- 'src/final-assessment/**'
jobs:
IaC_Sec_Checkov_Scan:
permissions: read-all
name: 'Checkov IaC Sec Scan'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Check if pull request is opened/reopened
id: pr_status
uses: octokit/[email protected]
with:
route: GET /repos/RunCor399/Terraform-IaCSec/pulls/${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkov GitHub Action
uses: bridgecrewio/checkov-action@v12
if: ${{ steps.pr_status.outputs.data.state == 'open' || steps.pr_status.outputs.data.state == 'reopened' }}
with:
output_format: cli,sarif
output_file_path: console,results.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
if: success() || failure()
with:
sarif_file: results.sarif
ref: ${{ github.head_ref }}
sha: ${{ github.sha }}