Tüm alıştırma soruları

1591 soru

Soru 1161Soru

Your enterprise security policy strictly forbids downloading exportable service account keys. You are tasked with provisioning a Compute Engine virtual machine instance in `prod-app-project` that requires read access to a BigQuery dataset located in `prod-analytics-project`. Arrange the administrative actions in the correct chronological sequence to configure and attach a custom service account under least-privilege best practices.

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct operational sequence begins by creating the custom service account in the source project, granting cross-project dataset access to that identity, assigning the Service Account User role to the provisioning principal, and finally attaching the service account during VM creation.
Establishing a keyless cross-project workload identity requires sequential execution: creating the service account identity in the home project, granting the service account resource-level access in the destination project, delegating Service Account User permissions to the deployment principal, and finally binding the service account to the Compute Engine instance.

Adım Adım Çözüm

1
Create the service account in the local project using gcloud IAM service-accounts create.
A unique service account identity (email ID) is established in `prod-app-project`.
You cannot grant roles or delegate attachment privileges to an identity before creating it.
2
Bind the target dataset access role in the remote project to the new service account email.
The service account gains granular permission (`roles/bigquery.dataViewer`) on the resource in `prod-analytics-project`.
Configuring access prior to workload deployment ensures immediate operational readiness upon instance startup.
3
Grant `roles/iam.serviceAccountUser` on the service account to the deploying user or pipeline identity.
The deployment principal receives explicit permission to impersonate/attach the service account to Compute Engine resources.
Without `roles/iam.serviceAccountUser`, Compute Engine instance creation specifying this service account will be blocked by IAM authorization checks.
4
Deploy the Compute Engine instance specifying the `--service-account` flag in `prod-app-project`.
The virtual machine runs under the credentials of the dedicated custom service account keylessly via metadata server integration.
Attaching the service account at instance creation ensures keyless identity metadata propagation to the workload.

Anahtar Kavram

Cross-Project Service Account Management and Compute Engine IAM Attachment
Soru 1162Soru

An organization mandates that external deployment pipelines running outside Google Cloud must access Cloud Storage buckets without using downloadable credential keys. A cloud engineer configures Workload Identity Federation to establish trust between the external identity provider and Google Cloud. Which IAM role assignment on the target Google Cloud service account is required to allow the external workload principal to obtain short-lived credentials?

Cevabı ve açıklamayı göster

Cevap: Grant the external workload principal the Workload Identity User role (roles/iam.workloadIdentityUser) directly on the target service account.

Cevap

Grant the external workload principal the Workload Identity User role (roles/iam.workloadIdentityUser) directly on the target service account.
Workload Identity Federation allows external workloads to exchange external tokens for short-lived GCP credentials by granting the external workload principal the Workload Identity User role (roles/iam.workloadIdentityUser) on the target service account resource.

Adım Adım Çözüm

