Description
Summary
The GCP plugin parses relationship-shaped fields in compute resources but does not consistently materialize them as graph edges. Two confirmed gaps are:
GcpAddress.users does not create an instance -> address edge.
GcpInstance.disks[].source does not create an instance -> disk edge.
This leaves graph traversal incomplete and causes selectors or reports that depend on graph edges to miss real GCP relationships.
Impact
- Attached disks can appear disconnected from the instances that use them.
- Reserved or attached addresses can appear unlinked from the instances that consume them.
- Traversal-based queries underreport valid compute relationships.
Affected Files And Changes
plugins/gcp/fix_plugin_gcp/resources/compute.py
- Add
gcp_instance to GcpAddress predecessor metadata.
- Update
GcpAddress.connect_in_graph() to convert users into instance-to-address edges.
- Update
GcpInstance.connect_in_graph() to convert attached disk source links into instance-to-disk edges.
plugins/gcp/test/test_compute.py
- Add regression coverage for address user linkage.
- Add regression coverage for attached disk linkage.
Expected Behavior
GcpAddress.users should create a graph edge from the referenced instance to the address.
GcpInstance.disks[].source should create a graph edge from the instance to each referenced disk.
- Duplicate relationship reports should still resolve cleanly at the graph layer.
Version
v4.3.0
Environment
Docker
Steps to Reproduce
- Collect inventory
- Query for disks attached to an instance: search for is(gcp_disk) with (any, <-- is(gcp_instance))
- Observe that no results are returned when cloud environment has instances with disks attached.
Logs
Additional Context
No response
Description
Summary
The GCP plugin parses relationship-shaped fields in compute resources but does not consistently materialize them as graph edges. Two confirmed gaps are:
GcpAddress.usersdoes not create aninstance -> addressedge.GcpInstance.disks[].sourcedoes not create aninstance -> diskedge.This leaves graph traversal incomplete and causes selectors or reports that depend on graph edges to miss real GCP relationships.
Impact
Affected Files And Changes
plugins/gcp/fix_plugin_gcp/resources/compute.pygcp_instancetoGcpAddresspredecessor metadata.GcpAddress.connect_in_graph()to convertusersinto instance-to-address edges.GcpInstance.connect_in_graph()to convert attached disksourcelinks into instance-to-disk edges.plugins/gcp/test/test_compute.pyExpected Behavior
GcpAddress.usersshould create a graph edge from the referenced instance to the address.GcpInstance.disks[].sourceshould create a graph edge from the instance to each referenced disk.Version
v4.3.0
Environment
Docker
Steps to Reproduce
Logs
Additional Context
No response