Understand Cloud IAM in Google Cloud

Understand Cloud IAM in Google Cloud

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

As businesses continue to shift towards cloud computing, one of the most critical aspects to consider is security. Within Google Cloud Platform (GCP), a robust solution to managing security is provided by Google Cloud Identity and Access Management (IAM). This service allows administrators to authorize who can take action on specific resources, providing full control and visibility to manage cloud resources centrally.

In this blog post, we're going to delve into the intricacies of IAM on GCP, explaining what it is, how it works, and the best practices for managing access control. You can continue reading this blog post or watch my video below.

What is Google Cloud IAM?

  1. IAM is a feature of Google Cloud that allows you to manage access control by defining who (identity) has what access (role) for which resource.

    • Identity: An identity can be a Google account, a service account, or a Google group. It represents a user, a service, or a group of users.
    • Role: A role is a collection of permissions. Permissions determine what operations are allowed on a resource.
    • Resource: A resource is an individual entity within a service. Examples include a Compute Engine VM, a Pub/Sub topic, or a Cloud Storage bucket.

How Does Google Cloud IAM Work?

IAM allows for granular control of GCP resources. Instead of providing blanket permissions across a project, you can assign permissions at various levels. The IAM hierarchy follows the structure of Organization -> Folder -> Project -> Resource.

  • Organization: This is the broadest scope and includes all resources belonging to an organization.
  • Folder: Folders are a mechanism for organizing resources under an organization. They allow for the delegation of administrative rights without hierarchy constraints.
  • Project: A project organizes all your Google Cloud resources. The project is the base level organizing entity.
  • Resource: This is the most granular level of the hierarchy. Individual resources reside in a project - e.g., Compute Engine instances, Pub/Sub topics, Cloud Storage buckets.

IAM policies are set at each of these levels, and the permissions are inherited down the hierarchy. For example, a policy applied at the organization level will apply to all the resources in the organization.

Watch my youtube video where I have explained the resource hierarchy in Google Cloud Platform.

Key Features of Google Cloud IAM

  1. Roles-Based Access Control (RBAC): IAM uses roles, which are a collection of permissions that users can have within a project. There are three types of roles in IAM: primitive roles, predefined roles, and custom roles.

  2. IAM Conditions: IAM conditions allow you to define and manage fine-grained access control for GCP resources, based on attributes of the resource or the request.

  3. Service Accounts: Service accounts represent non-human users of your application or service. They provide a flexible identity for services to authenticate and authorize intra-GCP service communication.

  4. Audit Logging: IAM integrates with Cloud Audit Logs to provide logs of each action that modifies the configuration or metadata of a resource.

  5. Identity Federation: This allows you to use external identities, from platforms like G Suite, Cloud Identity, or third-party OIDC identity providers, to access GCP resources.

Types of IAM Roles

We have three types of IAM roles present. Basic IAM Role, Pre-defined IAM Role, Custom IAM Role.

Basic IAM Role

  • Quite Broad in scope.
  • When applied to a Google Cloud Project, it affects all the resources in that project.
  • This role includes owner, editor, and viewer.

Important:

  • Do not grant a basic IAM role in Production unless it is thoroughly reviewed and there is no alternative.
  • Always grant the most limited predefined or custom roles based on the need.

Pre-defined IAM Role

  • Specific Google Cloud resources define their own roles and also define at what level these roles can be applied.
  • When you will go to IAM -> Roles in your Google Cloud Console, you can see all the pre-defined IAM roles by putting the filter shown below.

Custom IAM Role

  • When predefined roles are not helpful, you create custom IAM roles. But least privilege is the best practice that should be followed always.
  • Custom IAM roles can only be applied at the project or organization level. They are not allowed to be applied at the folder level.
  • Defined and Managed by users.
  • You need the below permissions to create custom IAM roles at respective levels like -
    • Organization Level - Organization Role Administrator.
    • Project Level - Role Administrator.
  • You can create max 300 custom roles per organization and another 300 custom roles per project. These are hard limits and cannot be extended.

