Skip to content

Manage Admin Roles

Overview

At checkout the broker assigns a Google Workspace admin role to the requesting identity; at checkin it removes the assignment. Use this for time-bound administrative privileges rather than standing group membership. The service account key is stored in AWS Secrets Manager.

Before You Begin

  • The Access Broker is deployed and connected
  • The Admin SDK API enabled and a service account with domain-wide delegation
  • The Admin SDK role ID for the role you want to assign
  • The service account JSON key in AWS Secrets Manager; broker host able to read it

Environment Variables

VariableNotes
GWS_SECRET_NAMEAWS secret holding the Google service account key
GWS_IDENTITYUser email to assign/remove the role
GWS_ROLEAdmin SDK role ID

Checkout / Checkin

Full scripts: Google Workspace/permissions/roles

# checkout — assign role to user (Admin SDK roleAssignments.insert)
# checkin  — remove the role assignment

Configure in Britive

Create the permission

Resource Manager → Resource Type Permissions → New Permission. Language = Shell or Python. Paste the role checkout/checkin routines. Declare GWS_SECRET_NAME, GWS_ROLE (GWS_IDENTITY maps to the requesting user).

Create a profile and policy

Create a profile with a short expiration, set GWS_ROLE, add the permission, and add a policy that requires approval.

Verify

In the Google Admin console, open the user’s Admin roles and privileges — the role appears during checkout and is removed after checkin.

Troubleshoot

SymptomCauseFix
403 assigning the roleService account lacks delegation / role-management scopeGrant domain-wide delegation and the required scopes
Wrong role assignedGWS_ROLE is not the Admin SDK role IDUse the numeric Admin SDK role ID, not the display name
AccessDenied reading secretBroker IAM can’t read the secretGrant secretsmanager:GetSecretValue on GWS_SECRET_NAME

Next Steps

Last updated on