A universal Python CLI wrapper for running CodeQL analysis on any type of project (monorepo or single repository) across different CI/CD platforms including Jenkins, GitHub Actions, Harness, and any environment where Python scripts can be executed.
Project description
CodeQL Wrapper
A universal Python CLI wrapper for running CodeQL analysis seamlessly across any project architecture and CI/CD platform.
CodeQL Wrapper simplifies security analysis by providing a unified interface for CodeQL across monorepos, single repositories, and diverse CI/CD environments including Jenkins, GitHub Actions, Harness, Azure DevOps, and more.
Features
|
Universal Support CI/CD Agnostic Smart Language Detection SARIF Integration |
Performance Optimized Auto-Installation Flexible Configuration |
Prerequisites
| Requirement | Version/Details |
|---|---|
| Python | 3.9 or higher |
| Git | For repository analysis |
| GitHub Token | Required for SARIF upload functionality |
Quick Start
Installation
Install CodeQL Wrapper from PyPI:
pip install codeql-wrapper
Basic Usage
Single Repository Analysis
Analyze a single repository with automatic language detection:
codeql-wrapper analyze /path/to/repository
Monorepo Analysis
Analyze all projects in a monorepo "using build-mode none" and upload results to GitHub Advanced Security:
codeql-wrapper analyze /path/to/monorepo --monorepo --upload-sarif
Targeted Analysis
Analyze only projects with changes (perfect for CI/CD):
codeql-wrapper analyze /path/to/repo --monorepo --only-changed-files --upload-sarif
Note: Ensure your
GITHUB_TOKENenvironment variable is set for SARIF upload functionality.
Advanced Configuration
For complex monorepo setups, create a .codeql.json configuration file in your repository root:
Click to view example configuration
{
"projects": [
{
"path": "./monorepo/project-java-1",
"build-mode": "manual",
"build-script": "./build/project-java-1.sh",
"queries": ["java-security-extended"],
"language": "java"
},
{
"path": "./monorepo/project-java-1",
"language": "javascript"
},
{
"path": "./monorepo/project-python-1",
"build-mode": "none"
},
{
"path": "./monorepo/project-python-javascript-cpp",
"build-mode": "none",
"language": "javascript"
}
]
}
Configuration Options
| Option | Description | Values |
|---|---|---|
path |
Relative path to the project | Any valid path |
build-mode |
How to build the project (default=none) | none, manual, autobuild |
build-script |
Custom build script path | Path to executable script |
queries |
CodeQL query suites to run | Array of query suite names |
language |
Target language (default=auto-detect) | Any supported language |
CI/CD Integration
| Platform | Status |
|---|---|
| GitHub Actions | ✅ Supported |
| Harness | ✅ Supported |
| Circle CI | ✅ Supported |
| Azure Pipelines | ✅ Supported |
| Jenkins | ✅ Supported |
Examples and implementation guides available at:
https://github.com/ModusCreate-fernandomatsuo-GHAS/poc-codeql-wrapper
Documentation
Complete documentation is available at:
https://moduscreate-perdigao-ghas-playground.github.io/codeql-wrapper
Contributing
We welcome contributions! Please see the contributing guidelines for more information.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the Modus Create team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codeql_wrapper-0.1.13.tar.gz.
File metadata
- Download URL: codeql_wrapper-0.1.13.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3b50d4186a761d1f0ca5902d3de02d6fb980f82fe0549885e2e30de3fea107c
|
|
| MD5 |
e39b7d820d0e5d329240095563be6764
|
|
| BLAKE2b-256 |
fbe65e2b94214217d8632f27d5a5af3d8479c1e99a1fe87dfd41ff3719a3d248
|
Provenance
The following attestation bundles were made for codeql_wrapper-0.1.13.tar.gz:
Publisher:
release-publish.yml on ModusCreate-Perdigao-GHAS-Playground/codeql-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeql_wrapper-0.1.13.tar.gz -
Subject digest:
c3b50d4186a761d1f0ca5902d3de02d6fb980f82fe0549885e2e30de3fea107c - Sigstore transparency entry: 322115453
- Sigstore integration time:
-
Permalink:
ModusCreate-Perdigao-GHAS-Playground/codeql-wrapper@bb6571e6213584c04b504922ebb69dc0eb570976 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ModusCreate-Perdigao-GHAS-Playground
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@bb6571e6213584c04b504922ebb69dc0eb570976 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeql_wrapper-0.1.13-py3-none-any.whl.
File metadata
- Download URL: codeql_wrapper-0.1.13-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5cb10af33c0605495f1e748419e28e2369ba5e475b2597806d2d6748be9daad
|
|
| MD5 |
dc9ffcd64493103de8c72820403e5fec
|
|
| BLAKE2b-256 |
d3adbf7a86998b042c79ba1e4b1fbf632961f887ac77149439383a99ebf73f49
|
Provenance
The following attestation bundles were made for codeql_wrapper-0.1.13-py3-none-any.whl:
Publisher:
release-publish.yml on ModusCreate-Perdigao-GHAS-Playground/codeql-wrapper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeql_wrapper-0.1.13-py3-none-any.whl -
Subject digest:
e5cb10af33c0605495f1e748419e28e2369ba5e475b2597806d2d6748be9daad - Sigstore transparency entry: 322115468
- Sigstore integration time:
-
Permalink:
ModusCreate-Perdigao-GHAS-Playground/codeql-wrapper@bb6571e6213584c04b504922ebb69dc0eb570976 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ModusCreate-Perdigao-GHAS-Playground
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@bb6571e6213584c04b504922ebb69dc0eb570976 -
Trigger Event:
push
-
Statement type: