ThreatMapper icon indicating copy to clipboard operation
ThreatMapper copied to clipboard

[V2] Topology Cloud table displays internet as a node

Open milan-deepfence opened this issue 1 year ago • 4 comments

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:

  1. Go to Topology view
  2. Click on Table view mode
  3. You will see internet has a name in a row
  4. Click on it and row vanish away

Expected behavior Internet row presence seems not necessary

Screenshots Screenshot 2023-07-18 at 6 00 04 PM Screenshot 2023-07-18 at 6 00 16 PM

Components/Services affected

  • [ ] UI/Frontend
  • [x] API/Backend
  • [ ] Agent
  • [ ] Deployment/YAMLs
  • [ ] CI/CD Integration
  • [ ] Other (specify)

milan-deepfence avatar Jul 18 '23 12:07 milan-deepfence

Yes, we need not show a row for internet.

shyam-dev avatar Jul 19 '23 18:07 shyam-dev

@shyam-dev this needs to be fixed from the API side

manV avatar Jul 20 '23 03:07 manV

@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

image

gnmahanth avatar Jul 21 '23 15:07 gnmahanth

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.

noboruma avatar Jul 21 '23 15:07 noboruma