From ad35c014624d094385860ca825c777736d6da9a5 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Wed, 10 Mar 2021 16:38:00 +0100 Subject: [PATCH] Python: purge old references --- .vscode/settings.json | 3 +- .../codeql-library-for-python.rst | 35 ------------------- .../about-data-flow-analysis.rst | 9 +++-- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b467b469f22..8897b69a721 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "omnisharp.autoStart": false + "omnisharp.autoStart": false, + "restructuredtext.confPath": "${workspaceFolder}/docs/codeql" } \ No newline at end of file diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-python.rst b/docs/codeql/codeql-language-guides/codeql-library-for-python.rst index 17987b8aa75..a07175367de 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-python.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-python.rst @@ -20,7 +20,6 @@ The CodeQL library for Python incorporates a large number of classes. Each class - **Syntactic** - classes that represent entities in the Python source code. - **Control flow** - classes that represent entities from the control flow graphs. -- **Type inference** - classes that represent the inferred values and types of entities in the Python source code. Syntactic classes ----------------- @@ -290,40 +289,6 @@ The classes in the control-flow part of the library are: - `BasicBlock `__ – A non branching list of control-flow nodes. -Type-inference classes ----------------------- - -The CodeQL library for Python also supplies some classes for accessing the inferred types of values. The classes ``Value`` and ``ClassValue`` allow you to query the possible classes that an expression may have at runtime. - -Example -^^^^^^^ - -For example, which ``ClassValue``\ s are iterable can be determined using the query: - -**Find iterable "ClassValue"s** - -.. code-block:: ql - - import python - - from ClassValue cls - where cls.hasAttribute("__iter__") - select cls - -➤ `See this in the query console on LGTM.com `__ This query returns a list of classes for the projects analyzed. If you want to include the results for ``builtin`` classes, which do not have any Python source code, show the non-source results. For more information, see `builtin classes `__ in the Python documentation. - -Summary -^^^^^^^ - -- `Value `__ - - - ``ClassValue`` - - ``CallableValue`` - - ``ModuleValue`` - -For more information about these classes, see ":doc:`Pointer analysis and type inference in Python `." - - Further reading --------------- diff --git a/docs/codeql/writing-codeql-queries/about-data-flow-analysis.rst b/docs/codeql/writing-codeql-queries/about-data-flow-analysis.rst index 71fd639069e..2c1504dd668 100644 --- a/docs/codeql/writing-codeql-queries/about-data-flow-analysis.rst +++ b/docs/codeql/writing-codeql-queries/about-data-flow-analysis.rst @@ -3,7 +3,7 @@ About data flow analysis ######################## -Data flow analysis is used to compute the possible values that a variable can hold at various points in a program, determining how those values propagate through the program and where they are used. +Data flow analysis is used to compute the possible values that a variable can hold at various points in a program, determining how those values propagate through the program and where they are used. Overview ******** @@ -20,13 +20,13 @@ See the following tutorials for more information about analyzing data flow in sp - ":ref:`Analyzing data flow in C# `" - ":ref:`Analyzing data flow in Java `" - ":ref:`Analyzing data flow in JavaScript/TypeScript `" -- ":ref:`Analyzing data flow and tracking tainted data in Python `" +- ":ref:`Analyzing data flow in Python `" .. pull-quote:: Note - Data flow analysis is used extensively in path queries. To learn more about path queries, see ":doc:`Creating path queries `." + Data flow analysis is used extensively in path queries. To learn more about path queries, see ":doc:`Creating path queries `." .. _data-flow-graph: @@ -78,11 +78,10 @@ The normal data flow libraries are used to analyze the information flow in which For example, if you are tracking an insecure object ``x`` (which might be some untrusted or potentially malicious data), a step in the program may 'change' its value. So, in a simple process such as ``y = x + 1``, a normal data flow analysis will highlight the use of ``x``, but not ``y``. However, since ``y`` is derived from ``x``, it is influenced by the untrusted or 'tainted' information, and therefore it is also tainted. Analyzing the flow of the taint from ``x`` to ``y`` is known as taint tracking. -In QL, taint tracking extends data flow analysis by including steps in which the data values are not necessarily preserved, but the potentially insecure object is still propagated. +In QL, taint tracking extends data flow analysis by including steps in which the data values are not necessarily preserved, but the potentially insecure object is still propagated. These flow steps are modeled in the taint-tracking library using predicates that hold if taint is propagated between nodes. Further reading *************** - ":ref:`Exploring data flow with path queries `" -