You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xiaoen-liu opened this issue
Oct 2, 2024
· 3 comments
Labels
analysisRegarding ways to better understand and present data in the graphAWSRelated to cartography's AWS modulebugSomething isn't workingschemaGraph data schema issues
Title: Misuse of iaminstanceprofile in aws_ec2_iaminstance.json due to missing EC2InstanceProfile object
Description:
In aws_ec2_iaminstance.json (found here), Cartography incorrectly assumes a direct connection between the iaminstanceprofile name and the IAM Role. This assumption is not accurate, as AWS uses IamInstanceProfile as a distinct resource that links to a single IAM Role.
The misuse happens because Cartography does not currently create a separate EC2InstanceProfile object, leading to incorrect modeling of the relationship between EC2 Instances and IAM Roles.
Expected behavior:
A separate EC2InstanceProfile object should be created and properly linked to EC2 Instances.
The relationship between the EC2InstanceProfile and its associated IAM Role should be accurately represented, avoiding the incorrect assumption about the name correlation.
The text was updated successfully, but these errors were encountered:
xiaoen-liu
changed the title
[feature request]Misuse of iaminstanceprofile in aws_ec2_iaminstance.json due to missing EC2InstanceProfile object
[Issue report]Misuse of iaminstanceprofile in aws_ec2_iaminstance.json due to missing EC2InstanceProfile object
Oct 2, 2024
@xiaoen-liu - Thanks for reporting, this is a valid issue.
To make sure I understand, the current model is
EC2 Instance ←→ IAM Role
but it should be this instead:
EC2 Instance ←→ IamInstanceProfile ←→ IAM Role
Is this right?
achantavy
added
AWS
Related to cartography's AWS module
bug
Something isn't working
analysis
Regarding ways to better understand and present data in the graph
schema
Graph data schema issues
labels
Oct 2, 2024
Yes, without having the IamInstanceProfile as a separate model, it's not possible to correctly establish the node relationships between EC2 Instances and IAM Roles.
I would like to further clarify the cause of this confusion. The creation of an AWS Instance Profile and the binding of an Instance Profile to an IAM Role are two separate API calls: IAM.Client.create_instance_profile and IAM.Client.add_role_to_instance_profile. These APIs do not require the instance profile name and the IAM role name to have any relationship.
However, the AWS Console design makes it appear as though the instance profile name and the IAM role name are identical, which leads to confusion. This issue becomes more pronounced when using Infrastructure as Code (IaC) tools like Terraform, CloudFormation, or CDK, where instance profile names and IAM role names are often completely different.
This discrepancy can cause significant issues in environments where IaC is used to manage AWS resources, making it important to properly model the distinction between instance profiles and IAM roles.
analysisRegarding ways to better understand and present data in the graphAWSRelated to cartography's AWS modulebugSomething isn't workingschemaGraph data schema issues
Title: Misuse of iaminstanceprofile in aws_ec2_iaminstance.json due to missing EC2InstanceProfile object
Description:
The misuse happens because Cartography does not currently create a separate EC2InstanceProfile object, leading to incorrect modeling of the relationship between EC2 Instances and IAM Roles.
Expected behavior:
A separate EC2InstanceProfile object should be created and properly linked to EC2 Instances.
The relationship between the EC2InstanceProfile and its associated IAM Role should be accurately represented, avoiding the incorrect assumption about the name correlation.
[optional Relevant Links:]
The text was updated successfully, but these errors were encountered: