cartography icon indicating copy to clipboard operation
cartography copied to clipboard

feat(gcp): Add Cloud Functions ingestion

Open janithashri opened this issue 4 months ago • 1 comments

feat(gcp): Add Cloud Functions Ingestion and Documentation

Summary

This Pull Request adds support for ingesting Google Cloud Functions (GCF) data into Cartography. It introduces a new ingestion module that discovers Cloud Functions, maps their key properties, and establishes relationships to their parent GCP Projects.

Desired Behavior

Upon running a GCP sync, Cloud Functions will be discovered, and new GCPCloudFunction nodes will be created in the graph, linked to their respective GCPProject nodes via a [:RESOURCE] relationship. Key properties such as name, runtime, status, creation/update times, and trigger details (HTTPS URL, event type/resource) will be stored.

Scenario Enabled

This enables Cartography users to gain comprehensive visibility into their serverless compute resources on Google Cloud. It facilitates asset inventory, aids in security posture assessment (e.g., identifying publicly exposed HTTP functions), and helps understand function dependencies within the overall GCP infrastructure.

Checklist (Proof of Work)

  • [x] Update/add unit or integration tests.
  • [x] Include a screenshot showing what the graph looked like before and after your changes.
  • [x] Include console log trace showing what happened before and after your changes.

If you are changing a node or relationship:

  • [x] Update the schema and readme. (Schema documentation added directly to docs/root/modules/gcp/schema.md and linked from docs/root/usage/schema.md.)

If you are implementing a new intel module:

  • [x] Use the NodeSchema data model. (Defined GCPCloudFunctionNode schema in cartography/models/gcp/gcf.py.)

Proof of Work:

pc1 pc2

Console Log Trace:

pc3

janithashri avatar Aug 06 '25 16:08 janithashri

Hi @d-aggarwal and @achantavy,

This is the new, clean pull request for the GCP Cloud Functions feature.

I've closed the old PR (#1744) to resolve the messy git history and start fresh from a dedicated feature branch. This new version contains the final, correct code and incorporates all the feedback you both provided.

It should be ready for a final review when you have a moment. Thank you for your patience and guidance!

janithashri avatar Aug 06 '25 16:08 janithashri