devrvk/codeql-docker)This Docker image provides a self-contained environment for analyzing Android APK files using JADX for decompilation and GitHub's CodeQL for static analysis. It is designed as a worker: it takes an APK from a mounted input volume, performs the analysis, stores results in a mounted output volume, logs its progress, and then exits.
amd64 OnlyImportant: This Docker image is built exclusively for the linux/amd64 (x86_64) architecture. Due to stability issues encountered when running certain package installation scripts (like ca-certificates, openjdk) under QEMU emulation on ARM hosts (e.g., Apple Silicon M1/M2/M3), this image forces the amd64 architecture during build and uses amd64 specific binaries.
Do not attempt to run this image on arm64 hosts without a compatible amd64 emulation layer. For best performance and stability, run this image on a native linux/amd64 machine or VM.
amd64 host machine.docker pull devrvk/codeql-docker
You need two directories on your host machine:
input/: Place the single APK file you want to analyze in this directory.output/: An empty directory where the analysis results will be stored.Example structure:
my_analysis_project/
├── input/
│ └── my_app.apk # Your APK file here
└── output/ # Results will appear here
Execute the following command from the directory containing your input and output folders (e.g., my_analysis_project/):
docker run -v "$(pwd)/input:/app/input" -v "$(pwd) output:/app/output" devrvk/codeql-docker
Explanation of Flags:
--rm: Automatically removes the container filesystem when the analysis finishes and the container exits. Keeps your system clean.-v "$(pwd)/input:/app/input": Mounts your local input directory to /app/input inside the container. The container reads the APK from here.-v "$(pwd)/output:/app/output": Mounts your local output directory to /app/output inside the container. All results and logs are written here.devrvk/codeql-docker: Specifies the Docker image to run.entrypoint.py script executes..apk file in the mounted /app/input directory./app/tool/analyze_apk.py).analyze_apk.py:
jadx to decompile the APK into the /app/output/<apk_name>/ directory./app/output/<apk_name>_qldb using --build-mode=none.codeql/java-queries) against the database, saving raw CSV results./app/tool/custom_queries/), it executes /app/tool/run_all_queries.sh.run_all_queries.sh runs each custom .ql query, decodes results to individual JSON files within /app/tool/custom_queries/outputs/.analyze_apk.py aggregates these individual custom JSON results into a single file.After the container finishes, the following files will appear in your local output/ directory:
<apk_name>/: Directory containing the decompiled source code generated by JADX. (e.g., output/my_app/)<apk_name>_qldb/: The CodeQL database directory. Can be large. (e.g., output/my_app_qldb/)<apk_name>.json: JSON file containing the results from the standard CodeQL Java security queries (codeql/java-queries). (e.g., output/my_app.json)custom_queries_result.json: (Only if custom queries were included in the image build) A JSON file containing the combined results from all custom .ql queries found in /app/tool/custom_queries. The structure is an object where keys are the query filenames (without .ql) and values are the full JSON result objects from codeql bqrs decode.analysis.log: A text file containing all the console output generated during the container's run, useful for debugging.# 1. Create directories
mkdir -p my_analysis/input my_analysis/output
# 2. Place your APK
cp /path/to/your/app.apk my_analysis/input/
# 3. Navigate to the project directory
cd my_analysis
# 4. Run the analysis
docker run --rm \
-v "$(pwd)/input:/app/input" \
-v "$(pwd)/output:/app/output" \
devrvk/codeql-docker
# 5. Check results in the 'output' directory
ls output/
# Expected: analysis.log, app.json, app_qldb/, app/, custom_queries_result.json (if applicable)
The analysis logic (analyze_apk.py), custom queries (custom_queries/), and the custom query runner (run_all_queries.sh) are located within the /app/tool/ directory inside the image. To modify the analysis process or add/change custom queries, you would need to rebuild the Docker image with your updated files in the tool/ directory of your build context.
Content type
Image
Digest
sha256:785f55c78…
Size
949.5 MB
Last updated
over 1 year ago
docker pull devrvk/codeql-docker