-
Overview
- Manages access control by defining WHO can do WHAT on WHICH RESOURCE
- WHO = member, Can do what = ROLE, On which resource = RESOURCE
- Grants granular access to specific resources
- Prevents unwanted access to other resources
- Assign only the priviledges essential for performing intended action
- Enables the implementation of principle of least priviledge
-
Members
-
Accounts
- Google Account or Cloud Identity user is email address associated with a Google account
- Service Account is an account belonging to an application
-
Cloud Identity Domain
- Similar to Google Workplace domain
- Represents all Google accounts in an organization
- No access to Google Workplace applications
- Existing LDAP directory services can sync with Cloud Identity
-
Google Group
- Collection of Google accounts
- Represented by email address (googlegroups@company.com)
- Enables a single policy to be applied to a group of users
- Not used to establish individual identity. Has no credentials
- Can include Service Accounts
-
allAuthenticatedUsers
- Special identifier for any GCP account
- Not available with every service
- Anonymous users are not included
-
allUsers
- A special identifier for all users
- Includes anonymous users
- Not available with every service
-
Roles
-
Overview
- Represents the WHAT in IAM
- Collection of permissions
- Roles are assigned to users, which bundles one or more permissions
- Permissions not granted directly to users
-
Primitive
- Broad, original Google Cloud role
- Applies across entire project
- Owner, Editor and Viewer
- Owner role includes permissions in Editor role
- Editor role includes permissions in Viewer role
- Owner can modify all resources, and manage IAM and billing
- Editor can modify all resources, no access to IAM and billing
- Viewer can view resources, but cannot make changes
-
Predefined
- More granular/specific access, not across entire project
- Created and maintained by Google
- Automatically updated when features and services are added
- Applies to a single service
- Aligned to job functions
-
Custom
- More granular than Predefined Roles
- Not maintained by Google or updated automatically
- Used when predefined roles are not specific enough
-
Least Priviledge
- Apply the minimal access level required
- Use predefined roles over primitive roles
- Be cautious with Owner roles
-
Resource
- Represents the WHICH RESOURCE component
- Compute Engine instance, Cloud Storage Bucket etc
- Resource includes Organization, Folders, Projects, Services
-
Service Accounts
-
Overview
- Special Google account belonging to an application
- Application has no need for user authentication
- Authentication is between application and services
- Application identified by service account email address
- Service accounts are granted permissions to a resource
- Users are granted the serviceAccountUser role
- Service accounts are both a member, WHO, and a resource, WHAT
-
Google Managed
- Represents different Google services
- Automatically granted IAM roles
- e.g. PROJECT_NUMBER-compute@cloudservices.gserviceaccount.com
-
User Managed
- Created for/by the user
- Based on enabled APIs in project
- e.g. PROJECT_NUMBER-compute@developer.gserviceaccount.com
-
Scopes
- Legacy method of granting permissions
- Used by instances using default service accounts
- Grants per instance permissions to other GCP resources
- IAM roles or scopes determines instance permissions
-
Key
- Service account access is governed by keys
- Default service account keys are managed by Google
- Custom service accounts can use user managed keys
- User is responsible for managing key pair
- Google maintains a public copy for verification
- Private key cannot be retrieved by Google
-
Recommendations
- Rotate user-managed service account keys
- Do not delete service accounts in use
- Name service accounts to reflect use and permissions
- Do not check-in service account keys into source code or leave in download directory
-
Least Priviledge
- When using ServiceAccounts treat each app component as a separate trust boundary
- Create a separate service account for each service
- Restrict service account access
- Restrict who can create and manage service accounts
-
Policies
- Policies are needed to grant roles
- Collection of statements that defines who has what type of access
- Attached to a resource to define access control rules
- Expressed by an IAM policy object
- IAM policy object consists of a list of bindings
- A binding binds a list of members to a role