Prepare and test your skills

Prepare and test your skills

Authentication and identity verification is the process of proving who a user or workload is before any access is allowed. Authentication (opens in a new tab) answers who you are, while authorization answers what you are allowed to do after that identity is proven. Identity management creates and maintains those identities so access decisions have a trusted foundation.
Identity management in Google Cloud covers provisioning, managing, migrating, and deprovisioning identities and enabling secure sign-in to Google services and custom workloads. Identity and Access Management (IAM) (opens in a new tab) is the practice of giving the right individuals access to the right resources for the right reasons. A principal must first authenticate with a recognized identity before IAM can check permissions and authorize an action.
Google Cloud recognizes three groups of identities that may need to authenticate:
Corporate identities are centrally managed with Cloud Identity (opens in a new tab) and Google Workspace, which provide one place to manage users, groups, and policies across the organization. Central management makes it possible to enforce consistent sign-in rules and to move users away from uncontrolled consumer accounts, such as personal Gmail accounts, to organization-controlled accounts.
Human authentication to Google Cloud uses user account credentials for manual, interactive work such as setup, configuration changes, and browsing logs. A user with a Cloud Identity or Google Workspace account signs in to the Google Cloud console with those credentials, and the same session credentials are also used for Cloud Shell. After installing the gcloud CLI on a local device, the user runs gcloud auth login so later commands run as that signed-in principal.
The identity used for sign-in must be an identity that Google Cloud can recognize. Organizations (opens in a new tab) create a Cloud Identity account for each user and group and then use IAM to manage access to Google Cloud resources. When developers use personal accounts outside organizational control, the organization can transfer those accounts into its Cloud Identity domain to regain control over access and compliance.
Trust in authentication comes from methods that prove an identity is genuine, including passwords, multi-factor authentication (MFA), and federated identity services. Strong and unique passwords with enforced complexity rules form the first layer, and password managers help users maintain them without reuse. Multi-factor authentication adds a second required proof beyond the password, and Google Cloud recommends that MFA be enabled for all users along with appropriate reauthentication settings.
Federation lets users sign in to Google Cloud with credentials from an external identity provider (IdP), such as Active Directory or Microsoft Entra ID. Federation supports single sign-on across multiple applications in hybrid and multi-cloud environments, so employees can use one identity in many places. Google Cloud supports two main patterns for workforce users with external identities.
| Option | How sign-in works | Accounts the user needs |
|---|---|---|
| Federation using Cloud Identity or Google Workspace | External identities are synced to matching Cloud Identity or Google Workspace accounts, often with Google Cloud Directory Sync (GCDS), and users sign in with external credentials | Two accounts: an external account and a Cloud Identity or Google Workspace account |
| Workforce Identity Federation | The external IdP signs users directly in to Google Cloud to access resources and products | One account: the external account, also called a federated identity |
Workforce Identity Federation removes the need to maintain a second copy of each user in Google Cloud, while synced federation keeps a matching Cloud Identity account for management.
Exam tip: Authentication verifies who the user is with passwords, MFA, or federation, while authorization grants what that verified identity can do through IAM roles.
Workload authentication proves the identity of code and services, not people, so applications can access Google Cloud services securely. Google Cloud service accounts act as identities for workloads, where access is granted to the service account and the workload then uses that identity. An attached service account can serve as the default identity for a resource, so any workload running on that resource uses the service account when it calls Google Cloud services.
Workload Identity Federation lets workloads running on Google Cloud, Google Kubernetes Engine (GKE), AWS, Azure, or GitHub access most Google Cloud services using an identity from an external IdP. Application Default Credentials (ADC) (opens in a new tab) provides a portable way for code to obtain those credentials, because libraries that support ADC check known locations in the current environment for credentials. The same code can therefore run unchanged locally with user credentials and in production with short-lived service account credentials, such as OAuth 2.0 access tokens and OpenID Connect ID tokens.
Auditing and accountability mechanisms keep a permanent record of who did what, where, and when with cloud resources. Cloud Audit Logs (opens in a new tab) is the service that creates this record by having Google Cloud services write audit log entries for administrative activities and resource access. These logs give security, auditing, and compliance teams transparency similar to on-premises environments, so they can monitor for vulnerabilities, data misuse, and policy violations.
Cloud Audit Logs provides four types of audit logs for each Google Cloud project, folder, and organization. Log entries written by Cloud Audit Logs are immutable, which means they cannot be changed after they are written. This immutability makes the logs trustworthy for forensics, compliance reviews, and security investigations.
For identity and access work, Admin Activity audit logs and Policy Denied audit logs are especially important. Admin Activity audit logs store changes to projects, Compute Engine instances, and service accounts, including creation of a service account, a change in an IAM policy, and download of a service account key. Policy Denied audit logs show denied attempts, which helps reveal misconfigured permissions or attempted unauthorized access.
Exam tip: Admin Activity audit logs record changes that were made, while Policy Denied audit logs record access that was blocked by a security policy.
Auditing supports accountability by linking every important change to an identity, an action, a location, and a time. Administrators can look back at historical data in Cloud Audit Logs to understand access patterns, spot access anomalies, and investigate production issues caused by an IAM policy change, including which user or process made the change. This history is also critical during a data breach for analyzing what permissions were used and what resources were accessed.
Centralized logging strengthens this accountability across identity sources. Admin Activity audit logs from Google Workspace or Cloud Identity are normally managed in the Google Admin console, separately from Google Cloud logs, but sharing Cloud Identity audit logs to Google Cloud brings user login events and other relevant activity into one place. Teams can also use Policy Analyzer to periodically verify which users have access to which resources and in what capacity, which supports compliance and audit reviews.
Viewing, storing, and protecting audit logs in Google Cloud is handled through Cloud Logging, the service for storing, searching, analyzing, and alerting on log data. Audit logs can be viewed in the Google Cloud console in Logs Explorer or queried through the Cloud Logging API and command-line interface. All audit logs have a retention period, and organizations that need longer storage create a log sink to export logs to BigQuery or other sink destinations for long-term analysis over time.
Access to view audit logs depends on IAM roles granted on the project:
| Role | Logs that can be viewed | Access to Data Access logs |
|---|---|---|
Logs Viewer (roles/logging.viewer) | Admin Activity, Policy Denied, and System Event audit logs for read-only review | Cannot view Data Access audit logs in the _Default bucket |
Private Logs Viewer (roles/logging.privateLogViewer) | All logs in the _Required and _Default buckets | Can read Data Access audit logs in the _Default bucket |
The Private Logs Viewer role includes the permissions in the Logs Viewer role plus the permissions needed to read Data Access logs. Because audit logs contain sensitive information about who accessed what, granting only the minimum viewer role needed helps keep accountability data itself secure.
Authorization and resource access control is the step that decides what an already-verified identity is allowed to do. Authentication confirms who the user or workload is, and then authorization checks what that identity can do on which resources. Identity and Access Management (IAM) (opens in a new tab) is the Google Cloud service that enforces authorization by checking permissions on every action and blocking the action when the required permission is missing.
Authorization in Google Cloud controls who can do what on which resources. Every action, such as creating a Compute Engine virtual machine instance or viewing a Cloud Storage dataset, requires one or more specific permissions. When a request arrives, IAM checks whether the requesting identity has those permissions on the target resource. If the identity has the required permission, the action proceeds, and if it does not, IAM prevents the action.
The IAM authorization model connects three parts: a principal, a role, and a resource. A principal is the authenticated identity requesting access and includes human users such as Google Accounts and Google groups, as well as workloads such as service accounts. A permission, written in the form service.resource.verb such as resourcemanager.projects.list or storage.objects.create, allows one specific operation, while a role is a collection of permissions that is granted to the principal on a resource.
Permissions cannot be granted directly to a principal in IAM. A principal receives permissions only when an administrator grants a role containing those permissions, so the role is the unit of access control. For example, the Storage Object Viewer role contains storage.objects.get and storage.objects.list, and the Pub/Sub Publisher role (roles/pubsub.publisher) contains the permissions needed to publish messages to a Pub/Sub topic.
The three IAM role types differ in who manages them and how broadly they grant access:
| Role type | Who manages permissions | Choose when |
|---|---|---|
| Predefined role | Google Cloud maintains the permission set | The work matches a common task for a service, such as viewing objects or publishing messages |
| Custom role | The customer selects only the specified permissions | Predefined roles grant too much or too little, and tighter control is worth extra maintenance |
| Basic role | Google Cloud provides broad Owner, Editor, and Viewer access | Testing in non-production, where broad access is acceptable for a short time |
Basic roles include thousands of permissions across services, so the Owner and Editor roles can enable privilege escalation and the Viewer role can expose broad read access to data. Avoid basic roles in production environments and use the most limited predefined role or custom role that still allows the work.
An allow policy, also called an IAM policy, is the object that attaches access rules to a Google Cloud resource. Each allow policy contains role bindings, and each role binding connects one or more principals to one IAM role on that resource. The granted access applies both to the resource with the policy and to resources contained within it, so a policy set on a Cloud Storage bucket can control its managed folders and objects, and a policy set on a project can control buckets and instances inside that project.
A tree from Organization to Folders to Projects to service resources showing allow policies inherit downward, with a deny policy callout on a project that overrides allows.
Resources are organized in a hierarchy where organizations contain folders, folders contain projects, and projects contain service resources such as instances, disks, buckets, and topics. A child resource inherits the allow policies of its parent resources, so granting a role on a parent automatically grants the same access to all of its children. For example, granting Compute Engine administration on a project gives administration of every virtual machine in that project, regardless of policies set on individual virtual machines.
An IAM deny policy provides an explicit guardrail that overrides allow policies. When a deny policy is attached to a resource, the listed principal cannot use the denied permission on that resource or its descendants, even if an allow policy grants it. IAM deny policies cannot be set on Cloud Storage buckets, managed folders, or individual objects, and IAM allow policies cannot be set directly on individual Cloud Storage objects.
Exam tip: A deny policy always overrides an allow policy, so an explicit denial blocks access even when a role grant would otherwise allow it.
Least privilege means giving each principal only the permissions and scope needed to do its job, and nothing more. IAM policies apply this principle through the level where access is granted and the size of the role that is granted. Granting a role on a lower-level resource, such as one Compute Engine instance or one Pub/Sub topic, limits the blast radius compared with granting the same role on the project, folder, or organization above it.
Least privilege in practice depends on several related choices:
These choices work together because the policy on a parent flows down to its children. A narrow role on a narrow resource keeps inheritance safe, while a broad role on a high-level container extends that broad access to everything below it.
Authentication, authorization, and auditing form a connected chain that protects Google Cloud resources. Authentication first proves identity for people with passwords, MFA, or federation and for workloads with service accounts, authorization then allows only the permitted actions through IAM roles, allow policies, and deny guardrails under least privilege, and auditing finally records both successful changes and denied attempts in Cloud Audit Logs for accountability and compliance.
A left-to-right process flow showing authentication proving who you are, authorization checking what you can do via IAM, and auditing recording actions in Cloud Audit Logs.
Authentication proves who a user or workload is before any access is allowed, authorization decides what that verified identity is allowed to do, and auditing records who did what, where, and when. In Google Cloud, Identity and Access Management (IAM) enforces authorization by checking permissions, while Cloud Audit Logs creates the immutable audit record for accountability and compliance.
Use Workforce Identity Federation when you want the external identity provider to sign users directly in to Google Cloud with only their external account, which removes the need to maintain a second copy of each user. Use federation using Cloud Identity or Google Workspace when you want external identities synced to matching Cloud Identity or Google Workspace accounts for management, which requires users to have both an external account and a Cloud Identity or Google Workspace account.
Admin Activity audit logs record user-driven actions that modify configuration or metadata, such as creating a virtual machine instance or changing Identity and Access Management (IAM) permissions. Policy Denied audit logs record when a user or service account is denied access to a Google Cloud service due to a security policy violation.
Identity and Access Management (IAM) checks whether the authenticated principal has the required permission on the target resource, and the action proceeds only if the permission is present through a role binding. Permissions cannot be granted directly, so a principal receives access only when an administrator grants a role containing those permissions, while an IAM deny policy overrides any allow policy and blocks access even when a role would otherwise allow it.
A company is configuring a production environment in Google Cloud. A newly hired data analyst has already authenticated using their corporate Google Account and now requires authorization to perform their daily tasks. The cloud administrator must configure access based on the following requirements:
How should the administrator configure Identity and Access Management (IAM) to meet these requirements?
Last updated