Best Practices for Managing IAM

Here are a few best practices for managing IAM effectively:

  • Principle of Least Privilege: Always follow the principle of least privilege, i.e., grant only the necessary permissions to a user that they need to perform their job.

  • Use Predefined Roles: Whenever possible, use predefined roles. They offer a balance between granularity and simplicity.

  • Regularly Audit IAM Roles and Permissions: Regularly review and audit IAM policies and service accounts. Unnecessary permissions should be promptly revoked.

  • Avoid Basic Roles: Basic roles affect all resources in a project. Instead, use predefined or custom roles which allow for finer-grained access control.

  • Use Service Accounts for Applications: Instead of individual users, service accounts should be used for application-to-application authentication.

Conclusion

Google Cloud IAM is a powerful tool for managing access control to your GCP resources. It provides the ability to authorize who can take what action on which resources in a fine-grained manner. Following the best practices of IAM policy management is critical in maintaining secure and manageable access to your GCP resources.

Remember, cloud security is a shared responsibility. While Google ensures the security of the cloud, it is the user's responsibility to secure their data within the cloud. Leveraging Google Cloud IAM effectively is a crucial part of fulfilling this responsibility.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Latest Google Cloud Events June 2023 🚀 🔥

Latest Google Cloud Events June 2023 🚀 🔥

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

In this blog post, I will highlight some of the latest Google Cloud events and share tips and resources to help you get the most out of your cloud journey. So whether you're a seasoned cloud pro or just getting started, I think you'll find something of value in this blog post.

You can continue reading this blog post or watch my video below.

A Sustainable Future: Measuring and Reducing Your IT Carbon Emissions on Google Cloud

You already consider security, scaling, cost, and latency in software design, but what about carbon footprint? In this session, we'll discuss how you can measure and report your IT carbon emissions on Google Cloud with some strategies for lowering that footprint.

    • Original Air Date: June 1
    • 7:00 AM - 7:45 AM PT
    • 2:00 PM - 2:45 PM UTC

On-Demand Watch Video: Click Here

DORA + DevOps: The secrets behind high performing teams

DevOps is important to improving your development lifecycle and delivering with high quality. For nearly a decade, DORA has studied the behaviors of thousands of software development teams and formed some best practices to share with Innovators. Attend this session to learn the latest on how you can increase release velocity, service reliability, and create more collaborative and productive work environments. 

    • Original Air Date: June 15
    • 9:00 AM - 10:00 AM PT
    • 4:00 PM - 5:00 PM UTC

On-Demand Watch Video: Click Here

Getting Started with Vertex Generative AI

If you're a developer looking to get started with generative AI, or if you're looking to improve your skills, then join us for a deep dive into Vertex Generative AI Studio. We'll show you how to use the tool to find the right model for your needs, and we'll share some best practices for working with large language models.

    • Original Air Date: June 29
    • 9:00 AM - 9:30 AM PT
    • 4:00 PM - 4:30 PM UTC

On-Demand Watch Video: Click Here

Google Cloud Security Summit

Join us for a deep dive into the latest technologies and strategies that can protect your business, your customers, and your cloud transformation from emerging threats. We'll share frontline insights from Google Cloud and Mandiant experts, and we'll explore cutting-edge innovations that can enhance your security posture everywhere you operate.

Sign up today and learn how to keep your business safe from cyber threats.

    • Original Air Date: June 13
    • 9:00 AM - 12:00 PM PT
    • 4:00 PM - 7:00 PM UTC

On-Demand Watch Video: Click Here

Build a data-driven culture with Google Sheets and Looker

If you're looking to take your data analytics game to the next level, then join us for a deep dive into Google Sheets and Looker. We'll show you how to use these powerful tools to make better decisions, and we'll answer all your questions.

    • Original Air Date: June 22
    • 10:00 AM - 11:00 AM PT
    • 6:00 PM - 7:00 PM UTC

On-Demand Watch Video: Click Here

Cloud OnBoard: Migrating to Google Cloud

