-
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.
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
- Loading branch information
1 parent
28f1085
commit 282aa67
Showing
5 changed files
with
57 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
tasks: | ||
- name: install | ||
description: Check if Grype is installed, if not install it | ||
actions: | ||
- cmd: | | ||
if ! command -v grype &> /dev/null; then | ||
echo "Grype could not be found, installing..." | ||
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin | ||
else | ||
echo "Grype is already installed." | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
tasks: | ||
- name: vulns | ||
description: Create a UDS package with configurable flavor and extract the SBOM from all created packages and analyze for vulnerabilities | ||
actions: | ||
- cmd: | | ||
bash -c 'flavors=("upstream" "registry1") | ||
for flavor in "${flavors[@]}"; do | ||
output_dir="sbom/$flavor" | ||
mkdir -p "$output_dir" | ||
uds zarf package create . --flavor="$flavor" --confirm --no-progress -o "$output_dir" | ||
for file in "$output_dir"/*.zst; do | ||
uds zarf package inspect "$file" --sbom-out "$output_dir" --no-progress | ||
done | ||
done | ||
for flavor in "${flavors[@]}"; do | ||
sarif_output_dir="./sarif/$flavor" | ||
mkdir -p "$sarif_output_dir" | ||
find "sbom/$flavor" -type f -name "*.json" | while read -r json_file; do | ||
sarif_file_name="$(basename "${json_file}").sarif" | ||
echo "Processing $json_file" | ||
echo "Outputting to $sarif_output_dir/$sarif_file_name" | ||
grype sbom:"$json_file" --fail-on high -o sarif --file "$sarif_output_dir/$sarif_file_name" || true | ||
echo "Grype analysis for $json_file exported to $sarif_output_dir/$sarif_file_name (errors ignored)" | ||
done | ||
done' |
This file was deleted.
Oops, something went wrong.