Complete the code to specify the effect of the deny policy.
{
"denyRule": {
"deniedPermissions": ["storage.buckets.delete"],
"denialCondition": {
"expression": "request.time < timestamp('2025-01-01T00:00:00Z')"
},
"[1]": "DENY"
}
}The key effect defines whether the policy denies or allows the specified permissions. For deny policies, it must be set to DENY.
Complete the code to specify the permissions to deny in the deny rule.
{
"denyRule": {
"[1]": ["compute.instances.delete", "compute.instances.stop"]
}
}The key deniedPermissions lists the permissions that the deny policy blocks.
Fix the error in the condition expression to correctly deny before 2024-12-31.
{
"denyRule": {
"deniedPermissions": ["storage.objects.delete"],
"denialCondition": {
"expression": "request.time [1] timestamp('2024-12-31T23:59:59Z')"
}
}
}The expression uses < to deny actions before the specified timestamp.
Fill both blanks to create a deny policy that blocks deleting buckets and objects.
{
"denyRule": {
"[1]": ["storage.buckets.delete"],
"[2]": ["storage.objects.delete"]
}
}Both blanks require the key deniedPermissions to specify the permissions to deny.
Fill all three blanks to create a deny policy with a condition that denies stopping and deleting compute instances before 2025.
{
"denyRule": {
"[1]": ["compute.instances.stop"],
"[2]": ["compute.instances.delete"],
"denialCondition": {
"expression": "request.time [3] timestamp('2025-01-01T00:00:00Z')"
}
}
}Both permission lists use deniedPermissions and the condition uses < to deny before the date.