Skip to content

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

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Rust: update docs #19280

wants to merge 22 commits into from

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented Apr 11, 2025

This should be kept unmerged until we get to the public preview phase.

@redsun82 redsun82 changed the title Rust: start preparing documentation changes Rust: update supported languages and frameworks Apr 11, 2025
Copy link
Contributor

@geoffw0 geoffw0 left a 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.

aibaars
aibaars previously approved these changes Apr 15, 2025
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
geoffw0
geoffw0 previously approved these changes May 2, 2025
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jun 6, 2025
@github-actions github-actions bot removed the Rust Pull requests that update Rust code label Jun 10, 2025
@redsun82 redsun82 changed the title Rust: update supported languages and frameworks Rust: update docs Jun 10, 2025
@redsun82 redsun82 marked this pull request as ready for review June 12, 2025 15:35
@redsun82 redsun82 requested a review from a team as a code owner June 12, 2025 15:35
@redsun82 redsun82 requested a review from a team as a code owner June 13, 2025 11:03
@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jun 13, 2025
Copy link
Contributor

@geoffw0 geoffw0 left a 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?

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I noticed that. 👍

Comment on lines +42 to +43
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
Copy link
Contributor

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.

Suggested change
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

Copy link
Contributor

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 -->
Copy link
Contributor

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!

...
}

You can use the predicates ``exprNode`` and ``parameterNode`` to map from expressions and parameters to their data-flow node:
Copy link
Contributor

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.

@redsun82 redsun82 added the ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. label Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants