forked from GoogleContainerTools/kaniko
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into merge
- Loading branch information
Showing
3,730 changed files
with
345,921 additions
and
138,219 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Nightly Vulnerability Scan | ||
|
||
on: | ||
schedule: | ||
# Schedule to run every night at midnight | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
vulnerability-scan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Grype | ||
run: | | ||
# Install Grype | ||
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin | ||
- name: Get latest commit SHA of Kaniko project | ||
id: get-commit | ||
run: | | ||
LATEST_COMMIT_SHA=$(git rev-parse HEAD) | ||
echo "Latest commit SHA: $LATEST_COMMIT_SHA" | ||
echo "::set-output name=sha::$LATEST_COMMIT_SHA" | ||
- name: Scan the latest CI/CD image | ||
run: | | ||
IMAGE_ID="gcr.io/kaniko-project/executor:${{ steps.get-commit.outputs.sha }}" | ||
echo "Scanning image $IMAGE_ID" | ||
grype $IMAGE_ID > grype-output.txt | ||
- name: Check for vulnerabilities and create an issue | ||
run: | | ||
if grep -q 'No vulnerabilities found' grype-output.txt; then | ||
echo "No vulnerabilities found." | ||
else | ||
gh issue create --title "Vulnerabilities Found in Nightly Scan" --body "Vulnerabilities found in the latest image scan. Please check the attached report." --file grype-output.txt | ||
fi |
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.