1
Identify the authentication requirement
External workloads require keyless access to Google Cloud resources via Workload Identity Federation.
Security policies strictly forbid downloading long-lived JSON service account keys.
2
Determine the necessary IAM binding on the target service account
The external principal identifier (principal://iam.googleapis.com/...) must be bound to the target service account.
Identity delegation via Workload Identity Federation requires authorizing the specific federated principal to impersonate the service account.
3
Select the correct predefined IAM role for Workload Identity
Assign roles/iam.workloadIdentityUser to the principal on the target service account.
This role explicitly allows the specified identity to exchange external OIDC tokens for short-lived Google Cloud service account access tokens.

Anahtar Kavram

Configuring Service Account Impersonation and Workload Identity
Tahmini Süre:2m 0s
Soru 1163Soru

An enterprise organization is deploying a fleet of Compute Engine instances running custom Linux images. The SRE team requires collection of system memory metrics, disk space utilization, and custom application log files stored at `/var/log/app/*.log`. Following Google Cloud recommended practices and the principle of least privilege, which TWO operational actions must be performed to enable telemetry ingestion and authorization?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Install the unified Google Cloud Ops Agent on the Compute Engine instances and define a custom log receiver pipeline pointing to `/var/log/app/*.log` inside the agent configuration file (`config.yaml`).; Attach a dedicated service account to the Compute Engine instances that has been granted the `roles/logging.logWriter` and `roles/monitoring.metricWriter` IAM roles.

Cevap

Telemetry collection for Compute Engine system metrics (including memory and disk) and custom log files requires installing the unified Google Cloud Ops Agent configured with custom log receiver pipelines, along with attaching a service account to the VMs possessing the predefined `roles/logging.logWriter` and `roles/monitoring.metricWriter` IAM roles.
To collect OS-level telemetry like RAM utilization and custom file logs from Compute Engine, the Google Cloud Ops Agent must be installed and configured with a custom pipeline in `config.yaml`. Furthermore, for the VM instances to securely send telemetry to Cloud Operations under least privilege principles, the attached service account requires the predefined roles `roles/logging.logWriter` and `roles/monitoring.metricWriter`.

Adım Adım Çözüm

1
Determine telemetry collection agent requirement
Identify that default Compute Engine metrics do not capture OS-internal memory utilization or custom file logs, requiring the installation of the unified Google Cloud Ops Agent.
The Ops Agent is Google's recommended unified agent for Compute Engine VMs that handles both system metrics and log collection.
2
Configure custom application log ingestion
Edit `/etc/google-cloud-ops-agent/config.yaml` on the VMs to add a custom logging receiver for `/var/log/app/*.log` files.
The Ops Agent uses a YAML configuration file to define custom files and formats for log ingestion.
3
Determine IAM permissions according to least privilege
Select the minimal predefined IAM roles `roles/logging.logWriter` and `roles/monitoring.metricWriter` for the VM's service account.
These specific predefined roles grant write permissions for Cloud Logging and Monitoring telemetry without exposing excess permissions.

Anahtar Kavram

Google Cloud Ops Agent Configuration & Least Privilege IAM Authorization
Tahmini Süre:3m 0s
Soru 1164Soru

An operations team monitors a high-throughput IoT analytics platform that streams write traffic to a Cloud Bigtable instance. During peak usage windows, monitoring alerts show that CPU utilization on the Bigtable cluster exceeds 80%, causing significant write latency spikes. The team needs an immediate operational resolution to lower CPU usage and restore low latency without application code modifications or data schema changes. Which action should the Cloud Engineer take?

Cevabı ve açıklamayı göster

Cevap: Increase the number of nodes in the Cloud Bigtable cluster using the Cloud Console or gcloud bigtable clusters update command.

Cevap

Increase the number of nodes in the Cloud Bigtable cluster using the Cloud Console or gcloud bigtable clusters update command.
Cloud Bigtable scales compute and storage independently. When high CPU utilization causes increased latency, increasing the node count instantly redistributes the workload across more nodes, decreasing per-node CPU utilization and lowering latency with zero downtime.

Adım Adım Çözüm

1
Identify the performance constraint from telemetry metrics.
CPU utilization exceeding 80% on Cloud Bigtable directly correlates with write latency spikes.
Cloud Bigtable performance scales linearly with the number of nodes assigned to the cluster.
2
Select an operational action that scales throughput capacity dynamically.
Adding nodes increases computing power and bandwidth allocated to the cluster.
Node scaling in Cloud Bigtable takes effect online without downtime or application modifications.
3
Use the appropriate administrative tool to adjust cluster size.
Execute gcloud bigtable clusters update to adjust node count.
Management operations for Cloud Bigtable clusters are performed via gcloud bigtable commands or the Cloud Console.

Anahtar Kavram

Cloud Bigtable Performance Management and Operational Scaling
Soru 1165Soru

A Cloud Operations team manages a custom Virtual Private Cloud (VPC) network named `finance-vpc`. A system administrator is tasked with updating an existing ingress firewall rule named `allow-db-ingress` so that it allows incoming TCP traffic on port 5432, targets Compute Engine instances with the network tag `db-node`, and evaluates at a priority level of 200. Additionally, the administrator must verify the updated configuration details using the Google Cloud CLI. Which TWO steps should the administrator take to complete these operations?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Run `gcloud compute firewall-rules update allow-db-ingress --allow=tcp:5432 --target-tags=db-node --priority=200` to modify the existing rule attributes.; Run `gcloud compute firewall-rules describe allow-db-ingress` to review the details and confirm the effective configuration of the updated rule.

Cevap

The administrator must update the rule using `gcloud compute firewall-rules update allow-db-ingress --allow=tcp:5432 --target-tags=db-node --priority=200` and verify the updated configuration using `gcloud compute firewall-rules describe allow-db-ingress`.
Updating an ingress firewall rule to target specific destination workloads requires using `--target-tags` along with the desired allowed ports and priority integer. To audit and confirm the changes, executing `gcloud compute firewall-rules describe` outputs the exact JSON/YAML spec of the deployed resource.

Adım Adım Çözüm

1
Identify the required CLI flags for updating firewall rule target tags, priority, and allowed protocols/ports.
Determined that `--allow=tcp:5432`, `--target-tags=db-node`, and `--priority=200` are the correct parameters for updating the ingress target.
In ingress firewall rules, `--target-tags` specifies instances that receive the traffic, while `--source-tags` specifies traffic origin.
2
Select the appropriate verification command to inspect existing firewall resource attributes.
Selected `gcloud compute firewall-rules describe allow-db-ingress`.
The `describe` command fetches full resource configuration details, satisfying the requirement to audit the updated rule.

Anahtar Kavram

VPC Firewall Rule Management and Evaluation Logic
Soru 1166Soru

An organization operates a custom-mode Virtual Private Cloud (VPC) named `production-vpc`. To adhere to security compliance, an ingress firewall rule named `deny-ssh-global` was created with a priority of `1000` to deny TCP port 22 traffic from source `0.0.0.0/0` across all instances in the VPC. The operations team now requires temporary SSH access to a specific subset of Compute Engine instances tagged with `ops-troubleshoot` from an internal management IP range of `10.50.0.0/20`. How should you configure the new firewall rule to allow this access while leaving the global restriction intact for all other instances?

Cevabı ve açıklamayı göster

Cevap: Create an ingress firewall rule allowing TCP port 22 from source IP range 10.50.0.0/20 with target tag ops-troubleshoot and assign a priority of 500.

Cevap

Create an ingress firewall rule allowing TCP port 22 from source IP range 10.50.0.0/20 with target tag ops-troubleshoot and assign a priority of 500.
In Google Cloud VPC networks, firewall rules are processed according to numerical priority order, where lower integer values denote higher evaluation precedence (priority 0 is evaluated first). Creating an ingress ALLOW rule with a priority of 500 ensures that incoming packets matching the target tag ops-troubleshoot and source range 10.50.0.0/20 are evaluated and permitted before reaching the broad DENY rule configured at priority 1000.

Adım Adım Çözüm

1
Analyze GCP firewall rule evaluation order.
GCP evaluates firewall rules based on numerical priority from 0 to 65535, where lower numbers have higher precedence.
To override an existing DENY rule with priority 1000, the ALLOW rule must have a priority lower than 1000 (e.g., 0 through 999).
2
Determine target scope and parameters.
Filter traffic by source range 10.50.0.0/20, protocol/port TCP:22, and target network tag ops-troubleshoot.
Using target network tags limits the scope of the exception rule specifically to the designated management instances without exposing other instances in the VPC.
3
Select the correct priority value.
Setting priority to 500 ensures incoming SSH traffic matching the target tag and source range is evaluated and allowed prior to hitting the global deny rule at priority 1000.
Rule evaluation stops at the first matching rule.

Anahtar Kavram

GCP VPC Firewall Rule Priority Precedence
Soru 1167Soru

A cloud engineer needs to provision a single Compute Engine instance named `analytics-worker` in zone `us-east1-b`. The virtual machine must use the `e2-standard-4` machine type, must not have a public IP address assigned, and must execute a local provisioning script stored on the engineer's workstation at `/scripts/bootstrap.sh` when the instance boots up. Which `gcloud` command should the engineer run to deploy this instance?

Cevabı ve açıklamayı göster

Cevap: gcloud compute instances create analytics-worker --zone=us-east1-b --machine-type=e2-standard-4 --metadata-from-file=startup-script=/scripts/bootstrap.sh --no-address

Cevap

The command 'gcloud compute instances create analytics-worker --zone=us-east1-b --machine-type=e2-standard-4 --metadata-from-file=startup-script=/scripts/bootstrap.sh --no-address' correctly provisions the Compute Engine instance with the required configuration.
The correct command provisions a zonal Compute Engine instance using '--zone=us-east1-b', sets the machine type to 'e2-standard-4', uses '--no-address' to prevent public IP allocation, and uses '--metadata-from-file=startup-script=/scripts/bootstrap.sh' to properly upload and execute the local bootstrap script during instance startup.

Adım Adım Çözüm

1
Identify the proper metadata flag for local file contents.
Use '--metadata-from-file=startup-script=/scripts/bootstrap.sh' to read and upload the local script file on instance creation.
The standard '--metadata' flag treats values as literal strings, whereas '--metadata-from-file' reads the file from local disk.
2
Verify network configuration flags for external IP restriction.
Include '--no-address' to prevent assigning an external public IP address.
By default, Compute Engine assigns an ephemeral external IP unless explicitly disabled with '--no-address'.
3
Confirm proper location scope flag.
Specify '--zone=us-east1-b' rather than '--region'.
Compute Engine instances are zonal resources and require a zone parameter during creation.

Anahtar Kavram

Deploying Compute Engine VMs with custom startup scripts using gcloud CLI metadata flags
Tahmini Süre:1m 30s
Soru 1168Soru

A system administrator needs to recover a Compute Engine VM instance whose primary boot disk has suffered operating system corruption. The administrator has access to a recent, uncorrupted disk snapshot. What is the correct sequence of steps to restore the instance to operational status using the gcloud CLI while preserving the VM instance identity and IP configurations?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct operational sequence requires stopping the instance, creating a persistent disk from the snapshot, detaching the corrupted boot disk, attaching the newly created disk with the --boot flag, and finally starting the instance.
To successfully replace a corrupted boot disk on an existing Compute Engine VM instance, the instance must first be stopped to allow disk modification. Next, a persistent disk must be instantiated from the snapshot because snapshots cannot be mounted directly. The corrupted disk is then detached, the restored disk is attached with the --boot flag, and the instance is started.

Adım Adım Çözüm

1
Stop the affected Compute Engine VM instance.
The instance state transitions to TERMINATED.
Compute Engine requires the instance to be stopped before modifying or detaching its root boot disk.
2
Provision a new persistent disk from the snapshot.
A new persistent disk is populated with data from the target snapshot.
Snapshots cannot be attached directly to instances; they must first be converted into a Persistent Disk resource.
3
Detach the corrupted persistent boot disk.
The corrupted disk is disassociated from the VM instance.
A VM instance can only have one primary boot disk attached at any given time.
4
Attach the new persistent disk as the boot disk.
The new persistent disk becomes the designated boot disk for the VM.
Specifying the --boot flag tells Compute Engine to configure BIOS/UEFI boot properties for this attached disk.
5
Start the Compute Engine VM instance.
The VM boots successfully into the restored operating system state.
Powering on the VM initiates the boot sequence using the newly attached boot disk.

Anahtar Kavram

Compute Engine Boot Disk Recovery and Lifecycle Management
Soru 1169Soru

Match each Google Cloud database or persistent disk option on the left with its target technical workload requirement on the right.

Soldaki öğeye tıklayın, sonra eşleşen sağdaki öğeye tıklayın

Öğeler

Cloud Spanner
Cloud Bigtable
Extreme Persistent Disk (pd-extreme)
Firestore

Eşleşmeler

Cevabı ve açıklamayı göster

Cevap

Cloud Spanner matches fully managed relational database with strong global ACID consistency; Cloud Bigtable matches high-throughput NoSQL key-value store for time-series; Extreme Persistent Disk matches block storage providing up to 120,000 IOPS; Firestore matches serverless NoSQL document storage with real-time synchronization.
Each Google Cloud storage service is matched to its core architectural use case: Cloud Spanner delivers globally scalable relational transactions; Cloud Bigtable provides sub-10ms latency for massive NoSQL time-series data; Extreme Persistent Disk (pd-extreme) provides maximum block-level IOPS for VM-hosted databases; and Firestore provides serverless NoSQL document synchronization for web/mobile apps.

Adım Adım Çözüm

1
Analyze the data structure, transaction model, and scalability requirements for each workload scenario.
Differentiate between relational global transactions, NoSQL key-value throughput, NoSQL document sync, and high-performance block storage.
Selecting the proper GCP database or block storage option depends on consistency guarantees, query capabilities, and IOPS requirements.
2
Map managed database options based on database paradigm.
Pair Cloud Spanner with global relational workloads needing ACID compliance, and pair Firestore with serverless document sync for mobile/web clients.
Cloud Spanner offers horizontally scalable SQL, while Firestore focuses on document hierarchies with client SDK sync.
3
Map high-throughput NoSQL storage and specialized Compute Engine block storage.
Pair Cloud Bigtable with high-throughput low-latency NoSQL data streams, and pair pd-extreme with high-IOPS block storage for self-managed VM databases.
Cloud Bigtable handles massive analytical streams, while pd-extreme provides the highest IOPS for block devices attached to Compute Engine VMs.

Anahtar Kavram

Selecting GCP Database and Storage Solutions Based on Workload Requirements
Soru 1170Soru

You need to provision a Compute Engine virtual machine that requires access to Cloud Storage, following Google Cloud identity best practices. Arrange the administrative steps in the correct logical sequence to create, grant permissions to, and assign a custom service account to the instance.

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct order is: 1) Create the dedicated service account, 2) Grant the required resource IAM roles to the service account, 3) Grant the deployment identity the Service Account User role, 4) Create the Compute Engine instance with the service account attached.
The correct workflow begins by creating the service account identity, defining its resource access permissions next, delegating usage rights to the deployer third, and attaching the service account to the VM instance during creation fourth.

