-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (75 loc) · 2.01 KB
/
terraform_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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
name: Terraform Checks
on:
push:
pull_request:
schedule:
- cron: "0 5 * * 0"
workflow_dispatch:
jobs:
terraform_lint:
name: Terraform Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Terraform version
run: terraform version
- name: Terraform fmt
run: terraform fmt -check
- name: Terraform init
run: terraform init -backend=false -input=false
# Commenting this out because of this issue https://github.com/hashicorp/terraform/issues/28490
# - name: Terraform validate
# run: terraform validate
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
with:
github_token: ${{ secrets.TOKEN }}
- name: TFLint version
run: tflint --version
- name: TFLint init
run: tflint --init
- name: TFLint validate
run: tflint
terrascan:
name: Terrascan
needs: terraform_lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v4
- name: Run Terrascan
uses: tenable/terrascan-action@main
with:
iac_type: 'terraform'
iac_dir: .
config_path: .terrascan.toml
non_recursive: true
verbose: true
kics:
name: KICS
needs: terraform_lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v4
- name: Run KICS
uses: Checkmarx/[email protected]
with:
path: .
config_path: .kics.yml
tfsec:
name: tfsec
needs: terraform_lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v4
- name: tfsec
uses: aquasecurity/[email protected]
with:
working_directory: .
additional_args: --config-file .tfsec.yml