Add draft introductions and create map topic for Python

This commit is contained in:
Felicity Chapman
2020-02-12 16:38:23 +00:00
parent bcb4759b6a
commit 8db3651dfd

View File

@@ -8,30 +8,33 @@ CodeQL for Python
introduce-libraries-python
functions
statements-expressions
control-flow
control-flow-graph
taint-tracking
pointsto-type-infer
control-flow
taint-tracking
The following tutorials and worked examples are designed to help you learn how to write effective and efficient queries for Python projects. You should work through these topics in the order displayed.
Experiment and learn how to write effective and efficient queries for Python projects.
- `Basic Python query <https://lgtm.com/help/lgtm/console/ql-python-basic-example>`__ describes how to write and run queries using LGTM.
:doc:`CodeQL libraries for Python <introduce-libraries-python>`
---------------------------------------------------------------
Overview of the standard CodeQL libraries for writing CodeQL queries on Python code.
- :doc:`Introducing the CodeQL libraries for Python <introduce-libraries-python>` introduces the standard libraries used to write queries for Python code.
:doc:`Functions in Python <functions>`
--------------------------------------
Functions are key building blocks of Python code bases. You can find functions and identify calls to them using syntactic classes from the standard CodeQL library.
- :doc:`Tutorial: Functions <functions>` demonstrates how to write queries using the standard CodeQL library classes for Python functions.
:doc:`Expressions and statements in Python <statements-expressions>`
--------------------------------------------------------------------
Expressions define a value. Statements represent a command or action. You can explore how they are used in a code base using syntactic classes from the standard CodeQL library.
- :doc:`Tutorial: Statements and expressions <statements-expressions>` demonstrates how to write queries using the standard CodeQL library classes for Python statements and expressions.
:doc:`Pointer analysis and type inference in Python <pointsto-type-infer>`
--------------------------------------------------------------------------
At run time, each Python expression has a value with an associated type. You can learn how an expression behaves at run time using type-inference classes from the standard CodeQL library.
- :doc:`Tutorial: Control flow <control-flow>` demonstrates how to write queries using the standard CodeQL library classes for Python control flow.
:doc:`Analyzing control flow in Python <control-flow>`
------------------------------------------------------
You can write CodeQL queries to explore the control flow graph of a Python program, for example, to discover unreachable code or mutually exclusive blocks of code.
- :doc:`Tutorial: Points-to analysis and type inference <pointsto-type-infer>` demonstrates how to write queries using the standard CodeQL library classes for Python type inference.
:doc:`Analyzing data flow and tracking tainted data in Python <taint-tracking>`
-------------------------------------------------------------------------------
You can use CodeQL to track the flow of data through a Python program to its use. Tracking user-controlled, or tainted, data is a key technique for security researchers.
- :doc:`Taint tracking and data flow analysis in Python <taint-tracking>` demonstrates how to write queries using the standard taint tracking and data flow libraries for Python.
Other resources
---------------
- For examples of how to query common Python elements, see the `Python cookbook <https://help.semmle.com/wiki/display/CBPYTHON>`__.
- For the queries used in LGTM, display a `Python query <https://lgtm.com/search?q=language%3Apython&t=rules>`__ and click **Open in query console** to see the code used to find alerts.
- For more information about the library for Python see the `CodeQL library for Python <https://help.semmle.com/qldoc/python>`__.