Adım Adım Çözüm

1
Create the Service Account identity
The service account identity is established in the project.
You must create the service account identity before granting roles or attaching it to resources.
2
Assign IAM roles to the Service Account
Service account gains specific resource permissions.
Following least privilege, assign predefined roles directly to the service account before running workloads.
3
Grant Service Account User role to the deployer identity
Deployer receives authorization to bind the service account to resources.
Attaching a service account to a compute resource requires the roles/iam.serviceAccountUser role on the target service account.
4
Attach the Service Account during Compute Engine VM creation
VM instance runs using the identity of the custom service account.
The compute instance consumes the credentials of the assigned service account without requiring exported static JSON keys.

Anahtar Kavram

Sequential lifecycle of creating, granting permissions to, delegating use of, and attaching service accounts in Google Cloud.
Soru 1171Soru

An application deployed on a Compute Engine virtual machine in a Google Cloud project named `payments-service-prod` requires access to database credentials stored in Secret Manager. The application's service account must be able to read secret payload values at runtime to establish database connections. To meet strict enterprise security guidelines, the service account must not be granted permissions to modify secrets, create new secrets, or access resources in any other projects. Which IAM role binding strategy adheres to the principle of least privilege while fulfilling these requirements?

Cevabı ve açıklamayı göster

Cevap: Grant the service account the Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) resource binding on the payments-service-prod project.

