cartography
cartography copied to clipboard
feat(kube): Add kube service to load balancer relationship
Summary
It would be cool if cartography could find all paths from external LB to pods. Something like:
MATCH path = (lb:LoadBalancerV2)-[:*]->(pod:KubernetesPod)
RETURN path
This PR addressed one piece of the puzzle: it maps KubernetesService nodes with type load balancer to their respective AWS load balancer (ALB or NLB) using hostnames.
More generally:
- https://github.com/cartography-cncf/cartography/pull/2064 captures the Kubernetes-side relationship: Ingress -> Service -> Pod
- Our change captures the cross-cloud relationship: Service -> AWS LoadBalancerV2
- Next step: There should likely exist KubernetesIngress -> LoadBalancerV2 for Ingress-created ALBs
Related issues or links
- https://github.com/cartography-cncf/cartography/pull/2064 The above PR adds KubernetesIngress nodes which are at the L7 layer and create ALBs. KubernetesIngress nodes target KubernetesService nodes.
Checklist
Provide proof that this works (this makes reviews move faster). Please perform one or more of the following:
- [ ] Update/add unit or integration tests.
- [ ] 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:
-
[ ] Use the NodeSchema data model.
-
[ ] Confirm that the linter actually passes (submitting a PR where the linter fails shows reviewers that you did not test your code and will delay your review).