Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 2.24 KB

README.md

File metadata and controls

79 lines (60 loc) · 2.24 KB

CPG Generator

 ██████╗██████╗  ██████╗
██╔════╝██╔══██╗██╔════╝
██║     ██████╔╝██║  ███╗
██║     ██╔═══╝ ██║   ██║
╚██████╗██║     ╚██████╔╝
 ╚═════╝╚═╝      ╚═════╝

This action wraps CPG Generator (cpggen) a python cli tool to generate Code Property Graph for multiple languages. The generated CPG can be directly imported to Joern for analysis.

Usage

Autodetect languages storing CPGs in a directory called cpg_out

- uses: AppThreat/cpggen-action@main
  with:
    out_dir: "/github/workspace/cpg_out"

Use lang argument to force the language type. Comma separated values are accepted.

- uses: AppThreat/cpggen-action@main
  with:
    out_dir: "/github/workspace/cpg_out"
    lang: java

To export the generated CPGs to dot format, set the environment variable CPG_EXPORT.

- uses: AppThreat/cpggen-action@main
  with:
    out_dir: "/github/workspace/cpg_out"
    lang: java
  env:
    CPG_EXPORT: true

To customize the export representation and format use the environment variables CPG_EXPORT_REPR and CPG_EXPORT_FORMAT. Refer to the source for all supported values.

Optionally, the upload the generated CPGs as build artifacts use the below step.

- name: Upload cpg
  uses: actions/[email protected]
  with:
    name: cpg
    path: cpg_out

Languages supported

Language Requires build
C No
C++ No
Java No (*)
JavaScript No
TypeScript No
Kotlin No (*)
Php No
Python No

(*) - Precision could be improved with dependencies

Environment variables

Name Purpose
AT_DEBUG_MODE Set to debug to enable debug logging

License

Apache-2.0