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