Professional Cloud Security Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A security engineer needs to configure a conditional IAM role binding for an external operations team in Google Cloud. The team requires administrative access to compute resources only during standard working business hours in Germany.
The access must satisfy the following criteria:
Europe/Berlin).Europe/Berlin) so that no access is granted once the clock strikes 17:00:00.Which Common Expression Language (CEL) condition expression should the engineer bind to the IAM policy?
This Common Expression Language (CEL) expression defines a recurring, time-based schedule condition evaluated dynamically against incoming API requests in Google Cloud IAM.
request.time.getDayOfWeek("Europe/Berlin") returns an integer where 1 corresponds to Monday and 7 corresponds to Sunday. The clause >= 1 && <= 5 restricts access strictly from Monday through Friday.request.time.getHours("Europe/Berlin") returns an integer representing the hour in 24-hour notation (from 0 through 23). The integer 16 represents the hour interval 16:00:00 through 16:59:59 (4:00 PM to 4:59 PM). Specifying <= 16 guarantees that as soon as the time becomes 17:00:00, the expression evaluates to false, revoking access immediately at 5:00 PM.&& (AND) operators ensure that all criteria—valid days and valid hours in the designated timezone—must simultaneously be satisfied for the IAM role permissions to be granted.Europe/Berlin).Using request.time.getHours("Europe/Berlin") <= 16 correctly closes access at 4:59:59 PM, avoiding the common error of specifying <= 17, which would inadvertently allow access through 5:59:59 PM.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.