-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable repository scanning and Dockerfile validation (#56)
- Loading branch information
1 parent
a418078
commit 339fe4f
Showing
8 changed files
with
112 additions
and
3 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 |
---|---|---|
|
@@ -50,7 +50,8 @@ jobs: | |
exit-code: "1" | ||
ignore-unfixed: true | ||
vuln-type: "os,library" | ||
severity: "HIGH,CRITICAL" | ||
severity: "MEDIUM,HIGH,CRITICAL" | ||
skip-files: "/usr/bin/geckodriver,/usr/local/bin/geckodriver" | ||
|
||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
|
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,42 @@ | ||
name: Hadolint | ||
|
||
on: | ||
push: | ||
paths: | ||
- Dockerfile | ||
- Dockerfile.debian | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
hadolint: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
strategy: | ||
matrix: | ||
file: [Dockerfile, Dockerfile.debian] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Validate ${{ matrix.file }} | ||
uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ${{ matrix.file }} | ||
no-fail: true | ||
verbose: true | ||
format: sarif | ||
output-file: ${{ matrix.file }}.sarif | ||
|
||
- name: Upload Hadolint results of ${{ matrix.file }} | ||
uses: github/codeql-action/[email protected] | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: ${{ matrix.file }}.sarif | ||
# Optional category for the results | ||
# Used to differentiate multiple results for one commit | ||
category: hadolint-${{ matrix.file }}-validation |
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,4 +1,4 @@ | ||
name: Run isort | ||
name: Isort | ||
|
||
on: | ||
- push | ||
|
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,37 @@ | ||
name: Trivy scanner | ||
|
||
on: | ||
- push | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
trivy: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Run Trivy scanner on repository | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: repo | ||
ignore-unfixed: true | ||
vuln-type: "os,library" | ||
severity: "MEDIUM,HIGH,CRITICAL" | ||
format: "sarif" | ||
output: "trivy-repository-scan.sarif" | ||
|
||
- name: Upload Trivy scan results to GitHub Security | ||
uses: github/codeql-action/[email protected] | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: trivy-repository-scan.sarif | ||
# Optional category for the results | ||
# Used to differentiate multiple results for one commit | ||
category: repository-scan |
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 |
---|---|---|
|
@@ -114,3 +114,4 @@ deprecated/ | |
.idea | ||
debug | ||
test.sh | ||
*.sarif |
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