Basic roles utilized at the organization level misconfiguration detected in code
Rule Details
Cortex AppSec Rule ID
APPSEC_GCP_115
Category - Subcategory
IAM - Overly Permissive
Provider
GCP
Severity
HIGH
Framework
Terraform, Terraform Plan
Impact
This rule is checking to ensure that basic roles are not used at the organizational level within Google Cloud Platform. Basic roles such as Owner, Editor, and Viewer are broad and include a wide range of permissions, so assigning these roles at the organizational level could result in users having access to more resources or actions than they actually need. This is a potential security risk as it violates the principle of least privilege, where users should only have the minimum access necessary to perform their job functions. If these roles are used at the organization level, it could lead to unintentional data exposure or other damaging actions.
How to Fix
Resource: 'google_organization_iam_member', 'google_organization_iam_binding'
The policy states that you should not use basic roles at the organization level. Basic roles in Google Cloud are Owner, Editor, and Viewer and these roles include a multitude of permissions that cannot be restricted, which might pose a security risk.
To fix the issue, you should move towards using the pre-defined roles and custom roles in Google Cloud, as they offer finer grained access control.
In the above code, instead of using basic roles such as roles/owner, roles/editor, or roles/viewer, a pre-defined role (roles/editor) is being given to the user. The pre-defined roles of Google Cloud IAM are granular and have the necessary permissions to perform a specific job, and nothing more. This follows the principle of least privilege (PoLP) and makes your infrastructure more secure. [source,go]
resource "google_project_iam_member" "project" { project = "your-project-id" role = "roles/editor" member = "user:jane@example.com" }
Last updated
Was this helpful?
