Skip to Content
LutrilDocs
App guides

AWS

Lutril inventories IAM users, IAM roles and access keys across every account of your AWS Organization, maps accounts and OUs, and grants just-in-time access through IAM Identity Center account assignments.

One IAM user (or role) for Lutril in the management account, plus one read-only role per member account.

Steps

  1. Create an IAM user for Lutril in your management account (no console access) and an access key. Paste the Access Key ID and Secret Access Key in Lutril's AWS connect form. Attach the management policy below to it.

    Open IAM users

  2. Management policy: Organizations reads plus permission to assume the member role in every account.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "organizations:ListAccounts",
            "organizations:DescribeAccount",
            "organizations:DescribeOrganization",
            "organizations:ListRoots",
            "organizations:ListOrganizationalUnitsForParent",
            "organizations:ListAccountsForParent",
            "organizations:DescribeOrganizationalUnit",
            "account:ListRegions",
            "sts:GetCallerIdentity"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": "sts:AssumeRole",
          "Resource": "arn:aws:iam::*:role/LutrilRole"
        }
      ]
    }

    If the Lutril user lives outside the management account, create a LutrilOrgReader role in the management account with this policy instead, trust the Lutril user with the External ID shown in the connect form (Condition StringEquals sts:ExternalId), and set its ARN as Management role ARN in Lutril.

  3. Create a read-only LutrilRole in every member account (CloudFormation StackSets deploys it org-wide in one operation). Trust policy: the management account (or the LutrilOrgReader role). Permissions:

    Open StackSets

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "iam:GetAccountAuthorizationDetails",
            "iam:GenerateCredentialReport",
            "iam:GetCredentialReport",
            "iam:ListAccessKeys",
            "iam:GetAccessKeyLastUsed"
          ],
          "Resource": "*"
        }
      ]
    }

    These five actions cover users, roles, role last-used, key age and key last-used. Accounts invited into the organization do not carry OrganizationAccountAccessRole automatically: deploy LutrilRole there too, or those accounts appear with a warning and an empty inventory.

  4. Optional, for Identity Center inventory and just-in-time grants: attach the Identity Center policy to the Lutril user (or LutrilOrgReader), and set the Identity Center region in the connect form. Lutril grants access by creating an account assignment (user, permission set, account) and removes it at the deadline; assignments have no native expiry in AWS.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "IdentityCenterRead",
          "Effect": "Allow",
          "Action": [
            "sso:ListInstances",
            "sso:ListPermissionSets",
            "sso:DescribePermissionSet",
            "sso:ListPermissionSetsProvisionedToAccount",
            "sso:ListAccountAssignments",
            "identitystore:ListUsers",
            "identitystore:DescribeUser",
            "identitystore:GetUserId"
          ],
          "Resource": "*"
        },
        {
          "Sid": "JustInTimeGrants",
          "Effect": "Allow",
          "Action": [
            "sso:CreateAccountAssignment",
            "sso:DeleteAccountAssignment",
            "sso:DescribeAccountAssignmentCreationStatus",
            "sso:DescribeAccountAssignmentDeletionStatus",
            "sso:ProvisionPermissionSet"
          ],
          "Resource": "*"
        },
        {
          "Sid": "IdentityCenterRoleProvisioning",
          "Effect": "Allow",
          "Action": [
            "iam:GetSAMLProvider",
            "iam:CreateRole",
            "iam:AttachRolePolicy",
            "iam:PutRolePolicy",
            "iam:ListRolePolicies",
            "iam:ListAttachedRolePolicies"
          ],
          "Resource": "arn:aws:iam::*:role/aws-reserved/sso.amazonaws.com/*"
        }
      ]
    }

    The third statement is scoped to the roles Identity Center creates for itself (aws-reserved/sso.amazonaws.com): the first time a permission set reaches an account, AWS provisions that role, and without these actions the first grant on a fresh account fails. Scoping the path is what keeps this from being a general role-creation permission. Tighter still: limit the JustInTimeGrants statement's Resource to the permission set ARNs and account ARNs Lutril may grant, so AdministratorAccess or the management account are excluded outright. Identity Center admin APIs must be called from the management account or a delegated administrator, in the region where Identity Center is enabled.

  5. In Lutril, open Settings, then Integrations, then AWS. Paste the access key, set the region, the member role name (default LutrilRole), the Identity Center region if used, and optionally the Management role ARN. The External ID to put in the trust policy is displayed in the form.

    Open Lutril integrations

  6. Open Non-Human Identities and click Refresh. The sync walks every active account (a few minutes on large organizations) and lists warnings per account it could not reach. Accounts become requestable access levels of the AWS catalogue app for just-in-time grants.

On this page