File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Security Validation
2+
3+ on :
4+ push :
5+ branches : [ master, main ]
6+ pull_request :
7+ branches : [ master, main ]
8+
9+ jobs :
10+ security-checks :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+ with :
17+ fetch-depth : 0
18+
19+ - name : Setup Terraform
20+ uses : hashicorp/setup-terraform@v3
21+ with :
22+ terraform_version : 1.14.3
23+
24+ - name : Trivy IaC Scan (Report All)
25+ uses : aquasecurity/trivy-action@master
26+ with :
27+ scan-type : ' config'
28+ scan-ref : ' .'
29+ exit-code : ' 0'
30+ severity : ' CRITICAL,HIGH,MEDIUM'
31+
32+ - name : Trivy IaC Scan (Fail on Critical)
33+ uses : aquasecurity/trivy-action@master
34+ with :
35+ scan-type : ' config'
36+ scan-ref : ' .'
37+ exit-code : ' 1'
38+ severity : ' CRITICAL'
39+
40+ - name : TruffleHog Scan
41+ uses : trufflesecurity/trufflehog@main
42+ with :
43+ extra_args : --only-verified
Original file line number Diff line number Diff line change @@ -2,12 +2,19 @@ name: Terraform Validation
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [ master, main ]
6+ paths :
7+ - ' **.tf'
8+ - ' **.tfvars'
9+ - ' .github/workflows/terraform.yaml'
10+ pull_request :
11+ branches : [ master, main ]
612 paths :
713 - ' **.tf'
814 - ' **.tfvars'
915 - ' .github/workflows/terraform.yaml'
1016
17+
1118jobs :
1219 terraform-checks :
1320 runs-on : ubuntu-latest
1926 - name : Setup Terraform
2027 uses : hashicorp/setup-terraform@v3
2128 with :
22- terraform_version : 1.12.2
29+ terraform_version : 1.14.3
2330
2431 - name : Terraform Format Check
2532 id : fmt
3138
3239 - name : Terraform Validate
3340 id : validate
34- run : terraform validate -no-color
35-
36- - name : Run tfsec
37- uses : aquasecurity/tfsec-action@v1.0.3
38- with :
39- soft_fail : false
41+ run : terraform validate -no-color
You can’t perform that action at this time.
0 commit comments