-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding Trivy scan to the GitHub repo * Testing the added action * Testing Trivy-Scan * testing trivy action * Testing Trivy scan * Testing Trivy * testing trivy * Testing Trivy * Testing Trivy * Testing Trivy * Testing Trivy * Final Trivy test * Final Trivy Test 2 * Creating a Lint Action * Testint Lint * Testing lint * testint lint * added all folders to lint test * test new scope for lint * Added CI Tests --------- Co-authored-by: Victor Saad Bueno Valadares <Victor.Valadares@microsoft.com>
- Loading branch information
Showing
2 changed files
with
171 additions
and
0 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,143 @@ | ||
--- | ||
name: Code Review | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
super-linter: | ||
name: GitHub Super Linter | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Lint AVS-Landing-Zone directory | ||
uses: docker://github/super-linter:v4.9.5 | ||
env: | ||
# Only lint changed files | ||
VALIDATE_ALL_CODEBASE: true | ||
# Need to define main branch as default | ||
# is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter | ||
# run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Only the following files will be linted: | ||
FILTER_REGEX_INCLUDE: .*AVS-Landing-Zone\/.* | ||
# The following linter types will be enabled: | ||
VALIDATE_ARM: true | ||
VALIDATE_JSON: true | ||
VALIDATE_TERRAFORM_FMT: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
# Additional settings: | ||
# Disable errors to only generate a report | ||
DISABLE_ERRORS: true | ||
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true | ||
|
||
- name: Lint Brownfield directory | ||
uses: docker://github/super-linter:v4.9.5 | ||
env: | ||
# Only lint changed files | ||
VALIDATE_ALL_CODEBASE: true | ||
# Need to define main branch as default | ||
# is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter | ||
# run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Only the following files will be linted: | ||
FILTER_REGEX_INCLUDE: .*Brownfield\/.* | ||
# The following linter types will be enabled: | ||
VALIDATE_ARM: true | ||
VALIDATE_JSON: true | ||
VALIDATE_TERRAFORM_FMT: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
# Additional settings: | ||
# If a shell script is not executable, the bash-exec | ||
# linter will report an error when set to true | ||
DISABLE_ERRORS: true | ||
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true | ||
|
||
- name: Lint hcx directory | ||
uses: docker://github/super-linter:v4.9.5 | ||
env: | ||
# Only lint changed files | ||
VALIDATE_ALL_CODEBASE: true | ||
# Need to define main branch as default | ||
# is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter | ||
# run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Only the following files will be linted: | ||
FILTER_REGEX_INCLUDE: .*hcx\/.* | ||
# The following linter types will be enabled: | ||
VALIDATE_ARM: true | ||
VALIDATE_JSON: true | ||
VALIDATE_TERRAFORM_FMT: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
# Additional settings: | ||
# If a shell script is not executable, the bash-exec | ||
# linter will report an error when set to true | ||
DISABLE_ERRORS: true | ||
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true | ||
|
||
- name: Lint Network Design Guide directory | ||
uses: docker://github/super-linter:v4.9.5 | ||
env: | ||
# Only lint changed files | ||
VALIDATE_ALL_CODEBASE: true | ||
# Need to define main branch as default | ||
# is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter | ||
# run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Only the following files will be linted: | ||
FILTER_REGEX_INCLUDE: .*Network Design Guide\/.* | ||
# The following linter types will be enabled: | ||
VALIDATE_ARM: true | ||
VALIDATE_JSON: true | ||
VALIDATE_TERRAFORM_FMT: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
# Additional settings: | ||
# If a shell script is not executable, the bash-exec | ||
# linter will report an error when set to true | ||
DISABLE_ERRORS: true | ||
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true | ||
|
||
- name: Lint terraform directory | ||
uses: docker://github/super-linter:v4.9.5 | ||
env: | ||
# Only lint changed files | ||
VALIDATE_ALL_CODEBASE: true | ||
# Need to define main branch as default | ||
# is set to master in super-linter | ||
DEFAULT_BRANCH: main | ||
# Enable setting the status of each individual linter | ||
# run in the Checks section of a pull request | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Only the following files will be linted: | ||
FILTER_REGEX_INCLUDE: .*terraform\/.* | ||
# The following linter types will be enabled: | ||
VALIDATE_ARM: true | ||
VALIDATE_JSON: true | ||
VALIDATE_TERRAFORM_FMT: true | ||
VALIDATE_MARKDOWN: true | ||
VALIDATE_POWERSHELL: true | ||
# Additional settings: | ||
# If a shell script is not executable, the bash-exec | ||
# linter will report an error when set to true | ||
DISABLE_ERRORS: true | ||
ENABLE_GITHUB_ACTIONS_STEP_SUMMARY: true |
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,28 @@ | ||
name: trivy-scanning | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
trivy-scanning-job: | ||
name: trivy-sec-scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/trivy-action@0.28.0 | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'HIGH,CRITICAL' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |