-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI vulnerability scans to work with multiple apps (#454)
- Loading branch information
1 parent
ef73a09
commit 7bcfb4a
Showing
4 changed files
with
43 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: CI Vulnerability Scans | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- app/** | ||
- .grype.yml | ||
- .hadolint.yaml | ||
- .trivyignore | ||
- .github/workflows/ci-vulnerability-scans.yml | ||
pull_request: | ||
paths: | ||
- app/** | ||
- .grype.yml | ||
- .hadolint.yaml | ||
- .trivyignore | ||
- .github/workflows/ci-vulnerability-scans.yml | ||
|
||
jobs: | ||
vulnerability-scans: | ||
name: Vulnerability Scans | ||
uses: ./.github/workflows/vulnerability-scans.yml | ||
with: | ||
app_name: "app" |
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 |
---|---|---|
|
@@ -3,28 +3,15 @@ | |
|
||
# NOTE: The workflow isn't able to pass the docker image between jobs, so each builds the image. | ||
# A future PR will pass the image between the scans to reduce overhead and increase speed | ||
name: CI Vulnerability Scans | ||
name: Vulnerability Scans | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- app/** | ||
- .grype.yml | ||
- .hadolint.yaml | ||
- .trivyignore | ||
- .github/workflows/ci-vulnerability-scans.yml | ||
pull_request: | ||
paths: | ||
- app/** | ||
- .grype.yml | ||
- .hadolint.yaml | ||
- .trivyignore | ||
- .github/workflows/ci-vulnerability-scans.yml | ||
|
||
env: | ||
APP_NAME: app | ||
workflow_call: | ||
inputs: | ||
app_name: | ||
description: "name of application folder under infra directory" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
hadolint-scan: | ||
|
@@ -37,7 +24,7 @@ jobs: | |
- name: Scan Dockerfile by hadolint | ||
uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ${{ env.APP_NAME }}/Dockerfile | ||
dockerfile: ${{ inputs.app_name }}/Dockerfile | ||
format: tty | ||
failure-threshold: warning | ||
output-file: hadolint-results.txt | ||
|
@@ -55,8 +42,8 @@ jobs: | |
- name: Build and tag Docker image for scanning | ||
id: build-image | ||
run: | | ||
make APP_NAME=${{ env.APP_NAME }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ env.APP_NAME }} release-image-name) | ||
make APP_NAME=${{ inputs.app_name }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ inputs.app_name }} release-image-name) | ||
IMAGE_TAG=$(make release-image-tag) | ||
echo "image=$IMAGE_NAME:$IMAGE_TAG" >> "$GITHUB_OUTPUT" | ||
|
@@ -85,8 +72,8 @@ jobs: | |
- name: Build and tag Docker image for scanning | ||
id: build-image | ||
run: | | ||
make APP_NAME=${{ env.APP_NAME }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ env.APP_NAME }} release-image-name) | ||
make APP_NAME=${{ inputs.app_name }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ inputs.app_name }} release-image-name) | ||
IMAGE_TAG=$(make release-image-tag) | ||
echo "image=$IMAGE_NAME:$IMAGE_TAG" >> "$GITHUB_OUTPUT" | ||
|
@@ -109,8 +96,8 @@ jobs: | |
- name: Build and tag Docker image for scanning | ||
id: build-image | ||
run: | | ||
make APP_NAME=${{ env.APP_NAME }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ env.APP_NAME }} release-image-name) | ||
make APP_NAME=${{ inputs.app_name }} release-build | ||
IMAGE_NAME=$(make APP_NAME=${{ inputs.app_name }} release-image-name) | ||
IMAGE_TAG=$(make release-image-tag) | ||
echo "image=$IMAGE_NAME:$IMAGE_TAG" >> "$GITHUB_OUTPUT" | ||
|
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