-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement(policy, aws): Construct CIDR rules for referenced AWS security groups by querying associated network interfaces #27071
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Could you split up the PR into separate commits where the refactoring is separate from the new additions? This will make it easier to review. For example, the newly defined function could be part of a separate prior commit and then the next could use the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacepants Welcome to the project and thanks for the contribution. Some nits to fix, otherwise LGTM.
Be sure to check out the documentation style guide.
e858458
to
3de457f
Compare
Commit 3de457fde6937b300e2e1da6decff2aee669c85b does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
3de457f
to
72683f6
Compare
Rebased into separate logical commits as requested and updated based on feedback. Thank you! |
Thanks! CI is reporting a couple of things:
|
72683f6
to
e6f4b07
Compare
Thanks, updated! |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for docs
This adds a new getNetworkInterfaceIpsFromFilter function that returns the associated IP address info for a given query filter. Signed-off-by: Paul Bailey <spacepants@users.noreply.github.com>
GetIPsFromGroup now calls getNetworkInterfaceIpsFromFilter for all security group related queries as it provides functionally equivalent info for EC2 instance associated ENIs in addition to ENIs associated with other services. EC2 tag related queries still use getInstancesIpsFromFilter. EC2 client construction is moved upstream to GetIPsFromGroup and the client is plumbed into both getNetworkInterfaceIpsFromFilter and getInstancesIpsFromFilter. Signed-off-by: Paul Bailey <spacepants@users.noreply.github.com>
Signed-off-by: Paul Bailey <spacepants@users.noreply.github.com>
e6f4b07
to
e406e6c
Compare
/test |
👋 Hello!
In the current implementation, Cilium can enforce policies based on AWS metadata by cross-walking referenced security group IDs or names to the IP addresses of EC2 instances associated with matching security groups. This PR extends this functionality to any VPC-enabled service, e.g. RDS, ElastiCache, VPC endpoints, etc. by querying the underlying network interfaces directly.
First time contributor. Please let me know if this need anything else. Thanks!