All practice questions
1591 questions
A financial services company runs a batch data processing pipeline on Compute Engine virtual machines using a workload service account named [email protected]. The pipeline requires short-lived authorization to perform operations against Cloud Storage buckets in a separate data project, acting as the target service account [email protected]. Corporate governance explicitly forbids creating and downloading service account JSON keys. Which IAM role assignment adheres to the principle of least privilege to grant app-worker permission to impersonate storage-mgr?
A DevOps engineer needs to deploy a Cloud Functions (2nd gen) service from local source code to handle background file processing triggered by a Cloud Storage bucket event. The deployment must adhere to the principle of least privilege using a custom service account. What is the correct sequence of steps to perform this deployment?
Drag items to arrange them in the correct order
A security engineer needs to configure Cloud Audit Logging to monitor user activity on Google Cloud Storage buckets and then inspect the resulting audit records. What is the correct sequence of steps to enable Data Access audit logging and view these logs?
Drag items to arrange them in the correct order
A software engineer receives an Access Denied error when running `gcloud storage cp file.txt gs://my-company-assets/ --canned-acl=public-read`. Upon inspecting the bucket configuration, you confirm that Uniform Bucket-Level Access (UBLA) is enabled on `my-company-assets`. According to Google Cloud security best practices, how should you grant public read access to the objects in this bucket?
A Cloud Engineer is managing a fleet of Compute Engine virtual machine instances running a custom application. The application writes application-level error records to a local log file at `/var/log/app/error.log`. The SRE team requires automated Cloud Monitoring notifications to trigger whenever the rate of `CRITICAL` status log entries in this file exceeds 10 per minute. Which TWO operational steps must be performed to meet these telemetry and alerting requirements? (Select TWO.)
Select all that apply
A Cloud Operations engineer needs to configure outbound internet connectivity and secure access to Google APIs for virtual machine instances in a custom VPC subnet named `prod-subnet` (located in `us-central1`). None of the VM instances have external IP addresses assigned. Which TWO actions or `gcloud` commands should the engineer execute to fulfill these requirements?
Select all that apply
A data analytics team needs to grant a newly onboarded junior analyst access to execute queries and read data in BigQuery within a specific Google Cloud project named `analytics-prod`. The analyst must not be able to modify existing tables, delete datasets, or access non-BigQuery resources within the project. Which IAM role assignment follows Google Cloud best practices and the principle of least privilege to fulfill this requirement?
An organization manages an enterprise hybrid cloud setup connected to an on-premises data center via Cloud Interconnect. A Cloud Router named `rt-bgp-uscentral1` operating in region `us-central1` handles dynamic routing for the Virtual Private Cloud (VPC) network `production-vpc`. The Cloud Router is configured with custom route advertisements (`--advertisement-mode=CUSTOM`). A new subnet with CIDR range `10.50.0.0/20` was recently added to `production-vpc`. A network engineer must update `rt-bgp-uscentral1` to advertise this new subnet CIDR range to the on-premises BGP peer without overwriting existing custom IP advertisements or resetting the router mode, and then verify the live operational BGP session status and advertised routes. Which TWO `gcloud` commands should the engineer execute? (Select TWO.)
Select all that apply
A security engineer needs to enable a developer to manage Cloud Storage resources by impersonating a target service account from their local workstation using the Google Cloud CLI, without downloading long-lived service account keys. Arrange the steps required to configure and verify service account impersonation in the correct sequential order.
Drag items to arrange them in the correct order
A cloud engineer needs to deploy a custom enterprise environment in Google Cloud using the Google Cloud CLI (`gcloud`). The environment requires a custom VPC network, a dedicated subnet in `us-central1`, a restrictive ingress firewall rule for web application traffic, and a Compute Engine VM instance. Arrange the operational steps in the correct chronological sequence required to provision this infrastructure successfully.
Drag items to arrange them in the correct order
A cloud engineer needs to update an existing Cloud Run service named `analytics-service` in the `us-central1` region to meet two operational requirements: ensure that unauthenticated invocations are disallowed, and cap the maximum number of container instances at 50 to limit billing exposure. Which of the following commands achieve these requirements? (Select TWO.)
Select all that apply
A financial data processing pipeline uploads automated daily extract files into a Cloud Storage bucket named `fin-monthly-extracts`. A legacy batch script executed by a dedicated service account currently sets fine-grained object Access Control Lists (ACLs) using `gsutil acl` after each upload. Security policy now mandates enforcing Uniform Bucket-Level Access across all storage buckets in the project. Which action should you take to enforce compliance while ensuring the batch script can successfully read and write objects?
A security administrator needs to grant a development team the ability to deploy Cloud Run services that execute under an existing user-managed service account named [email protected]. Security policy strictly requires enforcing the principle of least privilege and forbids developers from creating service account keys or modifying IAM policies on the service account. Which IAM configuration fulfills these requirements?
A developer needs to run a local database migration script that connects to a Google Cloud resource using a dedicated service account, `[email protected]`. To follow security policies that strictly prohibit saving service account JSON keys on local workstations, the cloud administrator wants to grant the developer permission to perform service account impersonation using the gcloud CLI.
Which IAM role must be assigned to the developer's user account on the target service account to allow short-lived identity impersonation?
A cloud administrator needs to script the deployment of a Compute Engine virtual machine instance named `backend-api` into an existing Virtual Private Cloud (VPC) subnetwork named `prod-subnet`. Additionally, the deployment script must pass key-value pairs (`env=production,role=api`) to the instance metadata server upon creation. Which of the following flags should be included in the `gcloud compute instances create` command to achieve this configuration? (Select TWO answers.)
Select all that apply
A DevOps engineer must configure keyless authentication for a microservice deployed in a Google Kubernetes Engine (GKE) cluster. The microservice runs in the `analytics` namespace and needs to read objects from a Cloud Storage bucket using a Google Service Account (GSA). What is the correct sequence of steps to establish Workload Identity binding between the Kubernetes Service Account (KSA) and the GCP Service Account (GSA)?
Drag items to arrange them in the correct order
An e-commerce platform recently enabled Uniform Bucket-Level Access on a Cloud Storage bucket named `order-receipts-prod` to align with company security governance. Shortly after enforcement, an automated ingestion microservice fails when uploading receipt PDFs, returning an HTTP 400 error indicating that Access Control Lists (ACLs) are disabled. Inspection reveals the microservice uses a legacy SDK configured to attach a `public-read` canned ACL to each uploaded object. You must restore microservice functionality while maintaining Uniform Bucket-Level Access compliance on the bucket. Which action should you take?
An enterprise auditor needs to review both Admin Activity and Data Access audit logs for Cloud Storage buckets across all projects within a specific GCP Folder. The auditor must be able to view sensitive Data Access logs containing user access records, but must not be granted permissions to view the actual data stored inside the buckets or modify any Cloud Logging routing configurations. Following Google Cloud security best practices, which IAM role assignment satisfies these requirements with least privilege?
A microservices developer needs to deploy a containerized application stored in Artifact Registry (`europe-west1-docker.pkg.dev/company-prod/apps/payment-gateway:v1`) to Google Cloud Run. The deployment must fulfill the following operational criteria:
- Deploy the service under the name `payment-gateway` in the `europe-west1` region.
- Run the container using the custom service account `[email protected]`.
- Allow public HTTP requests without authentication for incoming webhooks.
Which `gcloud` command should the developer execute to meet these requirements?
An administrator manages a stateless web service deployed on a Compute Engine Managed Instance Group (MIG). Users report that individual instances occasionally stop responding to HTTP requests on port 80, even though the VM status in the Google Cloud Console remains RUNNING. The administrator needs to ensure that any instance failing to serve web traffic is automatically recreated by the group without manual intervention. Which action should the administrator take?