-
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
Added devbox #40
Merged
Added devbox #40
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f8da4a
Added devbox
keyvaann 42801bd
Merge branch 'main' of github.com:phidatalab/RADAR-K8s-Infrastructure…
keyvaann 24e2c91
Merge branch 'main' of github.com:RADAR-base/RADAR-K8s-Infrastructure…
baixiac 29f0dd2
configure and enable trivy and checkov
baixiac 74bb056
Ensure Terraform module sources use a commit hash
keyvaann f0512b5
Skip checkov checks in resource blocks instead of global skip
keyvaann 476e83d
Ask Trivy to report MEDIUM and HIGH issues as well
keyvaann 97e4f4a
resolve issues reported by Trivy
baixiac 3bd276b
add descriptions to the VPC endpoint SG and rules
baixiac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
name: Pre-commit hooks | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install devbox | ||
uses: jetify-com/[email protected] | ||
with: | ||
enable-cache: 'true' | ||
|
||
- name: Run pre-commit on all files | ||
run: devbox run -- pre-commit run --verbose --all-files --show-diff-on-failure |
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,50 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
exclude: | | ||
(?x)^( | ||
config/README.md| | ||
cluster/README.md | ||
)$ | ||
- id: mixed-line-ending | ||
- id: check-yaml | ||
args: | ||
- --allow-multiple-documents | ||
- id: check-added-large-files | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-merge-conflict | ||
- id: no-commit-to-branch | ||
- repo: https://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.96.2 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_validate | ||
- id: terraform_tflint | ||
# - id: terraform_trivy | ||
# args: | ||
# - --args=--severity CRITICAL | ||
# - --args=--skip-dirs="**/.terraform" | ||
# - id: terraform_checkov | ||
# args: | ||
# - --args=--quiet | ||
# - --args=--skip-check CKV_AWS_23,CKV_AWS_355,CKV_AWS_290 # Temporarly skip these checks, Helm chart testing isn't needed for the repo | ||
- repo: local | ||
hooks: | ||
- id: terraform-docs-cluster | ||
name: Generate docs for the Terraform cluster/ | ||
language: system | ||
entry: terraform-docs markdown table cluster/ | ||
pass_filenames: false | ||
files: 'cluster/' | ||
- id: terraform-docs-config | ||
name: Generate docs for the Terraform config/ | ||
language: system | ||
entry: terraform-docs markdown table config/ | ||
pass_filenames: false | ||
files: 'config/' |
This file was deleted.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I saw this was mentioned to be enabled in the next step. Can you consider including this in the same PR?
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.
Enabling this will return around 30 errors that should be fixed, some of them are easy to fix, the others I can't fix them and I'd need your help for them.
This PR is already rather big, it will be much bigger if we want to fix everything in on PR.
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.
Excluding #37 and #38, here is the list of issues that checkov finds:
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.
Alright. Will have a look and see if I can contribute, thinking 30 doesn't sound extremely large to me and maybe some of them can also be safely ignored (e.g., the rules about S3 are definitely not mandatory and should be applied case by case).
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.
Indeed, some of them can be skipped.
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.
Just tailored the checking rules. Both trivy and checkov are now enabled and PTAL.