Cevap

Grant the application service account the predefined Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) bound specifically at the project level (`payments-service-prod`).
The Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) provides the exact permission (`secretmanager.versions.access`) required to retrieve secret payload values. Binding this role specifically at the project resource level ensures access is limited to secrets inside `payments-service-prod` without over-granting permissions or broad inheritance across sibling projects.

Adım Adım Çözüm

1
Identify required permission capability
The application needs to read secret payload values at runtime (`secretmanager.versions.access`).
Reading secret payload values requires specific data access permissions rather than secret metadata viewing or administration.
2
Select the narrowest predefined IAM role
The Secret Manager Secret Accessor role (`roles/secretmanager.secretAccessor`) grants payload access without granting secret creation or modification permissions.
Using predefined roles enforces the principle of least privilege over broad primitive roles (such as Viewer or Editor) or administrative roles (such as Secret Manager Admin).
3
Determine proper resource hierarchy scope
Bind the role at the project level (`payments-service-prod`).
Assigning permissions at the project level restricts access to secrets within that project and prevents inheritance leakage to other projects under the parent folder.

Anahtar Kavram

Principle of Least Privilege with Predefined IAM Roles and Hierarchy Scoping
Tahmini Süre:2m 0s
Soru 1172Soru

A Cloud Engineer must configure a Google Cloud Storage bucket storing audit logs to adhere to regulatory compliance standards. The policy mandates that objects must be protected against deletion or modification for three years, and storage costs for logs older than 90 days must be optimized automatically while retaining accessibility. Which TWO actions should the engineer execute to achieve these operational requirements?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Configure a Retention Policy with a locked duration of three years on the Cloud Storage bucket.; Create an Object Lifecycle Management rule with an action to transition objects to Coldline or Archive storage after 90 days from creation.

