Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
Contributions to this project are released to the public under the project's open source license.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The best way to report a bug is to open an issue on GitHub. Please include as much information as possible, including:
- A clear description of the problem
- Steps to reproduce the problem
- The expected behavior
- The actual behavior
This will help us understand the issue and fix it more quickly.
If you have an idea for a new feature or enhancement, please open an issue on GitHub.
- Fork and clone the repository
- Create a new branch for your changes
- Make your changes
- Write tests for your changes (if applicable)
- Run the tests to make sure everything is working
- Submit a pull request with a clear description of your changes
To clone the repository, run the following command:
git clone https://github.com/GitHubSecurityLab/codeql-extractor-bicep
git submodule update --init --recursive![NOTE] This repository uses submodules to manage the Tree-Sitter grammar from the language.
There is a script to build the extractor pack. You can run it from the root of the repository:
./scripts/create-extractor-pack.shTo test the CodeQL libraries and queries, you can run the following command:
./scripts/run-tests.shThe project includes a coverage script to track CodeQL query coverage and generate reports. The script analyzes all available queries and provides detailed coverage statistics.
To update coverage data and generate a report:
python scripts/coverage.pyThis will:
- Load the existing
.coverage.jsonfile - Run
codeql resolve queriesto discover all available queries - Update the coverage data with query metadata
- Generate a markdown coverage report
- Update the README.md file with the latest coverage statistics
The coverage script supports several command-line options:
# Generate only markdown output (useful for CI/CD)
python scripts/coverage.py --markdown-only
# Update coverage data but skip README.md update
python scripts/coverage.py --no-readme-update
# Show help and available options
python scripts/coverage.py --helpThe generated coverage report includes:
- Coverage Badge: Dynamically colored based on coverage percentage
- Summary Statistics: Total queries, covered queries, coverage percentage
- Category Breakdown: Coverage by query category (Security, Diagnostics)
- CWE Analysis: Coverage by Common Weakness Enumeration categories
- Timestamp: When the report was last generated
The coverage script tracks:
- Total Queries: All queries discovered in
ql/src/ - Covered Queries: Queries that have associated tests (initially 0, updated as tests are added)
- Categories: Query categories like
securityanddiagnostics - CWE Categories: Security queries mapped to Common Weakness Enumeration identifiers
To mark a query as "covered", you'll need to create corresponding test files in the ql/test/ directory structure.