Skip to main content

Non-human identities from AWS

Besides certificates and keys, the Amazon Web Services collector adds the IAM roles and IAM users that software uses to your non-human identity inventory in Mesh. It also shows who owns them and which workloads run as them.

This page covers what you see and what each part needs. The collector itself is set up as described in Amazon Web Services. In the connector list it appears as Crypto Cloud AWS.

What you see in Mesh​

In MeshWhat it showsWhat it needs
Workload identities listIAM roles that an AWS service or an OIDC provider can assumeThe IAM permissions and usage switch
Service accountsIAM users with no console password and at least one active access keyThe IAM permissions and usage switch and the credential report permissions below
OwnersThe owners named in your resource tagsThe Owner tag keys field
Permission flowThe EC2 instances, Lambda functions and ECS services that run as each roleThe Workload identities switch and the read permissions below

Roles used only for SAML or single sign-on, and AWS service-linked roles, are not listed.

Owners from tags​

Mesh reads owners from the tags on each role and user. The Owner tag keys field lists the tag keys to read. If you leave it empty, Mesh reads Owner, then owner.

To give an owner a role, add =ROLE after the key. The role can be BUSINESS, TECHNICAL or SECURITY. A key with no role gives an owner whose role is unspecified.

Owner,CostOwner=BUSINESS,OpsOwner=TECHNICAL

Each key found on a role or user becomes its own owner. If the tag value names an IAM user or group in the same AWS account, Mesh links to it. Any other value, such as an email address or a team name, is kept as written and shows as unresolved.

Deleted roles and users​

Mesh marks a role or user deleted only after a collection that read your IAM data in full, and that read counts as complete only when the credential report was read. Without the credential report permissions below, roles that left AWS stay in Mesh. AWS can reuse a credential report for up to four hours, so a user you delete can still appear for that long.

Workloads and the roles they run as​

With the Workload identities switch on, Mesh links:

  • each EC2 instance to the role of its instance profile;
  • each Lambda function to its execution role;
  • each ECS service to its task role.

The links appear in the Permission flow tab of the role.

The Permission flow tab of an AWS role, showing the EC2 instance that runs as the role and the evidence that each end was collected

Mesh finds the role behind an instance profile from the IAM data it reads when IAM permissions and usage is on, so the EC2 link needs no extra IAM permission. It needs that read to have completed.

Permissions to add​

Grant these permissions to the IAM role that Mesh assumes when you set Role to use. If you leave that field empty, grant them to the IAM user or role whose access key Mesh uses. When Mesh assumes a role, the access-key user also needs sts:AssumeRole on that role, as described in Amazon Web Services. The EC2, Lambda and ECS permissions are needed only if you turn on the Workload identities switch, and they apply in every Region the collector reads.

PermissionUsed for
iam:GetAccountAuthorizationDetailsIAM roles, users and their policies. Needed whenever IAM permissions and usage is on
iam:GenerateServiceLastAccessedDetails, iam:GetServiceLastAccessedDetailsWhen each role and user last used an AWS service. Needed whenever IAM permissions and usage is on
ec2:DescribeInstancesEC2 instances
lambda:ListFunctionsLambda functions
ecs:ListClusters, ecs:ListServices, ecs:DescribeServices, ecs:DescribeTaskDefinitionECS services and their task roles
iam:GenerateCredentialReport, iam:GetCredentialReportNon-human IAM users. Without both, these users are not shown

A permission you do not grant skips only its own part. The connector then shows Partial and says what to allow. An explicit deny, a permissions boundary or an organization service control policy can also block a permission.

Turn the options on in Mesh​

  1. On the Connectors page, open the row menu of your Amazon Web Services connector and choose Edit.
  2. On the Collection tab, turn on IAM permissions and usage.
  3. To show which workloads run as each role, also turn on Workload identities. It is off by default.
  4. To read owners, enter the tag keys in Owner tag keys on the Advanced tab.
  5. Save the connector.

The Collection tab of the Edit panel, showing the IAM permissions and usage and Workload identities switches

After the first collection, your roles and users appear under Non-human identities.

Troubleshooting​

SymptomLikely causeWhat to do
No roles or users appearIAM permissions and usage is offTurn the switch on
No roles or users appear although the switch is onA permission in Permissions to add is missing, most often iam:GetAccountAuthorizationDetails. The connector shows PartialGrant it to the identity Mesh reads AWS as, and wait for the next collection
No Permission flow linksThe Workload identities switch is offTurn the switch on
No service accounts from IAM usersMesh could not read the IAM credential reportAdd iam:GenerateCredentialReport and iam:GetCredentialReport
The connector shows PartialA permission is missingRead the reason shown and add the permission
A role has no ownerNo tag matches Owner tag keysAdd the tag in AWS, or add its key to the field
An owner shows as unresolvedThe tag value is not an IAM user or group in the same accountUse an IAM user or group name, or accept the value as written
A workload has no Permission flow linkAn EC2, Lambda or ECS permission is missingAdd it and wait for the next collection