Cevap

The correct actions are to set a locked Bucket Retention Policy for three years and to create an Object Lifecycle Management rule transitioning objects to Coldline or Archive storage after 90 days.
Locking a Bucket Retention Policy enforces immutability and prevents data deletion for the mandated three-year period. Additionally, using Object Lifecycle Management rules automatically shifts objects older than 90 days to colder storage classes (such as Coldline or Archive), meeting cost optimization goals without manual intervention.

Adım Adım Çözüm

1
Enforce immutability requirements
Configuring a bucket retention policy prevents any object deletion or overwrites for the mandatory 3-year period. Locking the policy ensures even bucket administrators cannot lower or remove the restriction.
Regulatory compliance demands immutable log retention.
2
Implement automated storage lifecycle tiering
Adding an Object Lifecycle Management rule checks the Age condition (90 days) and changes the storage class to Coldline or Archive automatically.
Transitions data to lower-cost storage classes once daily operational reliance decreases after 90 days.

Anahtar Kavram

Cloud Storage Bucket Lock and Object Lifecycle Management
Soru 1173Soru

An enterprise application hosted on Compute Engine instances in project `telemetry-prod` needs to publish metrics to a Cloud Pub/Sub topic residing in project `shared-monitoring-prod`. To adhere to security directives requiring keyless identity delegation across projects, the source service account `[email protected]` must obtain short-lived credentials for the target service account `[email protected]`. Which IAM configuration correctly enables this cross-project impersonation while following the principle of least privilege?

Cevabı ve açıklamayı göster

Cevap: Grant the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) to `[email protected]` on the resource `[email protected]`.

Cevap

