Merge branch 'main' into scovetta-readme-fixes

This commit is contained in:
Suraj Jacob 2020-07-10 15:26:53 -07:00 коммит произвёл GitHub
Родитель 156ea575f7 98f005143a
Коммит d326d654ea
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -55,9 +55,9 @@ ENV CODEQL_HOME /usr/local/codeql-home
# record the latest version of the codeql-cli
RUN python3 /usr/local/startup_scripts/get-latest-codeql-version.py > /tmp/codeql_version
RUN mkdir -p ${CODEQL_HOME} \
${CODEQL_HOME}/codeql-repo \
${CODEQL_HOME}/codeql-go-repo \
/opt/codeql
${CODEQL_HOME}/codeql-repo \
${CODEQL_HOME}/codeql-go-repo \
/opt/codeql
RUN CODEQL_VERSION=$(cat /tmp/codeql_version) && \
wget -q https://github.com/github/codeql-cli-binaries/releases/download/${CODEQL_VERSION}/codeql-linux64.zip -O /tmp/codeql_linux.zip && \
@ -75,4 +75,4 @@ ENV PATH="${CODEQL_HOME}/codeql:${PATH}"
# Pre-compile our queries to save time later
#RUN codeql query compile --threads=0 ${CODEQL_HOME}/codelq-repo/*/ql/src/codeql-suites/*-.qls
#RUN codeql query compile --threads=0 ${CODEQL_HOME}/codelq-go-repo/ql/src/codeql-suites/*-.qls
ENTRYPOINT ["python3", "/usr/local/startup_scripts/startup.py"]
ENTRYPOINT ["python3", "/usr/local/startup_scripts/startup.py"]

Просмотреть файл

@ -4,7 +4,7 @@
> Current version of CodeQL only works for interpreted languages. We will add compiled languages support on future versions.
CodeQL Container is a project aimed at making it easier to start using CodeQL (https://github.com/github/codeql). This project
contains a Docker file which builds a container with the latest version of codeql-cli and codeql queries precompiled.
contains a Docker file which builds a container, with the latest version of codeql-cli and codeql queries precompiled.
It also contains scripts to keep the toolchain in the container updated. You can use this container to:
* Start using codeql-cli and run queries on your projects without installing it on your local machine.
@ -18,10 +18,10 @@ We shall continue to add more features and would be happy to accept contribution
#### Downloading a pre-built container
We keep updating the docker image periodically and uploading it to the Microsoft Container Registry at: mcr.microsoft.com/codeql/codeql-container.
You can run the image by running the command:
You can pull the image by running the command:
```
$ docker run --rm mcr.microsoft.com/codeql/codeql-container
$ docker pull mcr.microsoft.com/codeql/codeql-container
```
If you want to analyze a particular source directory with codeql, run the container as:
@ -29,6 +29,7 @@ If you want to analyze a particular source directory with codeql, run the contai
```
$ docker run --rm --name codeql-container mcr.microsoft.com/codeql/codeql-container -v /dir/to/analyze:/opt/src -v /dir/for/results:/opt/results -e CODEQL_CLI_ARGS=<query run...>
```
where `/dir/to/analyze` contains the source files that have to be analyzed, and `/dir/for/results` is where the result output
needs to be stored, and you can specify QL_PACKS environment variable for specific QL packs to be run on the provided code.
For more information on CodeQL and QL packs, please visit https://www.github.com/github/codeql.
@ -62,7 +63,7 @@ $ docker run --rm --name codeql-container mcr.microsoft.com/codeql/codeql-contai
$ docker run --rm --name codeql-container mcr.microsoft.com/codeql/codeql-container -v /dir/to/analyze:/opt/src -v /dir/for/results:/opt/results -e CODEQL_CLI_ARGS="database analyze --format=sarifv2 --output=/opt/results/issues.sarif /opt/src/source_db
```
This command will run all the QL packs related to security and output the results to the results folder.
For more information on CodeQL and QL packs, please visit https://www.github.com/github/codeql.
#### Building the container