You need to write an IAM policy that allows a group named 'NetworkAdmins' to manage all VCN components, but you want to ensure that this policy is only applicable when evaluated from the home region of the tenancy. How can you accomplish this using policy conditions?
Trap 1: IAM policies cannot be restricted by region; they always apply…
IAM policies can be conditioned using request variables like request.region and request.ip.
Trap 2: Use the condition 'where target.region.home = true'
Target region variables in OCI do not support a '.home' property suffix.
Trap 3: Use the condition 'where principal.region = home'
Principal region syntax is incorrect; context variables use the 'request.' prefix for request-time evaluations.
- A
Use the condition 'where request.region = <home-region>'
The request.region condition variable evaluates the region where the request is made, so 'where request.region = <home-region>' restricts the policy's effect to the tenancy's home region. This satisfies the stem's requirement that the policy apply only when evaluated from the home region.
- B
IAM policies cannot be restricted by region; they always apply globally.
Why it fails: IAM policies can be conditioned using request variables like request.region and request.ip.
- C
Use the condition 'where target.region.home = true'
Why it fails: Target region variables in OCI do not support a '.home' property suffix.
- D
Use the condition 'where principal.region = home'
Why it fails: Principal region syntax is incorrect; context variables use the 'request.' prefix for request-time evaluations.