Grant the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) to `[email protected]` directly on the target service account `[email protected]`.
To configure service account impersonation, the calling identity must be granted the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly on the target service account resource. This setup allows `vm-worker` to generate short-lived tokens for `pubsub-publisher` without requiring static credentials or project-wide administrative rights.

Adım Adım Çözüm

1
Identify the authentication requirement
The application requires short-lived credential generation for keyless identity delegation across two distinct GCP projects.
Security directives explicitly mandate keyless impersonation rather than downloadable service account keys.
2
Select the appropriate IAM role for token generation
The predefined role `roles/iam.serviceAccountTokenCreator` enables an identity to impersonate a target service account by creating short-lived tokens.
This role grants specific permissions such as `iam.serviceAccounts.getOpenIdToken` and `iam.serviceAccounts.signBlob`.
3
Apply the IAM policy at the most granular resource scope
Bind `roles/iam.serviceAccountTokenCreator` directly to `[email protected]` on the resource `[email protected]`.
Granting the role on the specific service account resource instead of the entire project complies with the principle of least privilege.

Anahtar Kavram

Service Account Impersonation via IAM Token Creator Role
Soru 1174Soru

An application developer needs to access and retrieve configuration secrets stored in Google Cloud Secret Manager for a single project named `prod-config-service`. The developer should be able to read secret values and list secret versions, but must not be allowed to modify secret payloads, delete secret versions, or alter IAM access policies. Additionally, enterprise security policy requires following the principle of least privilege and avoiding unnecessary access across the resource hierarchy. Which IAM role assignment strategy should be implemented?

Cevabı ve açıklamayı göster

Cevap: Grant the predefined Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) to the developer on the prod-config-service project.

Cevap

Grant the predefined Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) to the developer on the prod-config-service project.
The Secret Manager Secret Accessor role (roles/secretmanager.secretAccessor) provides read access to secret payloads and secret version metadata. Binding this predefined role specifically at the project resource level fulfills the developer's operational need while adhering strictly to the principle of least privilege.

Adım Adım Çözüm

1
Identify the required service-specific permissions.
The developer requires permission to view secret contents and list versions (secretmanager.versions.access).
The developer only needs read/access rights for secrets, not creation, modification, or IAM management capabilities.
2
Select a role adhering to the principle of least privilege.
The predefined role roles/secretmanager.secretAccessor provides exact permissions for secret payload retrieval without granting unnecessary project-wide access.
Predefined roles target specific service operations, whereas primitive roles (Owner, Editor, Viewer) grant broad permissions across all GCP resources.
3
Determine the minimal appropriate scope in the GCP resource hierarchy.
Bind the role directly on the target project (prod-config-service).
Granting roles at higher hierarchy levels (Folder or Organization) propagates permissions via inheritance to all resources under those levels.

Anahtar Kavram

Applying least-privilege predefined IAM roles at the specific project scope
Soru 1175Soru

A Cloud Engineer needs to export Data Access audit logs from a Google Cloud project to a Cloud Storage bucket for long-term compliance storage. Which of the following configuration steps must be performed to successfully setup this log export? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a Log Router sink in Cloud Logging with a filter for Data Access audit logs, specifying the Cloud Storage bucket as the destination.; Grant the Storage Object Creator role to the writer identity service account generated by the Log Router sink on the destination Cloud Storage bucket.

Cevap

To set up log export to Cloud Storage, you must create a Log Router sink filtering for Data Access audit logs with the bucket destination, and grant the sink's writer identity service account the Storage Object Creator role on that bucket.
Exporting logs via Cloud Logging Log Router requires creating a sink configured with an appropriate log filter and destination, as well as granting the sink's generated writer identity service account the least-privilege role (Storage Object Creator) on the destination bucket.

Adım Adım Çözüm

1
Define the Log Router sink destination and filter
Configures Cloud Logging to route matching audit logs to Cloud Storage
Log Router sinks require a destination target and a log filter query to specify which logs to send.
2
Configure destination permissions for the sink writer identity
Grants the sink's service account permission to write objects to the bucket
The Log Router uses a designated service account (writer identity) that must explicitly be granted the minimal required role (Storage Object Creator) on the target bucket.

Anahtar Kavram

Configuring Cloud Logging Log Router sinks and destination IAM permissions
Soru 1176Soru

An infrastructure administrator needs to enable an external automation tool running on a developer workstation to mint short-lived OAuth 2.0 access tokens for a specific target service account named `[email protected]`. The organization strictly prohibits creating long-lived private key files and mandates enforcing least-privilege access. Which `gcloud` command accurately grants the minimum required permission to the developer user `[email protected]` on the target service account?

