From 490735f18682d03b3e79bb442cd5b5c76ca6304c Mon Sep 17 00:00:00 2001 From: Dmytro Ostapenko <64891962+Dmytro-Ostapenko-97@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:41:28 +0300 Subject: [PATCH] Create tfsec-analysis.yml --- .github/workflows/tfsec-analysis.yml | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/tfsec-analysis.yml diff --git a/.github/workflows/tfsec-analysis.yml b/.github/workflows/tfsec-analysis.yml new file mode 100644 index 0000000..018b918 --- /dev/null +++ b/.github/workflows/tfsec-analysis.yml @@ -0,0 +1,49 @@ +name: tfsec +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + schedule: + - cron: '00 12 * * 6' + +jobs: + tfsec: + name: Run tfsec sarif report + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Clone repo + uses: actions/checkout@v2 + + - uses: hashicorp/setup-terraform@v1 + with: + terraform_version: 0.14.9 + + - name: Terraform fmt + id: fmt + run: terraform fmt -check + continue-on-error: true + + - name: Terraform Init + id: init + run: terraform init + + - name: Terraform Validate + id: validate + run: terraform validate -no-color + + - name: Run tfsec + uses: tfsec/tfsec-sarif-action@9a83b5c3524f825c020e356335855741fd02745f + with: + sarif_file: tfsec.sarif + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v1 + with: + # Path to SARIF file relative to the root of the repository + sarif_file: tfsec.sarif