Skip to content

Commit 378fd74

Browse files
fix: Migrate gsutil usage to gcloud storage (#3331)
1 parent 3a0d326 commit 378fd74

6 files changed

Lines changed: 10 additions & 11 deletions

File tree

cli/docs/scorecard.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ This tutorial will walk you through setting up Scorecard for a single project.
2424
```
2525
4. Create a GCS bucket for storing CAI data:
2626
```
27-
gsutil mb gs://$CAI_BUCKET_NAME
27+
gcloud storage buckets create gs://$CAI_BUCKET_NAME
2828
```
2929
5. Optionally, create a public GCS bucket to trigger a violation:
3030
```
31-
gsutil mb gs://$PUBLIC_BUCKET_NAME
32-
gsutil iam ch allUsers:objectViewer gs://$PUBLIC_BUCKET_NAME
31+
gcloud storage buckets create gs://$PUBLIC_BUCKET_NAME
32+
gcloud storage buckets add-iam-policy-binding gs://$PUBLIC_BUCKET_NAME --member=allUsers --role=roles/storage.objectViewer
3333
```
3434
6. Optionally, export the CAI data to GCS:
3535
```
@@ -91,8 +91,8 @@ You can also run CFT Scorecard against locally downloaded CAI data:
9191
9292
```
9393
mkdir cai-dir
94-
gsutil cp gs://$CAI_BUCKET_NAME/resource_inventory.json ./cai-dir/
95-
gsutil cp gs://$CAI_BUCKET_NAME/iam_inventory.json ./cai-dir/
94+
gcloud storage cp gs://$CAI_BUCKET_NAME/resource_inventory.json ./cai-dir/
95+
gcloud storage cp gs://$CAI_BUCKET_NAME/iam_inventory.json ./cai-dir/
9696
./cft scorecard --policy-path ./policy-library \
9797
--dir-path ./cai-dir
9898
```

infra/build/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ OPA_VERSION := 0.52.0
5656
# Updated by Update Tooling Workflow
5757
GCRANE_VERSION := 0.20.7
5858

59-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.26.0
59+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.26.1
6060
DOCKER_TAG_MAJOR_VERSION_DEVELOPER_TOOLS := $(firstword $(subst ., , $(DOCKER_TAG_VERSION_DEVELOPER_TOOLS)))
6161
DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS := $(shell echo "${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}" | awk -F. '{print $$1"."$$2}')
6262

infra/build/developer-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN apk upgrade --no-cache && \
6868
# Add all build scripts
6969
ADD ./build/*.sh /build/
7070

71-
# Add cloud sdk first, gsutil required by some installers
71+
# Add cloud sdk first
7272
ARG CLOUD_SDK_VERSION
7373
RUN /build/install_cloud_sdk.sh ${CLOUD_SDK_VERSION}
7474

infra/build/developer-tools/build/install_cloud_sdk.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@ gcloud components install alpha beta terraform-tools gke-gcloud-auth-plugin --qu
3838
rm -rf /usr/local/google-cloud-sdk/.install/.backup
3939

4040
gcloud --version
41-
gsutil version -l

infra/build/developer-tools/build/install_tinkey.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cd /build/install_tinkey
2121

2222
TINKEY_VERSION=$1
2323

24-
gsutil cp "gs://tinkey/tinkey-${TINKEY_VERSION}.tar.gz" .
24+
curl -L -O https://storage.googleapis.com/tinkey/tinkey-${TINKEY_VERSION}.tar.gz
2525
tar -xzf "tinkey-${TINKEY_VERSION}.tar.gz"
2626

2727
install -o 0 -g 0 -m 0755 tinkey_deploy.jar /usr/bin/

infra/build/developer-tools/build/scripts/task_helper_functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ function fix_headers() {
532532
# Given SERVICE_ACCOUNT_JSON with the JSON string of a service account key,
533533
# initialize the SA credentials for use with:
534534
# 1: terraform
535-
# 2: gcloud (passes SA creds implicitly to gsutil and bq-script)
535+
# 2: gcloud (passes SA creds implicitly bq-script)
536536
# 3: Kitchen and inspec
537537
#
538538
# Add service acocunt support for additional tools as needed, preferring the
@@ -563,7 +563,7 @@ init_credentials() {
563563
# https://github.com/inspec/inspec-gcp#create-credentials-file-via
564564
export GOOGLE_APPLICATION_CREDENTIALS="${tmpfile}"
565565

566-
# Login to GCP for using bq-script and gsutil
566+
# Login to GCP for using bq-script
567567
gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}"
568568
}
569569

0 commit comments

Comments
 (0)