2022-09-20 07:38:37 -04:00
|
|
|
name: Terraform security scanner
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2022-10-18 10:17:41 -04:00
|
|
|
- "release/**"
|
2022-09-20 07:38:37 -04:00
|
|
|
paths:
|
|
|
|
- "**.tf"
|
2023-02-14 14:01:00 -05:00
|
|
|
- ".github/workflows/test-tfsec.yml"
|
2022-09-20 07:38:37 -04:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "**.tf"
|
2023-02-14 14:01:00 -05:00
|
|
|
- ".github/workflows/test-tfsec.yml"
|
2022-09-20 07:38:37 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
tfsec:
|
|
|
|
name: tfsec
|
2022-11-10 10:55:24 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2023-01-30 10:11:27 -05:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: write
|
2022-09-20 07:38:37 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-05 10:17:51 -05:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2022-09-20 07:38:37 -04:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2022-09-20 07:38:37 -04:00
|
|
|
|
|
|
|
- name: tfsec
|
2022-11-04 06:58:54 -04:00
|
|
|
uses: aquasecurity/tfsec-pr-commenter-action@7a44c5dcde5dfab737363e391800629e27b6376b
|
2022-09-20 07:38:37 -04:00
|
|
|
with:
|
2022-10-20 04:34:28 -04:00
|
|
|
soft_fail_commenter: true
|
2022-09-20 07:38:37 -04:00
|
|
|
tfsec_formats: default,text
|
|
|
|
tfsec_args: --force-all-dirs
|
|
|
|
github_token: ${{ github.token }}
|
|
|
|
|
|
|
|
- name: tfsec summary
|
|
|
|
shell: bash
|
2022-11-11 08:49:16 -05:00
|
|
|
run: tail -n 27 results.text >> "$GITHUB_STEP_SUMMARY"
|