-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update security scanners (#1333)
- Loading branch information
1 parent
06772e7
commit 677c462
Showing
8 changed files
with
56 additions
and
37 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
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 |
---|---|---|
|
@@ -8,7 +8,6 @@ on: | |
pull_request: | ||
branches: | ||
- "master" | ||
merge_group: | ||
|
||
jobs: | ||
scanners: | ||
|
@@ -20,47 +19,66 @@ jobs: | |
id: vars | ||
shell: bash | ||
run: | | ||
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> "${GITHUB_ENV}" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build images | ||
shell: bash | ||
run: | | ||
touch keto | ||
DOCKER_BUILDKIT=1 docker build -f .docker/Dockerfile-build --build-arg=COMMIT=${{ steps.vars.outputs.sha_short }} -t oryd/keto:${{ steps.vars.outputs.sha_short }} . | ||
rm keto | ||
IMAGE_TAG="${{ env.SHA_SHORT }}" make docker | ||
- name: Anchore Scanner | ||
uses: anchore/scan-action@v3 | ||
id: grype-scan | ||
with: | ||
image: oryd/keto:${{ steps.vars.outputs.sha_short }} | ||
image: oryd/keto:${{ env.SHA_SHORT }} | ||
fail-build: true | ||
severity-cutoff: high | ||
acs-report-enable: true | ||
add-cpes-if-none: true | ||
- name: Inspect action SARIF report | ||
shell: bash | ||
if: ${{ always() }} | ||
run: | | ||
echo "::group::Anchore Scan Details" | ||
jq '.runs[0].results' ${{ steps.grype-scan.outputs.sarif }} | ||
echo "::endgroup::" | ||
- name: Anchore upload scan SARIF report | ||
if: always() | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: ${{ steps.grype-scan.outputs.sarif }} | ||
- name: Trivy Scanner | ||
uses: aquasecurity/trivy-action@master | ||
if: ${{ always() }} | ||
with: | ||
image-ref: oryd/keto:${{ steps.vars.outputs.sha_short }} | ||
image-ref: oryd/keto:${{ env.SHA_SHORT }} | ||
format: "table" | ||
exit-code: "42" | ||
ignore-unfixed: true | ||
vuln-type: "os,library" | ||
severity: "CRITICAL,HIGH" | ||
scanners: "vuln,secret,config" | ||
- name: Dockle Linter | ||
uses: erzz/[email protected].1 | ||
uses: erzz/[email protected].2 | ||
if: ${{ always() }} | ||
with: | ||
image: oryd/keto:${{ steps.vars.outputs.sha_short }} | ||
image: oryd/keto:${{ env.SHA_SHORT }} | ||
exit-code: 42 | ||
failure-threshold: fatal | ||
failure-threshold: high | ||
- name: Hadolint | ||
uses: hadolint/[email protected] | ||
id: hadolint | ||
if: ${{ always() }} | ||
with: | ||
dockerfile: .docker/Dockerfile-build | ||
verbose: true | ||
format: "json" | ||
failure-threshold: "error" | ||
- name: View Hadolint results | ||
if: ${{ always() }} | ||
shell: bash | ||
run: | | ||
echo "::group::Hadolint Scan Details" | ||
echo "${HADOLINT_RESULTS}" | jq '.' | ||
echo "::endgroup::" |
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