InfrastructureService accountVerified September 21, 2026
Lutril needs one service account carrying one organization-level custom role to inventory every Google Cloud service account and key, tell you when each was last used, and let you disable the dormant ones. No stack of predefined roles: the custom role below is the complete permission list, verified by creating it. Lutril never deletes service accounts, never creates, rotates or deletes keys, and edits IAM policies only to add or remove the time-boxed bindings of approved access requests.
Remediation (optional): iam.serviceAccounts.disable, iam.serviceAccounts.enable. Without them the inventory still works and the Disable button reports a permission error.
AI role suggestions (optional, Preview): iam.roles.list. Used only to call Google's Policy Assist API with the requester's free-text description; suggestions are always filtered to the roles allowed in the previous scope.
Just-in-time grants (optional): resourcemanager.projects.setIamPolicy. Used only to add and remove one time-boxed binding per approved access request.
Per-secret grants (optional): secretmanager.secrets.get, secretmanager.secrets.getIamPolicy, secretmanager.secrets.setIamPolicy. Used to confirm a secret still exists and to add and remove one time-boxed binding on it. Never secretmanager.versions.access.
Last used values come from Policy Analyzer, which aggregates authentications per day (Pacific time). Google states results may not include very recent authentication events; a lag of several days is common. Google also does not track requests authenticated with bound API keys, Cloud Storage HMAC keys, or Google APIs outside Cloud (for example Workspace domain-wide delegation, as used by GAM): such accounts can show as never used while active. This is why Lutril treats no observed authentication as a warning signal, never as proof of non-use.
Setup steps
1
Create a service account for Lutril in a dedicated project. That project becomes the quota project for Policy Analyzer calls, so keep it separate from your workloads. Open the account, go to Keys, choose Add key, then Create new key with the JSON type. The file downloads once and cannot be downloaded again; you will paste it into Lutril in step 5.
Enable four APIs in that project only: Cloud Asset, IAM, Cloud Resource Manager and Policy Analyzer. Lutril attributes every call to the service account's own project, so Policy Analyzer never needs enabling in the projects being analyzed.
Replace <LUTRIL_PROJECT_ID> with the ID of the project you created the service account in.
3
Create the custom role at organization level from Cloud Shell. ORG_ID is the numeric organization ID shown in the organization picker, or by gcloud organizations list. Prefer the console? Open IAM & Admin, then Roles with the organization selected, click Create role and add the same permissions.
The role is read-only apart from the last two permissions. Drop iam.serviceAccounts.disable and iam.serviceAccounts.enable if you want Lutril to observe without ever remediating.Open Roles
4
Bind the role to the Lutril service account on the organization. One binding covers every folder and project, including the ones created after today.
<LUTRIL_SA_EMAIL> is the address of the account from step 1, ending in .iam.gserviceaccount.com.
5
Optional, for just-in-time access. When an access request for a project is approved, Lutril grants the person a time-boxed IAM role on that project (an IAM condition on request.time) and removes it at the deadline. This needs one write permission on the same role.
Shell
gcloud iam roles update lutrilNhiGovernance \
--organization=<ORG_ID> \
--add-permissions=resourcemanager.projects.setIamPolicy
Bound at the organization, setIamPolicy lets the Lutril service account grant any role on any project. Mitigations: bind the role only on the folder that holds requestable projects, or add an IAM deny policy that blocks resourcemanager.projects.setIamPolicy for roles/owner, roles/editor, roles/iam.securityAdmin and roles/resourcemanager.projectIamAdmin when the principal is the Lutril service account. Lutril itself refuses to grant Owner, Editor or Viewer (they cannot carry a time condition).
6
Optional, for per-secret access. A requester can narrow a project request to one Secret Manager secret: Lutril lists the secrets of each project (through Cloud Asset, already granted above), shows who can read each one on the project page, and on approval writes the time-boxed binding on that secret only, with the Secret Manager Secret Accessor role. This needs three more permissions on the same role.
Shell
gcloud iam roles update lutrilNhiGovernance \
--organization=<ORG_ID> \
--add-permissions=secretmanager.secrets.get,secretmanager.secrets.getIamPolicy,secretmanager.secrets.setIamPolicy
Same caveat as step 5: bound at the organization, secrets.setIamPolicy lets the Lutril service account grant Secret Accessor on any secret. Bind the role on the folder that holds requestable projects if that is too broad. Lutril never asks for secretmanager.versions.access: it reads and writes who may access a secret, never the secret itself. Reads are not shown either: Secret Manager data-access audit logs are off by default and Lutril does not ingest them. Regional secrets are listed as skipped.
7
Optional, for AI role suggestions (Preview). When a requester isn't sure which role to ask for, Lutril can call Google's Policy Assist API so they can describe what they need in plain text and get a suggestion back, drawn only from the roles you already allowed in step 5. This needs a Preview API enabled and one read permission on the same role.
Preview: subject to Google's Pre-GA Offerings Terms, so it can change or be withdrawn without notice. Lutril degrades silently if it becomes unavailable; the ordinary role list keeps working either way. A suggestion can never grant a role outside the allow-list from step 5, whatever it comes back with.
8
In Lutril, open Settings, then Integrations, then Google Cloud. Paste the Service Account JSON. Set the Organization ID for an organization-wide scan (recommended) or a Project ID to scan a single project. Keep the stale key threshold at 90 days unless your policy says otherwise. Turn the Impersonation lens on to list who can impersonate each service account; it costs one extra IAM read per account.
9
Open Non-Human Identities and click Refresh. The sync runs in the background and takes a few minutes on large organizations; the page reports any missing API or permission as a warning. Last used showing Unknown everywhere means Policy Analyzer is not enabled in the Lutril project or its permissions are missing. Projects marked Not synced lack the resourcemanager permissions. Disable failing with a permission error means the role lacks iam.serviceAccounts.disable. Rate limits (429) are retried automatically and previously known data is kept.