|
1 | | -name: CI Security Scan |
2 | | -permissions: |
3 | | - contents: read |
| 1 | +name: CI |
4 | 2 |
|
5 | 3 | on: |
6 | 4 | push: |
7 | | - branches: |
8 | | - - main |
9 | 5 | pull_request: |
10 | | - branches: |
11 | | - - main |
| 6 | + branches: ["main"] |
| 7 | + |
| 8 | +env: |
| 9 | + TERRAFORM_VERSION: "1.13.5" # terraform version |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
12 | 13 |
|
13 | 14 | jobs: |
14 | | - security-scan: |
| 15 | + tf-fmt: |
| 16 | + name: Terraform fmt |
15 | 17 | runs-on: ubuntu-latest |
16 | 18 | steps: |
17 | | - - name: Checkout code |
18 | | - uses: actions/checkout@v6.0.2 |
19 | | - |
20 | | - |
21 | | - - name: Run Checkov |
22 | | - uses: bridgecrewio/checkov-action@v12 |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 21 | + - name: Setup Terraform |
| 22 | + uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0 |
| 23 | + with: |
| 24 | + terraform_version: ${{ env.TERRAFORM_VERSION }} |
| 25 | + - name: Run terraform fmt |
| 26 | + run: terraform fmt -recursive -check -diff |
| 27 | + # TEMPORARILY DISABLED DUE TO SECURITY INCIDENT |
| 28 | + # trivy: |
| 29 | + # name: trivy |
| 30 | + # runs-on: ubuntu-latest |
| 31 | + # steps: |
| 32 | + # - name: Checkout repository |
| 33 | + # uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 34 | + # - name: Trivy scan |
| 35 | + # uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0 |
| 36 | + # with: |
| 37 | + # scan-type: fs |
| 38 | + # scan-ref: . |
| 39 | + # trivy-config: configs/trivy.yaml |
| 40 | + checkov: |
| 41 | + name: Checkov |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - name: Checkout repository |
| 45 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 46 | + - name: Checkov scan |
| 47 | + uses: bridgecrewio/checkov-action@2fd3901c8feb52417f27f0d9800259a106c1ec1e # v12 |
23 | 48 | with: |
24 | 49 | directory: . |
25 | 50 | config_file: configs/checkov.yml |
26 | 51 |
|
27 | | - - name: Run Trivy on repo |
28 | | - uses: aquasecurity/trivy-action@0.35.0 |
29 | | - with: |
30 | | - scan-type: fs |
31 | | - path: . |
32 | | - trivy-config: configs/trivy.yaml |
| 52 | + tflint: |
| 53 | + name: TFLint |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - name: Checkout repository |
| 57 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 58 | + - name: TFLint scan |
| 59 | + uses: terraform-linters/setup-tflint@b480b8fcdaa6f2c577f8e4fa799e89e756bb7c93 # v6.2.2 |
| 60 | + - name: Run TFLint |
| 61 | + run: tflint --config=configs/.tflint.hcl |
0 commit comments