CodeQL is GitHub's expressive language and engine for code analysis, which allows you to explore source code to find bugs and security vulnerabilities. During this beginner-friendly workshop, you will learn to write queries in CodeQL to find use-after-free vulnerabilities in open-source C/C++ code.
- Install Visual Studio Code.
- Install the CodeQL extension for Visual Studio Code.
- You do not need to install the CodeQL CLI: the extension will handle this for you.
- Clone this repository:
git clone --recursive https://github.com/githubuniverseworkshops/codeql
- Please don't forget
--recursive
: This allows you to obtain the standard CodeQL query libraries, which are included as a Git submodule of this repository. - What if I forgot to add
--recursive
? If you've already cloned the repository, please set up the submodule by running:git submodule update --init --remote
- Please don't forget
- Open the repository in Visual Studio Code: File > Open (or Open Folder) > Browse to the checkout of
githubuniverseworkshops/codeql
. - Import the CodeQL database to be used in the workshop:
- Click the CodeQL rectangular icon in the left sidebar.
- Place your mouse over Databases, and click the icon labelled
Download Database
. - Copy and paste this URL into the box: https://github.com/githubuniverseworkshops/codeql/releases/download/universe-2020/codeql-cpp-workshop-uaf.zip
- Click on the database name, and click Set Current Database.
- You're ready! Proceed to the workshop.
- For more advanced CodeQL development in future, you may wish to set up the CodeQL starter workspace for all languages.
- CodeQL overview
- CodeQL for C/C++
- Analyzing data flow in C/C++
- Using the CodeQL extension for VS Code
- CodeQL on GitHub Learning Lab
- CodeQL on GitHub Security Lab
The code in this repository is licensed under the MIT License by GitHub.