Skip to content

tfsec

tfsec #136

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: tfsec
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: "0 09 * * *"
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@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.0
- name: Create temp directory and copy Terraform files except import.tf
run: |
mkdir temp_dir
find . -name '*.tf' ! -name 'import.tf' -exec cp {} temp_dir \;
- name: Run tfsec on temp directory
uses: aquasecurity/tfsec-sarif-action@21ded20e8ca120cd9d3d6ab04ef746477542a608
with:
working_directory: temp_dir
sarif_file: tfsec.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
# Path to SARIF file relative to the root of the repository
sarif_file: tfsec.sarif