Skip to content

Commit 703239d

Browse files
[EDI] Exploring data flow with path queries (#59585)
Co-authored-by: Sophie <29382425+sophietheking@users.noreply.github.com>
1 parent 90120e7 commit 703239d

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

content/code-security/how-tos/scan-code-for-vulnerabilities/scan-from-vs-code/exploring-data-flow-with-path-queries.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,21 @@ topics:
99
- Code Security
1010
- Code scanning
1111
- CodeQL
12-
intro: You can run {% data variables.product.prodname_codeql %} queries in {% data variables.product.prodname_vscode %} to help you track the flow of data through a program, highlighting areas that are potential security vulnerabilities.
12+
intro: Detect potential vulnerabilities by running path queries and analyzing your data flow.
1313
redirect_from:
1414
- /code-security/codeql-for-vs-code/exploring-data-flow-with-path-queries
1515
- /code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/exploring-data-flow-with-path-queries
1616
contentType: how-tos
1717
---
1818

19-
## About path queries
19+
## Prerequisites
2020

21-
A path query is a {% data variables.product.prodname_codeql %} query with the property `@kind path-problem`. You can find a number of these in the standard {% data variables.product.prodname_codeql %} libraries.
22-
23-
You can run the standard {% data variables.product.prodname_codeql %} path queries to identify security vulnerabilities and manually look through the results. For more information about how {% data variables.product.prodname_codeql %} tracks data flow, see [About data flow analysis](https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/) in the {% data variables.product.prodname_codeql %} documentation.
24-
25-
Once you're familiar with data flow analysis and existing queries, you can write your own path queries in {% data variables.product.prodname_codeql %}. For more information, see [Next steps](#next-steps).
21+
Before you can effectively use path queries, you should understand the basics of data flow analysis. See [About data flow analysis](https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/) in the {% data variables.product.prodname_codeql %} documentation.
2622

2723
## Running path queries in {% data variables.product.prodname_vscode_shortname %} locally
2824

29-
1. Open a path query in {% data variables.product.prodname_vscode_shortname %}.
30-
1. Right-click in the window with the query open, and select **{% data variables.product.prodname_codeql %}: Run Query on Selected Database**. Alternatively, you can also run this from the {% data variables.product.prodname_vscode_command_palette_shortname %}.
25+
1. Open a path query in {% data variables.product.prodname_vscode_shortname %}. A path query is a {% data variables.product.prodname_codeql %} query with the property `@kind path-problem`.
26+
1. Right-click in the window with the query open, then select **{% data variables.product.prodname_codeql %}: Run Query on Selected Database**. Alternatively, you can also run this from the {% data variables.product.prodname_vscode_command_palette_shortname %}.
3127
1. Once the query has finished running, you can see the results in the "Results" view (under `alerts` in the dropdown menu). Each query result describes the flow of information between a source and a sink.
3228
1. Expand the result to see the individual steps that the data follows.
3329
1. Click each step to jump to it in the source code and investigate the problem further.
@@ -36,8 +32,8 @@ Once you're familiar with data flow analysis and existing queries, you can write
3632

3733
{% ifversion codeql-vs-code-mrva %}
3834

39-
When you are ready to run a path query at scale, you can use the "Variant Analysis Repositories" view to run the query against up to 1,000 repositories on {% data variables.product.prodname_dotcom_the_website %}. For more information, see [AUTOTITLE](/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).
35+
You can use the "Variant Analysis Repositories" view to run a query against up to 1,000 repositories on {% data variables.product.prodname_dotcom_the_website %}. See [AUTOTITLE](/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).
4036

4137
{% endif %}
4238

43-
For information about how to use the correct format and metadata for your own path queries, see [Creating path queries](https://codeql.github.com/docs/writing-codeql-queries/creating-path-queries/#creating-path-queries) in the {% data variables.product.prodname_codeql %} documentation. The {% data variables.product.prodname_codeql %} documentation also contains detailed information about how to define new sources and sinks, as well as templates and examples of how to extend the standard {% data variables.product.prodname_codeql %} libraries to suit your analysis.
39+
To start writing your own path queries, see [Creating path queries](https://codeql.github.com/docs/writing-codeql-queries/creating-path-queries/#creating-path-queries) in the {% data variables.product.prodname_codeql %} documentation.

0 commit comments

Comments
 (0)