generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linting, security scans and docs 🥇 (#1)
* add workflows for linting, resolve several linting issues by removing unuses variables, and pinning provider versions * update Github workflows, tflint, trivy. Update readme * update service data check
- Loading branch information
Showing
10 changed files
with
191 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Terraform Linting | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
tflint: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout source code | ||
|
||
- uses: actions/cache@v4 | ||
name: Cache plugin dir | ||
with: | ||
path: ~/.tflint.d/plugins | ||
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} | ||
|
||
- uses: terraform-linters/setup-tflint@v4 | ||
name: Setup TFLint | ||
with: | ||
tflint_version: v0.52.0 | ||
|
||
- name: Show version | ||
run: tflint --version | ||
|
||
- name: Init TFLint | ||
run: tflint --init | ||
# If rate limiting becomes an issue, setup a GitHub token and enable it as an environment variable | ||
# env: | ||
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting | ||
# GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Run TFLint | ||
run: tflint -f compact |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Terraform Security Scan | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
trivy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run tflint | ||
uses: ghcr.io/terraform-linters/tflint | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' | ||
scan-ref: . | ||
scanners: 'vuln,secret,config' | ||
ignore-unfixed: false | ||
exit-code: '1' | ||
format: 'table' | ||
severity: 'CRITICAL,HIGH' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugin "terraform" { | ||
enabled = true | ||
preset = "recommended" | ||
} | ||
|
||
plugin "aws" { | ||
enabled = true | ||
version = "0.34.0" | ||
source = "github.com/terraform-linters/tflint-ruleset-aws" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.