[Java] How to generate models automatically ("df-generated") #18018
Replies: 1 comment
-
Yes, we do have such a tool, which is mostly for internal use, but you are more than welcome to use it (feedback is also highly appreciated). You can use the tool in the following way (it requires that you have python3 GenerateFlowModel.py --with-mixed-summaries --with-sources --with-sinks <path to db> The above command generates summaries, but also tries to extrapolate sources and sinks (from existing sources and sink). python3 GenerateFlowModel.py --help |
Beta Was this translation helpful? Give feedback.
-
From different PRs, e.g. #17547 I know that GitHub has different generators to automatically generate models instead of having to manually create models via the model editor.
I've found https://github.com/github/codeql/tree/main/java/ql/automodel/src, but this appears to not be usable without being GitHub staff due to it using internal repositories like https://github.com/github/codeml-automodel.
I'm also not sure whether codeml-automodel is what I'm looking for; I don't think it is.
I'd appreciate if someone could shine some light on whether it is possible as an external user to automatically model dependencies.
EDIT: After searching for
"df-generated"
(and restricting results toCodeQL
), I've foundcodeql/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll
Line 336 in b622c6e
codeql/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll
Line 19 in b622c6e
ModelGeneratorImpl
) which ultimately brought me to this:https://github.com/github/codeql/tree/b622c6e9cafa4d95f536646a0fea3ee38aee4680/java/ql/src/utils/modelgenerator
However there is no (explicit) documentation.
Given a CodeQL db, how can I generate models for it automatically using the queries in the folder?
Beta Was this translation helpful? Give feedback.
All reactions