ThreatMapper
ThreatMapper copied to clipboard
[V2] Topology Cloud table displays internet as a node
Describe the bug Topology cloud table has an entry for internet however clicking on it removes its row appearance
To Reproduce Steps to reproduce the behavior:
- Go to Topology view
- Click on Table view mode
- You will see internet has a name in a row
- Click on it and row vanish away
Expected behavior Internet row presence seems not necessary
Screenshots
Components/Services affected
- [ ] UI/Frontend
- [x] API/Backend
- [ ] Agent
- [ ] Deployment/YAMLs
- [ ] CI/CD Integration
- [ ] Other (specify)
Yes, we need not show a row for internet.
@shyam-dev this needs to be fixed from the API side
@ramanan-ravi @noboruma @shyam-dev this query returns internet as cloud provider node, not sure why is there as cloud provider internet
https://github.com/deepfence/ThreatMapper/blob/49c946a6e82a0f30883e5d7cfdb18a67b32e8790/deepfence_server/reporters/graph/topology_reporter.go#L518
This is caused by the linking task which extracts and attaches cloud providers asynchronously. To prevent that, we need to filter out the internet Node directly from the cronjob job associated with linking. A simple WHERE clause should suffice.
Context: internet nodes are added when we initialize the DB. Previously cloud providers were added at the same time as nodes were added. It was a sync process that never happened for internet nodes as their addition is treated specially. Now that the process is async, it applies to any nodes.