- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
05-03-2023 05:03 PM - edited 05-03-2023 05:07 PM
Security administrators can use Google Cloud IAM to control who can access resources within a Google Cloud organization. However, companies may require the ability to restrict access to resources and APIs that reside in different Google Cloud organizations.
The combination of Palo Alto Networks URL filtering and Google Cloud organization restrictions, enables security teams to restrict employee access to sanctioned Google Cloud organizations. The capability provides a variety of security benefits including, preventing insider attacks and also stopping data exfiltration.
There are many use-cases for organization restrictions, for example:
The diagram below shows the required components to enforce organization restrictions. When a managed device accesses a Google Cloud resource, the URL Filtering profile defined within the security policy, inserts the value for the organization restrictions header, X-Goog-Allowed-Resources
.
The network security administrator of Organization A
, wants to allow employee access to resources hosted in their Google Cloud organization. All employee access to cloud resources hosted in all other Google Cloud organizations should be denied.
A cloud and network security administrator for Organization A
perform the following steps to implement organization restrictions.
Organization A
.gcloud organizations list
(output)DISPLAY_NAME: Organization A
ID: 0123456
DIRECTORY_CUSTOMER_ID: a1b2c3d4
X-Goog-Allowed-Resources
, and save it to a file named authorized_orgs.json
. Please see configure organization restrictions for complete information on constructing the value for the header.{
"resources": ["organizations/0123456"],
"options": "strict"
}
cat authorized_orgs.json | basenc --base64url -w0
(output)fdsasdfInJlc291cmNlasjdfaJnYW5pemF0ay8xMjM0NTY3ODkiXSwKICJvcHRpb25zIjogInN0cmljdCIKfQo
X-Goog-Allowed-Resources
The organization restrictions are applied for access to the Google Cloud APIs and Google Cloud console. On a managed device that has access to both Organization A
and Organization B
, perform the following to test the organization restrictions feature.
Organization A
and Organization B
.Even though the user account on the managed device has access to
Organization A
and Organization B
, only Organization A
appears in the Google Cloud Console. This is because the URL Filtering profile inserts the organization restriction header to enable Google Cloud to block the user from accessing other organizations.org-a-project
) that belongs to Organization A
.
The request should show a successful return of the log entries within the Google Cloud project belonging to Organization A
.
TOKEN=$(gcloud auth print-access-token)
curl -X POST -d '{"projectIds": ["org-a-project"]}' -H 'Content-Type: application/json' -H "Authorization: Bearer ${TOKEN}" "https://logging.googleapis.com/v2/entries:list"
(output){
[
<..redacted..>
]
nextPageToken": "EAB<..redacted..>RsAB"
}
Organization A
.
The request should show a failed return to the Google Cloud project that does not belong to Organization A
. This is because the URL filtering profile inserted the organization restriction header into the request of the managed device.
curl -X POST -d '{"projectIds": ["org-b-project"]}' -H 'Content-Type: application/json' -H "Authorization: Bearer ${TOKEN}" "https://logging.googleapis.com/v2/entries:list"
(output){
"error": {
"code": 403,
"message": "Access denied by organization restriction. Please contact your
administrator for additional information.",
"status": "PERMISSION_DENIED",
"details": [{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ORG_RESTRICTION_VIOLATION",
"domain": "googleapis.com",
"metadata": {
"consumer": "projects/01234567890",
"service": "logging.googleapis.com"
}
}]
}
}