Skip to content

Commit b148e27

Browse files
authored
Merge pull request #1 from ej-east/feat/github_actions
feat:Updated GitHub Actions to be better
2 parents d17e914 + 42fb327 commit b148e27

2 files changed

Lines changed: 53 additions & 8 deletions

File tree

.github/workflows/security.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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

.github/workflows/terraform.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ name: Terraform Validation
22

33
on:
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+
1118
jobs:
1219
terraform-checks:
1320
runs-on: ubuntu-latest
@@ -19,7 +26,7 @@ jobs:
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
@@ -31,9 +38,4 @@ jobs:
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

0 commit comments

Comments
 (0)