Cevabı ve açıklamayı göster

Cevap: gcloud iam service-accounts add-iam-policy-binding [email protected] --member="user:[email protected]" --role="roles/iam.serviceAccountTokenCreator"

Cevap

The command running `gcloud iam service-accounts add-iam-policy-binding` with the target service account email, assigning the `user:[email protected]` the role `roles/iam.serviceAccountTokenCreator` directly on the resource.
The correct command binds the Service Account Token Creator role (`roles/iam.serviceAccountTokenCreator`) directly to the identity on the specific service account resource. This enables token generation and service account impersonation dynamically without requiring static key exports.

Adım Adım Çözüm

1
Identify the authentication requirement and policy constraints.
Short-lived tokens are required without exporting long-lived private key files.
Security mandates impersonation via token generation over exported static service account keys.
2
Determine the least-privilege IAM role for token creation.
The predefined role `roles/iam.serviceAccountTokenCreator` provides permissions to sign blobs/JWTs and mint access tokens.
Using `roles/iam.serviceAccountUser` only allows attaching service accounts to resources, whereas token creation requires `serviceAccountTokenCreator`.
3
Apply the IAM binding directly to the target service account resource.
Executing `gcloud iam service-accounts add-iam-policy-binding` targets the specific service account resource.
Applying the binding at the service account level restricts the identity's permissions exclusively to that single service account rather than project-wide.

Anahtar Kavram

Service Account Impersonation and Token Creation Roles
Soru 1177Soru

A Kubernetes application running on a Google Kubernetes Engine (GKE) cluster requires secure access to objects in a Google Cloud Storage bucket. To follow security best practices and avoid using downloadable service account key files, an engineer must configure Workload Identity. In what sequence should the engineer execute the configuration steps to enable identity delegation for the application?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct operational sequence is to create the Google Cloud Service Account with bucket access permissions first, grant the Workload Identity User role to the Kubernetes Service Account on the GCP Service Account next, annotate the Kubernetes Service Account with the GCP Service Account email third, and finally deploy the Pod configured with the annotated Kubernetes Service Account.
The proper administrative sequence requires provisioning the GCP service account and assigning target bucket access, granting the `roles/iam.workloadIdentityUser` role to the KSA member on that GCP service account, annotating the Kubernetes service account with the GCP service account email, and finally binding the pod spec to the annotated Kubernetes service account.

Adım Adım Çözüm

1
Provision the Google Cloud Service Account (GSA) and assign resource-level IAM roles.
A dedicated GCP identity exists with permissions to access Cloud Storage.
Before delegating identity, the destination GCP service account must exist and hold the required permissions.
2
Bind the Kubernetes Service Account (KSA) identity to the GSA via the `roles/iam.workloadIdentityUser` role.
GCP IAM trusts the specific KSA principal in the GKE Workload Identity pool to impersonate the GSA.
Impersonation requires explicit permission on the GSA resource granted to the KSA member string.
3
Annotate the KSA resource in Kubernetes with `iam.gke.io/gcp-service-account=GSA_EMAIL`.
The GKE control plane and metadata server link the KSA to the GSA email.
The GKE cluster must know which GSA email address to negotiate short-lived tokens for when the pod communicates with GCP APIs.
4
Specify `serviceAccountName: KSA_NAME` in the Pod deployment manifest.
The running pod assumes the annotated KSA identity and seamlessly authenticates to GCP.
The application container relies on the attached KSA to leverage the GKE Metadata Server for keyless authentication.

Anahtar Kavram

GKE Workload Identity configuration sequence
Soru 1178Soru

What is the correct sequential order of administrative steps to configure GKE Workload Identity so that a Pod running in a Kubernetes namespace can access Google Cloud APIs using a dedicated Google Service Account?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct sequence begins by creating the Google Service Account (GSA) with required GCP resource permissions, followed by creating the Kubernetes Service Account (KSA) in the cluster namespace, then adding the IAM policy binding to grant roles/iam.workloadIdentityUser to the KSA on the GSA, and finally annotating the KSA with the GSA email address.
To successfully establish GKE Workload Identity, the GCP service account (GSA) and Kubernetes service account (KSA) must first exist. The GSA must be configured with an IAM binding granting roles/iam.workloadIdentityUser to the KSA principal (`serviceAccount:PROJECT_ID.svc.id.goog[NAMESPACE/KSA_NAME]`). Lastly, the KSA in Kubernetes must be annotated with `iam.gke.io/gcp-service-account=GSA_EMAIL` so the GKE metadata server injects short-lived credentials into Pods running with that KSA.

Adım Adım Çözüm

