Skip to content

Commit

Permalink
gcp.resourcemanager.binding -> gcp.iamPolicy.binding
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Jan 27, 2023
1 parent d49b2c1 commit af47173
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
7 changes: 4 additions & 3 deletions resources/packs/gcp/gcp.lr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ option go_package = "go.mondoo.com/cnquery/resources/packs/gcp"

alias gcloud.organization = gcp.organization
alias gcloud.project = gcp.project
alias gcloud.resourcemanager.binding = gcp.resourcemanager.binding
alias gcloud.resourcemanager.binding = gcp.iamPolicy.binding
alias gcp.resourcemanager.binding = gcp.iamPolicy.binding
alias gcp.compute = gcp.project.computeService
alias gcloud.compute = gcp.project.computeService
alias gcloud.compute.instance = gcp.project.computeService.instance
Expand Down Expand Up @@ -141,13 +142,13 @@ private gcp.iamPolicy @defaults("bindings") {
// Cloud audit logging configuration
auditConfigs []dict
// List of bindings associating lists of members, or principals, to roles
bindings []gcp.resourcemanager.binding
bindings []gcp.iamPolicy.binding
// Format of the policy
version int
}

// GCP Resource Manager Binding
private gcp.resourcemanager.binding {
private gcp.iamPolicy.binding {
// Internal ID
id string
// Principals requesting access for a Google Cloud resource
Expand Down
72 changes: 36 additions & 36 deletions resources/packs/gcp/gcp.lr.go

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

2 changes: 1 addition & 1 deletion resources/packs/gcp/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func auditConfigsToMql(runtime *resources.Runtime, auditCfgs []*cloudresourceman
func bindingsToMql(runtime *resources.Runtime, bindings []*cloudresourcemanager.Binding, idPrefix string) ([]interface{}, error) {
mqlBindings := make([]interface{}, 0, len(bindings))
for i, b := range bindings {
mqlServiceaccount, err := runtime.CreateResource("gcp.resourcemanager.binding",
mqlServiceaccount, err := runtime.CreateResource("gcp.iamPolicy.binding",
"id", fmt.Sprintf("%s/%d", idPrefix, i),
"role", b.Role,
"members", core.StrSliceToInterface(b.Members),
Expand Down
2 changes: 1 addition & 1 deletion resources/packs/gcp/info/gcp.lr.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/packs/gcp/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ func (g *mqlGcpOrganization) GetIamPolicy() (interface{}, error) {
)
}

func (g *mqlGcpResourcemanagerBinding) id() (string, error) {
func (g *mqlGcpIamPolicyBinding) id() (string, error) {
return g.Id()
}

0 comments on commit af47173

Please sign in to comment.