GCS HMAC Key Authorization¶
This article describes how to use HMAC keys to authorize GCS.
Step 1: Create a Service Account¶
- Log in to Google Cloud Console.
- Go to IAM & Admin > Service Accounts.
- Click Create Service Account.
- Fill in the name (e.g.,
guance-forward), click Create and Continue. - The role step can be skipped (no authorization at the project level), click Done directly.
Step 2: Authorize the Bucket¶
- Go to Cloud Storage > Buckets > Select the target Bucket.
- Switch to the Permissions tab.
- Click Grant Access.
- Enter the email of the service account you just created.
- Select the role Storage Object Admin (or a custom role that includes
storage.objects.create/get/listandstorage.buckets.get). - Save.
Step 3: Create HMAC Keys¶
- Go to Cloud Storage > Settings.
- Switch to the Interoperability tab.
- Find the Service account HMAC section.
- Click Create a key for a service account.
- Select the target service account, click Create key.
- Immediately save the displayed Access Key and Secret (they cannot be viewed again after closing).
Step 4: Configure in Guance¶
- Select Google Cloud GCS > HMAC Access Key.
- Fill in the Access Key and Secret Key.
- Fill in the region, bucket, and storage path.
- Test the connection.