GoogleCloudPlatform / GoogleCloudPlatform/gsutil

mb should support setting default CMEK key

Open
#1,116 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

## Desired Behavior
I would like to be able to create a bucket w/ default CMEK key in one line like this:
```bash
gsutil mb gs://${BUCKET_NAME} -p ${PROJECT} -k ${KEY_RESOURCE}
```
This has enough information to attempt the three steps under the hood w/o the user running separate commands as described in the [public GCS CMEK docs](https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#gsutil_2)

## Current Behavior
Currently to create a bucket and set a CMEK key one must
1. create a bucket w/ `gsutil mb gs://${BUCKET_NAME}`
1. authorizes the GCS project SA w/ `gsutil kms authorize ${PROJECT} -k ${KEY_RESOURCE}`
1. sets default key with `gsutil kms encryption -k ${KEY_RESOURCE} gs://${BUCKET_NAME}`

Contributor guide

Open the contributing guide

Research direction

Trace the gsutil mb command and compare its flow with kms authorize and kms encryption, using the linked public GCS CMEK documentation as the behavioral reference. Done means mb accepts the proposed key option and performs bucket creation, authorization, and default-key setup in one invocation.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cli, cloud, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.