-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust: update docs #19280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Rust: update docs #19280
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more libraries we model (partial support, but then I don't think we can claim to fully model any libraries). Sorry I probably missed a few of these in the list I sent you before.
We also have models for the standard io library coming in #19304 , I should update that PR once this is merged or vice-versa.
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two docs + other changes look great to me!
Some minor suggestions below.
"CodeQL library for Rust" doesn't go into a lot of detail, I think that's OK at this stage, it would be nice to have more example code in future.
I haven't checked the links, references to notes, and generally that everything fits together correctly - we really need a full preview for that and/or to be ready to correct any problems quickly after this goes live.
You should probably get a review from the docs team next?
docs/codeql/codeql-language-guides/analyzing-data-flow-in-rust.rst
Outdated
Show resolved
Hide resolved
exists(Function f, CallExpr call, int index | | ||
call.getArg(index) = node.asExpr().getExpr() and | ||
call.getStaticTarget() = f and | ||
f.getParam(index).getPat().(IdentPat).getName().getText() = "password" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should strongly consider adding helper predicates getParamName
and getArgName
to make code like this a bit cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I already cleaned up getting by index (it was f.getParamList().getParam(index)
), but a getParamByName
seems a good addition too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I noticed that. 👍
Data flow is particularly useful for security queries, where untrusted data flows to vulnerable parts of the program | ||
to exploit it. Related to data flow, is the taint-tracking library, which finds how data can *influence* other values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear what "it" is, and I think these few words are superfluous anyway.
Data flow is particularly useful for security queries, where untrusted data flows to vulnerable parts of the program | |
to exploit it. Related to data flow, is the taint-tracking library, which finds how data can *influence* other values | |
Data flow is particularly useful for security queries, where untrusted data flows to vulnerable parts of the program. Related to data flow is the taint-tracking library, which finds how data can *influence* other values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been addressed yet.
|
||
## Overview | ||
|
||
<!-- autogenerated CWE coverage table will be added below --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm appreciative of the automation here!
docs/codeql/codeql-language-guides/analyzing-data-flow-in-rust.rst
Outdated
Show resolved
Hide resolved
docs/codeql/codeql-language-guides/analyzing-data-flow-in-rust.rst
Outdated
Show resolved
Hide resolved
... | ||
} | ||
|
||
You can use the predicates ``exprNode`` and ``parameterNode`` to map from expressions and parameters to their data-flow node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't think those predicates exist yet.
This should be kept unmerged until we get to the public preview phase.