- Notifications
You must be signed in to change notification settings - Fork1.9k
[Golang] Additional Taint Step hidden in PathGraph Visualisation#20596
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hello, Here is a simplified code snippet for my query, which works like a charm: The problem is, when I click through the steps in the
I need to explicitly reflect in the query results that my taint step contributed to the flow, for my internal SAST metrics/statistics. Thanks for taking time with this! |
BetaWas this translation helpful?Give feedback.
All reactions
You could try in your data-flow configuration specifyingpredicate neverSkip(Node node) -- by default, the edges relation that populates the user-facing graph will skip nodes unless they are join points (have multiple predecessors) or are interprocedural edges.
The names printed in the path explanation refer to nodes, not edges, but you could try something likeclass CustomNamedNode extends DataFlow::Node { ... CustomNamedNode() { ... characterise your node ... } ... override string toString() { ... stringify your node ... }, and ensure your custom node definition is in scope in the context of whatever query produces your path explanation.
Replies: 2 comments 5 replies
-
You could try in your data-flow configuration specifying The names printed in the path explanation refer to nodes, not edges, but you could try something like |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you so much! That helps a lot. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
@smowton Hello, Is there any way to solve it out? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmm, well you could wrap the types involved in the PathGraph's stringcustomToString(PathNoden){ ...your customstringification here ...}newtypeTMyPathNode=TWrapPathNode(PathNodepn)classMyPathNodeextendsTMyPathNode{PathNodepn;MyPathNode(){this=TWrapPathNode(pn)}stringtoString(){result=customToString(pn)ornotexists(customToString(pn))andresult=pn.toString()}PathNodegetPathNode(){result=pn}}querypredicatenodes(MyPathNodempn){ SomeFlow::PathGraph::nodes(mpn.getPathNode())}querypredicateedges(MyPathNodempn1,MyPathNodempn2){ SomeFlow::PathGraph::edges(mpn1.getPathNode(),mpn2.getPathNode())}querypredicatesubpaths(...)// similar |
BetaWas this translation helpful?Give feedback.
All reactions
-
We already make sure that we never skip over steps coming from function models for any configuration. We could do additional taint steps too. There are edge labels for some edges, e.g. those coming from function models or from additional flow steps specified in the flow configuration. For steps coming from Would either of these be helpful,@KseniiaSmirn0va ? Or has@smowton's suggestions already solved your problem? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you,@owen-mc, for the suggestion! Did you mean a new patch is coming out for the feature I need? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Glad to hear your problem is solved. In that case I will not implement the more general solution that I suggested. |
BetaWas this translation helpful?Give feedback.