1- # CodeQL docker build
1+ # Docker for CodeQL
22
3- Based on [ microsoft/codeql-container] ( https://github.com/microsoft/codeql-container ) with java, golang installed and .NET removed.
3+ Based on [ microsoft/codeql-container] ( https://github.com/microsoft/codeql-container ) with Java, Golang installed and .NET removed.
44
55## Build & Run
66
77``` shell
88docker build -t j3ssie/codeql-docker:latest .
99```
1010
11- or pull the latest from docker hub
11+ or pull the latest from [ Docker hub] ( https://hub.docker.com/r/j3ssie/codeql-docker )
1212
1313``` shell
1414docker pull j3ssie/codeql-docker:latest
1515
16- # then run the container
17- docker run -it j3ssie/codeql-docker:latest
1816```
1917
20-
2118## Usage
2219
23- ### Access container with bash shell
20+ ### Run with helper scripts
2421
2522``` shell
26- docker run -it --entrypoint=/bin/bash -t j3ssie/codeql-docker:latest /bin/bash
23+ # usage
24+ ./scripts/run.py -l < language-of-source-code> -s < source-code-folder> [--format= csv] [-o ouput]
25+
26+ # simple usage
27+ ./scripts/run.py -l go -s /tmp/insecure-project
28+ # default output is JSON format so read them with this command
29+ cat results/issues.sarif-latest| jq ' .runs[].results'
30+
31+ # with custom format and output
32+ ./scripts/run.py -l javascript -s /tmp/cc/code-scanning-javascript-demo --format=csv -o sample
33+ # your output will be store at sample/issues.csv
34+
2735```
2836
29- ### Run with helper scripts
37+ ### Run with docker command
3038
3139With ` /tmp/src ` is your source code and ` /tmp/results ` is where result store.
3240
33- > NOTE: make sure /tmp/results folder is exist otherwise no result will be created
41+ > NOTE: make sure /tmp/results folder exist otherwise it won't work
3442
3543``` shell
3644# simple usage
3745docker run --rm --name codeql-docker -v " /tmp/src:/opt/src" -v " /tmp/results:/opt/results" -e " LANGUAGE=go" j3ssie/codeql-docker:latest
3846
3947# more options
40- docker run --rm --name codeql-docker -v " /tmp/src:/opt/src" -v " /tmp/results:/opt/results" -e " LANGUAGE=go " -e " FORMAT=csv" -e " QS=golang -security-and-quality.qls" j3ssie/codeql-docker:latest
48+ docker run --rm --name codeql-docker -v " /tmp/src:/opt/src" -v " /tmp/results:/opt/results" -e " LANGUAGE=javascript " -e " FORMAT=csv" -e " QS=javascript -security-and-quality.qls" j3ssie/codeql-docker:latest
4149
42- # helper script
43- ./scripts/run.py -l go -s /tmp/metabigor
4450```
4551
4652### Manual analyze
4753
4854``` shell
55+ # Directly access container with bash shell
56+ docker run -it --entrypoint=/bin/bash -t j3ssie/codeql-docker:latest
57+
4958# Copy your code to container
5059docker cp < your-source-cde> < docker-ID> :/opt/src
5160
@@ -71,3 +80,9 @@ codeql resolve queries
7180codeql database upgrade < database>
7281
7382```
83+
84+ ## Donation
85+
86+ [ ![ paypal] ( https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif )] ( https://paypal.me/j3ssiejjj )
87+
88+ [ ![ "Buy Me A Coffee"] ( https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png )] ( https://www.buymeacoffee.com/j3ssie )
0 commit comments