forked from moritzzimmer/terraform-aws-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.05 KB
/
static-analysis.yaml
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
name: static analysis
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
pull-requests: write
jobs:
fmt:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: [ 1.5.6, ~ 1.8 ]
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
- run: make fmt
validate:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: [ 1.5.6, ~ 1.8 ]
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
- run: make validate
tflint:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: [ 1.5.6, ~ 1.8 ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.tflint.d/plugins
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ matrix.terraform }}
- uses: terraform-linters/setup-tflint@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- run: make tflint
trivy:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: [ 1.5.6, ~ 1.8 ]
steps:
- uses: actions/checkout@v4
- name: config
run: |
cat >> ./trivy.yaml << EOF
# see https://aquasecurity.github.io/trivy/latest/docs/references/configuration/config-file/ for reference
exit-code: 1
exit-on-eol: 1
misconfiguration:
terraform:
exclude-downloaded-modules: true
severity:
- HIGH
- CRITICAL
scan:
skip-dirs:
- "**/.terraform/**/*"
EOF
cat ./trivy.yaml
- uses: aquasecurity/[email protected]
with:
scan-type: 'config'
hide-progress: false
trivy-config: trivy.yaml