Skip to content

Generating a CPG for a codebase and exporting in .dot format #100

@jsdelfino

Description

@jsdelfino

How do I export a CPG for a codebase and export it in .dot format using Chen?

I am able to do generate a CPG using Joern with the following commands:

# Codebase in ./app, generates ./graph/export/export.dot 
podman run --rm -it -v $(pwd)/app:/app -v $(pwd)/graph:/graph:rw ghcr.io/joernio/joern:nightly joern-parse -o /graph/cpg.bin /app                                                                                                                                                                              
podman run --rm -it -v $(pwd)/app:/app -v $(pwd)/graph:/graph:rw ghcr.io/joernio/joern:nightly joern-export --repr all --format dot --out /graph/export /graph/cpg.bin

Is there an equivalent with Chen, ideally a simple Python API to do something similar?

Additional info:
I'm open to other formats than .dot as long as they're supported by the NetworkX python package.
I don't necessarily need the whole codebase, backward/forward CPG slices around a specific point in the codebase will work for me as well.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions