Skip to content

Commit

Permalink
✨ add encryption to gcp storage bucket resource (#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeffrey authored Jan 9, 2025
1 parent dbffff1 commit 9de84a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions providers/gcp/resources/gcp.lr
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,8 @@ private gcp.project.storageService.bucket @defaults("id") {
iamConfiguration dict
// Retention policy
retentionPolicy dict
// Encryption
encryption dict
}

// Google Cloud (GCP) SQL resources
Expand Down
12 changes: 12 additions & 0 deletions providers/gcp/resources/gcp.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions providers/gcp/resources/gcp.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2441,6 +2441,8 @@ resources:
gcp.project.storageService.bucket:
fields:
created: {}
encryption:
min_mondoo_version: 9.0.0
iamConfiguration: {}
iamPolicy: {}
id: {}
Expand Down
5 changes: 5 additions & 0 deletions providers/gcp/resources/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func (g *mqlGcpProjectStorageService) buckets() ([]interface{}, error) {
if err != nil {
return nil, err
}
enc, err := convert.JsonToDict(bucket.Encryption)
if err != nil {
return nil, err
}

mqlInstance, err := CreateResource(g.MqlRuntime, "gcp.project.storageService.bucket", map[string]*llx.RawData{
"id": llx.StringData(bucket.Id),
Expand All @@ -114,6 +118,7 @@ func (g *mqlGcpProjectStorageService) buckets() ([]interface{}, error) {
"updated": llx.TimeDataPtr(updated),
"iamConfiguration": llx.DictData(iamConfigurationDict),
"retentionPolicy": llx.DictData(retentionPolicy),
"encryption": llx.DictData(enc),
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 9de84a0

Please sign in to comment.