Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [DO NOT MERGE] Return full GCP IAM policy instead of just bindings #824

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 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 All @@ -25,7 +26,7 @@ gcp.organization @defaults("id") {
// Organization state
lifecycleState string
// Organization IAM policy
iamPolicy() []gcp.resourcemanager.binding
iamPolicy() gcp.iamPolicy
// Access approval settings
accessApprovalSettings() gcp.accessApprovalSettings
}
Expand All @@ -47,7 +48,7 @@ gcp.project @defaults("name") {
// The labels associated with this project
labels() map[string]string
// IAM policy
iamPolicy() []gcp.resourcemanager.binding
iamPolicy() gcp.iamPolicy
// List of available and enabled services for project
services() []gcp.service
// List of recommendations
Expand Down Expand Up @@ -134,8 +135,20 @@ gcp.recommendation {
state dict
}

// GCP IAM policy
private gcp.iamPolicy @defaults("bindings") {
// Internal ID
id string
// Cloud audit logging configuration
auditConfigs []dict
// List of bindings associating lists of members, or principals, to roles
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 Expand Up @@ -767,7 +780,7 @@ private gcp.project.storageService.bucket @defaults("id") {
// Update timestamp
updated time
// IAM policy
iamPolicy() []gcp.resourcemanager.binding
iamPolicy() gcp.iamPolicy
// IAM configuration
iamConfiguration dict
// Retention policy
Expand Down Expand Up @@ -1648,7 +1661,7 @@ private gcp.project.kmsService.keyring.cryptokey @defaults("name purpose"){
// List of cryptokey versions
versions() []gcp.project.kmsService.keyring.cryptokey.version
// Crypto key IAM policy
iamPolicy() []gcp.resourcemanager.binding
iamPolicy() gcp.iamPolicy
}

// GCP KMS crypto key version
Expand Down
Loading