A thin python interface for joern and a set of useful utility traversals.
- py2neo 2.0.7 (https://py2neo.org/2.0/)
$ sudo pip2 install git+git:https://github.com/fabsx00/python-joern.git
The following is a simple sample script. It connects to the database and runs a gremlin traversal to retrieve all node with attribute 'functionName' set to 'main'.
from joern.all import JoernSteps
j = JoernSteps()
j.setGraphDbURL('https://localhost:7474/db/data/')
# j.addStepsDir('Use this to inject custom steps')
j.connectToDatabase()
res = j.runGremlinQuery('g.idx("nodeIndex")[[functionName:"main"]]')
for r in res:
print r