Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Security Engineer practice bank has 1,343 more like it. Try 10 free: instant score, no account.
A security engineer must configure temporary, schedule-restricted access for a third-party security auditor in a specific Google Cloud project. The access policy must satisfy the following criteria:
roles/iam.securityReviewer).Europe/Berlin time zone.2025-12-31T23:59:59Z).Which Common Expression Language (CEL) IAM condition and policy structure should the security engineer implement?
Set policy version: 3 and add a condition with the expression:
resource.time < timestamp('2025-12-31T23:59:59Z') && resource.time.schedule('Europe/Berlin', 9, 17, [1,2,3,4,5])
This option attempts to use non-existent CEL functions (resource.time.schedule) and incorrect attribute prefixes (resource.time) to enforce schedule-based access.
request attribute (specifically request.time), not resource.time. The resource attribute namespace is used for attributes like resource.type, resource.name, or resource.service.schedule(). Schedules must be constructed using integer comparisons on request.time.getHours() and request.time.getDayOfWeek().request.time.request.time include .getHours(time_zone), .getDayOfWeek(time_zone), and timestamp comparisons.Google Cloud IAM supported custom aggregated schedule macros in the resource namespace.
Set policy version: 1 and add a condition with the expression:
request.time < timestamp('2025-12-31T23:59:59Z') && request.time.getHours('Europe/Berlin') >= 9 && request.time.getHours('Europe/Berlin') <= 17 && request.time.getDayOfWeek('Europe/Berlin') >= 1 && request.time.getDayOfWeek('Europe/Berlin') <= 5
This option defines the correct CEL expression for time and schedule evaluation but specifies policy version: 1 in the IAM policy payload.
version: 1 do not support conditional bindings. When submitting an allow policy containing a condition block with version: 1 via the Resource Manager API or gcloud projects set-iam-policy, the API will reject the request with an invalid argument error or fail to parse conditions.version: 3.version: 1 only supports standard unconditional bindings.version: 3 is required whenever conditional bindings (condition field) are present in the allow policy.The Google Cloud Resource Manager API permitted conditional bindings under legacy version: 1 policies without schema version upgrades.
Set policy version: 3 and add a condition with the expression:
request.time < timestamp('2025-12-31T23:59:59Z') && request.time.getHours('Europe/Berlin') >= 9 && request.time.getHours('Europe/Berlin') <= 17 && request.time.getDayOfWeek('Europe/Berlin') >= 1 && request.time.getDayOfWeek('Europe/Berlin') <= 5
This configuration applies an IAM Condition to a role binding using Common Expression Language (CEL) attributes, while setting the IAM allow policy schema version to version: 3.
request.time < timestamp('2025-12-31T23:59:59Z') validates that any incoming request occurs before the absolute deadline.request.time.getHours('Europe/Berlin') >= 9 && request.time.getHours('Europe/Berlin') <= 17 restrict access to the designated operational window between 09:00 and 17:00 in the specified time zone.request.time.getDayOfWeek('Europe/Berlin') >= 1 && request.time.getDayOfWeek('Europe/Berlin') <= 5 ensure that access is permitted only Monday (1) through Friday (5).version: 3 to support and evaluate conditional role bindings. If the policy version is set to 1, conditions cannot be preserved or evaluated.This approach directly satisfies least privilege and time-bounded compliance requirements in a single, declarative policy binding without requiring external automation scripts or manual interventions.
version: 3 and configure Privileged Access Manager (PAM) with a permanent role binding containing the CEL expression request.duration < duration('8h').This option attempts to use Privileged Access Manager (PAM) with a permanent role binding and an invalid CEL duration expression on request.
request.duration attribute in standard IAM conditions; request time constraints evaluate instantaneous timestamps via request.time.Europe/Berlin.The scenario required an interactive self-service privilege request workflow with manual manager approvals rather than a purely declarative schedule-bound IAM condition.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated