-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds a simple shell script, some docs, and a shell.nix Signed-off-by: Michael Lieberman <[email protected]>
- Loading branch information
1 parent
e6e0271
commit eadecc8
Showing
4 changed files
with
97 additions
and
25 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,26 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# NOTE: This is going away in favor of dl_docs.py. | ||
# This expects you to have syft installed, gcloud cli installed as well as | ||
# having logged into gcloud | ||
REGISTRY_URL=${1-"https://gcr.io/v2/google-containers"} | ||
BUCKET_URL=${2-"gs://oopsallsboms"} | ||
SYFT_VERSION=$(syft version -o json | jq -r .version) | ||
TOKEN=$(gcloud auth print-access-token) | ||
GOOGLE_CONTAINERS=$(curl -H "Authorization: Bearer ${TOKEN}" "${REGISTRY_URL}/tags/list" | jq -r ".child[]") | ||
|
||
for image in ${GOOGLE_CONTAINERS} | ||
do | ||
TAGS=$(crane ls gcr.io/google-containers/${image}) | ||
for tag in ${TAGS} | ||
do | ||
DIGEST=$(crane digest ${REGISTRY_URL}/${image}:${tag} | sed s/\:/-/) | ||
FILENAME=outputs/${image}-${tag}.${DIGEST}.syft.${SYFT_VERSION}.spdx.json | ||
echo $FILENAME | ||
syft ${REGISTRY_URL}/${image}:${tag} -o spdx-json=${FILENAME} | ||
gcloud alpha storage cp ${FILENAME} ${BUCKET_URL} | ||
docker image prune -a -f | ||
done | ||
done |
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,10 @@ | ||
{ pkgs ? import <nixpkgs> {}}: | ||
with pkgs; | ||
mkShell { | ||
buildInputs = [ | ||
google-cloud-sdk | ||
crane | ||
python310Packages.autopep8 | ||
scorecard | ||
]; | ||
} |