-
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.
Browse files
Browse the repository at this point in the history
…ec-to-trivy [#227] Migrate from tfsec to Trivy
- Loading branch information
Showing
20 changed files
with
69 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This project is using Trivy as a vulnerability scanner to replace the role of `tfsec` with some extra benefits: | ||
1. Access to more languages and features in the same tool. | ||
2. Access to more integrations with tools and services through the rich ecosystem around Trivy. | ||
|
||
## Trivy Local Scan | ||
|
||
```bash | ||
# Project root directory | ||
trivy config . | ||
``` | ||
|
||
For more information, please refer to the [Trivy documentation](https://github.com/aquasecurity/trivy) |
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 |
---|---|---|
|
@@ -11,4 +11,3 @@ npm run lint // to check linting | |
|
||
npm run lint:fix // to fix linting | ||
``` | ||
|
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 |
---|---|---|
|
@@ -39,17 +39,12 @@ jobs: | |
- name: Generate project | ||
run: . ./scripts/generateAdvancedAWS.sh | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
- name: Install dependencies from .tool-versions | ||
uses: asdf-vm/actions/install@v2 | ||
|
||
- name: Run Terraform format | ||
run: terraform fmt -recursive -check | ||
|
||
- name: Run tfsec linter | ||
id: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
version: ${{ env.TFSEC_VERSION }} | ||
|
||
- name: Run trivy scanner | ||
working-directory: aws-advanced-test | ||
run: trivy config . |
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 |
---|---|---|
|
@@ -20,3 +20,6 @@ tsconfig.tsbuildinfo | |
|
||
# Emacs | ||
.dir-locals.el | ||
|
||
# Trivy | ||
trivy-output.json |
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
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
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 |
---|---|---|
|
@@ -3,10 +3,6 @@ name: Lint | |
on: | ||
push: | ||
|
||
env: | ||
TERRAFORM_VERSION: "1.5.5" | ||
TFSEC_VERSION: "v1.28.1" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
@@ -25,16 +21,11 @@ jobs: | |
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: ${{ env.TERRAFORM_VERSION }} | ||
- name: Install dependencies from .tool-versions | ||
uses: asdf-vm/actions/install@v2 | ||
|
||
- name: Run Terraform format | ||
run: terraform fmt -recursive -check | ||
|
||
- name: Run tfsec linter | ||
id: tfsec | ||
uses: aquasecurity/[email protected] | ||
with: | ||
version: ${{ env.TFSEC_VERSION }} | ||
- name: Run trivy scanner | ||
run: trivy config . |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
terraform 1.5.5 | ||
tfsec 1.28.1 | ||
trivy 0.47.0 |
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 |
---|---|---|
|
@@ -42,3 +42,6 @@ terraform.rc | |
|
||
# Emacs | ||
.dir-locals.el | ||
|
||
# Trivy | ||
trivy-output.json |
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,23 @@ | ||
timeout: 10m | ||
dependency-tree: true | ||
list-all-pkgs: true | ||
exit-code: 1 | ||
# All severity levels | ||
severity: | ||
- HIGH | ||
- CRITICAL | ||
scan: | ||
skip-dirs: | ||
- .github/ | ||
- core/.terraform/ | ||
- shared/.terraform/ | ||
|
||
scanners: | ||
- vuln | ||
- secret | ||
|
||
vulnerability: | ||
type: | ||
- os | ||
- library | ||
ignore-unfixed: true |