Skip to content

Inspect IAM Role Trust Policy with IAM Access Analyzer

0

Hello,

Problem: I need a solution that would inspect the trust policy of any IAM Role that will be Created/Updated and if the assume action will be set for an external identity (any other than my organization ID) to be notified.

Solution: I have developed a solution using EventRule, Lambda and SNS, where the Lambda function will be invoked whenever an IAM Role will be created/updated, and will go through the trust policy of it and send a notification to an SNS topic if it will find any identities outside of the organization.

Everything is fine, but I was wondering if I can do the same with IAM Access Analyzer (only for the above scenario) and I would be interested to understand the pricing consideration as on the landing page of the service it doesn't seem to clear:

Q: Since I'm interested in the analyzer for the "external-access" and not about "unused-access" would that mean that I won't be charged whenever the service will analyze any IAM Role that will be created/updated ?

1 Answer
0

Hello.

As you know, it is possible to inspect the trust policy of an IAM role with IAM Access Analyzer.
https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-resources.html#access-analyzer-iam-role

The function to search for unused IAM roles is paid, but it can be used for free if you just want to check external access like this time.
https://aws.amazon.com/iam/access-analyzer/pricing/?nc1=h_ls

When you enable IAM Access Analyzer, you create an analyzer, which is a resource that continuously evaluates your accounts or AWS organization for either external access or unused access. An analyzer generates access findings for your IAM roles, IAM users, and AWS resources. An external access analyzer creates public and cross-account access findings for resources, and is provided at no additional charge. An unused access analyzer is a paid feature that simplifies inspecting unused access to guide you toward least privilege. With this feature, you pay per IAM role or IAM user analyzed per analyzer per Region per month. IAM roles and users are global, so you can create an analyzer to cover multiple regions.

By the way, if you want to be notified, due to the specifications of IAM Access Analyzer, it is not possible to notify in real time as of December 2024.
https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-concepts.html

It may take up to 30 minutes after a policy is modified for IAM Access Analyzer to analyze the resource and then update the external access finding. Changes to a resource control policy (RCP) do not trigger a rescan of the resource reported in the finding. IAM Access Analyzer analyzes the new or updated policy during the next periodic scan, which is within 24 hours.

EXPERT

answered 2 years ago

  • Hello Riku,

    Thanks for the answer but it doesn’t clarify my question.

    If I will activate the IAM Access Analyzer will it automatically use both functions : “external-access” and “unused access” ?

    The reason I’m asking is because like I said in my initial post, I’m not interested in the “unused-access” service and I would like to use the IAM Access Analyzer only for its free service of “external-access” checker.

    So, if I activate the service, can I use only the “external-access” function? or it will automatically enable the “unused-access” service?

  • If I will activate the IAM Access Analyzer will it automatically use both functions : “external-access” and “unused access” ?

    It will not take effect unless you select “unused access” when creating the analyzer. As shown in the image below, if you select "External access analysis" when creating an analyzer, an "external-access" analyzer will be created. a

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.