1
Provision target Google Service Account (GSA)
GSA is created in Google Cloud IAM and assigned resource-level roles (e.g., storage.objectViewer).
The GSA provides the Google Cloud permissions needed by the application.
2
Provision Kubernetes Service Account (KSA)
KSA is defined in the target Kubernetes namespace within the GKE cluster.
The KSA establishes the in-cluster identity for the running workload.
3
Establish IAM binding for Workload Identity
The GSA allows the KSA member principal to assume its identity via the roles/iam.workloadIdentityUser IAM role.
Without this IAM binding, Kubernetes service accounts are not authorized to impersonate the GCP service account.
4
Annotate the KSA
The metadata annotation iam.gke.io/gcp-service-account is set on the KSA pointing to the GSA email.
The GKE metadata server reads this annotation to issue temporary GCP identity tokens to Pods using this KSA.

Anahtar Kavram

Configuring GKE Workload Identity requires creating both Google and Kubernetes service accounts, granting roles/iam.workloadIdentityUser to link the KSA to the GSA, and annotating the KSA with the GSA email address.
Soru 1179Soru

A Cloud Operations team is preparing to deploy an update to a mission-critical web application hosted on Google Cloud Run using the gcloud CLI. Company policy requires that newly deployed container revisions must receive zero percent of live customer traffic immediately upon deployment, allowing quality assurance engineers to smoke-test the revision at its dedicated revision URL before shifting production traffic. Which command flag should the team include when executing gcloud run deploy?

Cevabı ve açıklamayı göster

Cevap: Include the --no-traffic flag during the gcloud run deploy execution.

Cevap

The correct option is to specify the `--no-traffic` flag during the `gcloud run deploy` execution.
When deploying a containerized application using `gcloud run deploy`, Cloud Run by default updates the service traffic routing to send 100% of live traffic to the newly created revision. Providing the `--no-traffic` flag creates the revision while keeping all existing traffic routed to previous revisions, satisfying the smoke-testing requirement.

Adım Adım Çözüm

1
Identify the operational deployment requirement for Cloud Run.
The requirement specifies creating a new revision while withholding live customer traffic (0% traffic allocation).
By default, `gcloud run deploy` shifts 100% of the service traffic to the newly deployed revision.
2
Evaluate gcloud CLI flags for Cloud Run traffic control.
The `--no-traffic` flag deploys the revision without updating the existing traffic splitting percentages.
This allows engineers to test the revision via its unique revision URL or revision tag before manually updating traffic assignments.

Anahtar Kavram

Cloud Run Revision Traffic Splitting and Deployment Flags
Soru 1180Soru

A DevOps team is writing a script to automate the deployment of stateless worker virtual machines using the Google Cloud CLI. The Compute Engine instances must meet two specific operational requirements:
1. Execute a local bash script located at `./scripts/setup-worker.sh` during the initial instance startup.
2. Run under a custom service account named `[email protected]` while explicitly granting the instance full access to all Google Cloud APIs.

Which flag configurations should be included in the `gcloud compute instances create` command to satisfy these requirements? (Select TWO options.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: --metadata-from-file=startup-script=./scripts/setup-worker.sh; [email protected] --scopes=https://www.googleapis.com/auth/cloud-platform

Cevap

The correct configurations are using '--metadata-from-file=startup-script=./scripts/setup-worker.sh' to load the local script into metadata, and '[email protected] --scopes=https://www.googleapis.com/auth/cloud-platform' to attach the custom identity with full Cloud Platform API scope.
To provision a Compute Engine instance with a local startup script, `--metadata-from-file=startup-script=<path>` is required because it reads the local script file and sends its content to the instance metadata server. Additionally, attaching a custom identity and enabling full service access requires `--service-account=<email>` combined with `--scopes=https://www.googleapis.com/auth/cloud-platform`.

Adım Adım Çözüm

1
Identify the flag required to pass a local file script to Compute Engine metadata.
Determine that `--metadata-from-file` must be used with the key `startup-script` so that `gcloud` reads the contents of `./scripts/setup-worker.sh` during command execution.
Using standard `--metadata` passes the literal string path rather than the script file contents.
2
Identify the flags required to attach a custom service account and define API access scopes.
Determine that `--service-account` specifies the service account email address, while `--scopes=https://www.googleapis.com/auth/cloud-platform` grants access across Google Cloud services.
Compute Engine instance creation uses `--service-account` rather than `--iam-account`.

Anahtar Kavram

Compute Engine gcloud CLI Instance Provisioning Flags
ÖncekiSayfa 59 / 80Sonraki
Tüm alıştırma soruları — Google Cloud Associate Cloud Engineer | Examkin