cartography icon indicating copy to clipboard operation
cartography copied to clipboard

fix(aws): AWS security group rule id fix on the new data model

Open balint-tukacs-tc2 opened this issue 4 months ago • 2 comments

Summary

This PR updates the EC2 security group rules implementation to use AWS's native SecurityGroupRuleId as the unique identifier (instead of a generated one like ruleid = f"{group_id}/{rule_type}/{from_port}{to_port}{protocol}"). This change aligns the data model more closely with AWS's API and simplifies rule identification.

Changes:

  • Updated IpRule node schema to use AWS native ruleid (sgr-*) as the primary identifier
  • Added arn property to store the full ARN of security group rules
  • Added isegress boolean property to IpRule nodes to represent whether rules are inbound or outbound, matching the AWS API response
  • Updated and fixed integration tests to verify the implementation

Related issues or links

Include links to relevant issues or other pages. Screenshot 2025-08-13 at 10 56 32

https://github.com/cartography-cncf/cartography/pull/1680

Checklist

Provide proof that this works (this makes reviews move faster). Please perform one or more of the following:

  • [x] Update/add unit or integration tests.
  • [x] Include a screenshot showing what the graph looked like before and after your changes.
  • [ ] Include console log trace showing what happened before and after your changes.

If you are changing a node or relationship:

If you are implementing a new intel module:

balint-tukacs-tc2 avatar Aug 13 '25 09:08 balint-tukacs-tc2

@achantavy I'll let you review this one, I'm not sure about the impact of these changes on other docs.

jychp avatar Aug 13 '25 19:08 jychp

@achantavy Anything needed from my side? Somehow there are 2 pending checks.

balint-tukacs-tc2 avatar Aug 27 '25 09:08 balint-tukacs-tc2