Skip to content

AppThreat/cpggen-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Generate CPG for multiple languages for use with joern

Resources

License

Stars

Watchers

Forks

Packages

No packages published