-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#227] Migrate from tfsec to Trivy #262
Changes from 14 commits
b6afa40
b31bf5d
a02367a
38bd0a8
43017f4
763e92a
c8d7443
7253ad7
73512ba
a8b35ca
8136fd3
a937ab2
f81c0dc
01f80b7
a518570
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
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) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,3 +15,4 @@ | |||||
- [[Testing]] | ||||||
- [[Modify the Infrastructure Diagram | Modify infra diagram]] | ||||||
- [[Publishing]] | ||||||
- [[Trivy Local Running]] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or |
Nihisil marked this conversation as resolved.
Show resolved
Hide resolved
|
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 in .tool-versions | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(we don't install the dependencies in the |
||||||
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 linter | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
According to the doc, Trivy is more referred to as a scanner, rather than a linter 💭 |
||||||
working-directory: aws-advanced-test | ||||||
run: trivy config . |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ tsconfig.tsbuildinfo | |
|
||
# Emacs | ||
.dir-locals.el | ||
|
||
# Trivy | ||
trivy-output.json |
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 in .tool-versions | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
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 linter | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update them all in a518570 |
||||||
run: trivy config . |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,6 @@ terraform.rc | |
|
||
# Emacs | ||
.dir-locals.el | ||
|
||
# Trivy | ||
trivy-output.json |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor markdown lint suggestion