Skip to content

Commit 1983eff

Browse files
committed
Update codeql version
1 parent 6bc0223 commit 1983eff

File tree

6 files changed

+46
-17
lines changed

6 files changed

+46
-17
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: j3ssie
5+
open_collective: jaeles-project
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: [ 'https://paypal.me/j3ssiejjj', 'https://www.buymeacoffee.com/j3ssie' ]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
results*

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ RUN apt-get update && \
3333
default-jdk \
3434
gettext && \
3535
apt-get clean && \
36-
ln -s /usr/bin/python3.8 /usr/bin/python && \
37-
ln -s /usr/bin/pip3 /usr/bin/pip
36+
ln -sf /usr/bin/python3.8 /usr/bin/python && \
37+
ln -sf /usr/bin/pip3 /usr/bin/pip
3838

3939
# Install Golang
4040
RUN wget -q -O - https://raw.githubusercontent.com/canha/golang-tools-install-script/master/goinstall.sh | bash
@@ -52,9 +52,9 @@ RUN mkdir -p ${CODEQL_HOME} \
5252
/opt/codeql
5353

5454
# get the latest codeql queries and record the HEAD
55-
RUN git clone https://github.com/github/codeql ${CODEQL_HOME}/codeql-repo && \
55+
RUN git clone --depth=1 https://github.com/github/codeql ${CODEQL_HOME}/codeql-repo && \
5656
git --git-dir ${CODEQL_HOME}/codeql-repo/.git log --pretty=reference -1 > /opt/codeql/codeql-repo-last-commit
57-
RUN git clone https://github.com/github/codeql-go ${CODEQL_HOME}/codeql-go-repo && \
57+
RUN git clone --depth=1 https://github.com/github/codeql-go ${CODEQL_HOME}/codeql-go-repo && \
5858
git --git-dir ${CODEQL_HOME}/codeql-go-repo/.git log --pretty=reference -1 > /opt/codeql/codeql-go-repo-last-commit
5959

6060
RUN CODEQL_VERSION=$(cat /tmp/codeql_version) && \

README.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,60 @@
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
88
docker 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
1414
docker 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

3139
With `/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
3745
docker 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
5059
docker cp <your-source-cde> <docker-ID>:/opt/src
5160

@@ -71,3 +80,9 @@ codeql resolve queries
7180
codeql 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)

results/issues.csv

Whitespace-only changes.

scripts/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def parse_input(args):
4343

4444
DOCKER_CMD = f'''docker run --rm --name codeql-docker -v "{SRC}:/opt/src" -v "{OUTPUT}:/opt/results" -e "LANGUAGE={LANG}" -e "FORMAT={FORMAT}" -e "QS={QS}" j3ssie/codeql-docker:latest'''
4545

46+
4647
def main():
4748
parser = argparse.ArgumentParser(description="Script to start CodeQL Analyze")
4849
parser.add_argument('--format', nargs='?', type=str, default="sarif-latest", help='Format of output')

0 commit comments

Comments
 (0)