Learn what it takes to migrate to Google Cloud from start to finish.  You'll begin by assessing your source environment and exploring governance insights, and then you'll dig into the Anthos platform, Google Cloud's Virtual Machines and Virtual Networks, and the best ways to "lift and transform" physical and virtual machines.

    • Original Air Date: June 22
    • 9:00 AM - 1:00 PM PT
    • 5:00 PM - 9:00 PM UTC

On-Demand Watch Video: Click Here

Fast track your Google Cloud career with Innovators Plus and new generative AI training

Can't get enough on gen AI? Join us on June 29th to learn how to fast track your Google Cloud career with the great benefits included in the Innovators Plus subscription. 

 

You’ll also get an opportunity to experience a preview of the live learning events included in the Innovators Plus subscription, with the hottest topic in tech - Generative AI - and the skills you can develop to fast track your cloud career.

    • Original Air Date: June 29
    • 10:00 AM - 11:00 AM PT
    • 5:00 PM - 6:00 PM UTC

On-Demand Watch Video: Click Here

Conclusion

I hope this blog post will provide you with all the event details you need. Please join and learn this new technology.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Resource Hierarchy in Google Cloud

Resource Hierarchy in Google Cloud

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Google Cloud Platform (GCP), renowned for its scalability, security, and versatility, provides a vast range of cloud-based services. To manage these services effectively, GCP incorporates a resource hierarchy model that helps users manage, organize, and control resources. Understanding the structure and flow of this hierarchy is crucial for optimizing resource management and security in GCP.

You can continue reading this blog post or watch my video below.

Resource Hierarchy Overview

At the most basic level, the Google Cloud resource hierarchy is divided into four primary components: the Organization, Folders, Projects, and Resources.

  1. Organization: This is the root node in the hierarchy and represents the topmost level of the hierarchy. It's directly associated with a domain that's been verified in your GCP console. The organization is valuable for establishing company-wide policies and to provide full visibility into all of your GCP resources.
  2. Folders: Under the Organization node, we have Folders. They serve as additional layers that can be used to enforce access control policies and group together similar projects. Folders can be used to mirror your company’s departmental structure or different environments like production, staging, and testing.
  3. Projects: Projects act as a trust boundary and make up the basis of creating, enabling, and using all GCP services like managing APIs, enabling billing, adding and removing collaborators, and managing permissions. They can house the resources that correspond to the applications, environments, and systems in your technology stack.
  4. Resources: These are the fundamental components that make up all Google Cloud services, such as Compute Engine instances, Pub/Sub topics, Cloud Storage buckets, and so on. These resources exist within the scope of a project.

Navigating The Resource Hierarchy

Navigating the GCP resource hierarchy is critical for successful project management. At each level of this hierarchy, you can enforce permissions and policies, with the settings trickling down to all entities beneath it.

For instance, permissions granted at the Organization level will cascade down to all Folders, Projects, and Resources within that Organization. Likewise, permissions granted at the Folder level will apply to all the Projects and Resources within that Folder, but not to other Folders. This cascade ensures that permissions and policies are consistently applied, reducing the risk of error and enhancing security.

Benefits of Resource Hierarchy

Understanding and effectively utilizing the Google Cloud Resource Hierarchy offers a number of advantages:

  1. Improved Organization: By logically grouping resources, GCP makes it easier to find and manage resources.
  2. Consistent Policy Application: Policies can be consistently applied and inherited down the hierarchy, ensuring security and access controls are maintained.
  3. Scalability: The hierarchy is designed to support organizations of all sizes, with the capacity to manage extensive resource collections efficiently.
  4. Flexibility: The hierarchy allows for flexible structuring, whether that’s around different teams, projects, environments, or even geographical locations.

Conclusion

The Google Cloud Resource Hierarchy provides an invaluable framework for managing resources in the Google Cloud. It empowers organizations with improved visibility, scalability, and flexibility. Understanding this hierarchy is foundational to effectively and securely managing resources in GCP. While the hierarchy may seem complex, its utility in streamlining project management and security is profound.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments