Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit d8f1873

Browse files
author
Max Schaefer
committed
Merge branch 'master' into rc/1.24
2 parents c30893a + 524b11b commit d8f1873

288 files changed

Lines changed: 16064 additions & 3477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extensions": [
3+
"github.vscode-codeql",
4+
"slevesque.vscode-zipexplorer"
5+
],
6+
"settings": {
7+
"codeQL.experimentalBqrsParsing": true,
8+
"codeQL.experimentalFeatures": true,
9+
"codeQL.runningQueries.debug": true
10+
}
11+
}

.github/workflows/codeqltest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
echo "Done"
2121
cd $HOME
2222
echo "Downloading CodeQL CLI..."
23-
curl https://github.com/github/codeql-cli-binaries/releases/download/v2.0.3/codeql.zip -L -o codeql.zip
23+
curl https://github.com/github/codeql-cli-binaries/releases/download/v2.1.1/codeql.zip -L -o codeql.zip
2424
echo "Done"
2525
echo "Unpacking CodeQL CLI..."
2626
unzip -q codeql.zip
@@ -53,7 +53,7 @@ jobs:
5353
echo "Done"
5454
cd $HOME
5555
echo "Downloading CodeQL CLI..."
56-
curl https://github.com/github/codeql-cli-binaries/releases/download/v2.0.3/codeql.zip -L -o codeql.zip
56+
curl https://github.com/github/codeql-cli-binaries/releases/download/v2.1.1/codeql.zip -L -o codeql.zip
5757
echo "Done"
5858
echo "Unpacking CodeQL CLI..."
5959
unzip -q codeql.zip
@@ -86,10 +86,10 @@ jobs:
8686
echo "Done"
8787
cd "$HOME"
8888
echo "Downloading CodeQL CLI..."
89-
Invoke-WebRequest -Uri https://github.com/github/codeql-cli-binaries/releases/download/v2.0.3/codeql.zip -OutFile codeql.zip
89+
Invoke-WebRequest -Uri https://github.com/github/codeql-cli-binaries/releases/download/v2.1.1/codeql.zip -OutFile codeql.zip
9090
echo "Done"
9191
echo "Unpacking CodeQL CLI..."
92-
unzip -q codeql.zip
92+
Expand-Archive codeql.zip -DestinationPath $HOME
9393
rm -fo codeql.zip
9494
echo "Done"
9595

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ tools/linux64
2222
tools/osx64
2323
tools/win64
2424
tools/tokenizer.jar
25+
main

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh index.cmd in
1818

1919
EXTRACTOR_PACK_OUT = build/codeql-extractor-go
2020

21-
BINARIES = go-extractor go-tokenizer go-autobuilder go-bootstrap
21+
BINARIES = go-extractor go-tokenizer go-autobuilder go-bootstrap go-gen-dbscheme
2222

2323
.PHONY: tools tools-codeql tools-codeql-full clean \
2424
tools-linux64 tools-osx64 tools-win64
@@ -81,8 +81,8 @@ tools/net/sourceforge/pmd/cpd/GoLanguage.class: extractor/net/sourceforge/pmd/cp
8181
rm tools/net/sourceforge/pmd/cpd/TokenEntry.class
8282
rm tools/net/sourceforge/pmd/cpd/Tokenizer.class
8383

84-
ql/src/go.dbscheme: tools/$(CODEQL_PLATFORM)/go-extractor$(EXE)
85-
env TRAP_FOLDER=/tmp $< --dbscheme $@
84+
ql/src/go.dbscheme: tools/$(CODEQL_PLATFORM)/go-gen-dbscheme$(EXE)
85+
$< $@
8686

8787
build/stats/src.stamp:
8888
mkdir -p $(@D)/src
@@ -109,3 +109,10 @@ build/testdb/go.dbscheme: upgrades/initial/go.dbscheme
109109
rm -rf build/testdb
110110
echo >build/empty.trap
111111
codeql dataset import -S upgrades/initial/go.dbscheme build/testdb build/empty.trap
112+
113+
.PHONY: sync-dataflow-libraries
114+
sync-dataflow-libraries:
115+
for f in DataFlowImpl.qll DataFlowImplCommon.qll tainttracking1/TaintTrackingImpl.qll;\
116+
do\
117+
curl -s -o ./ql/src/semmle/go/dataflow/internal/$$f https://raw.githubusercontent.com/github/codeql/master/java/ql/src/semmle/code/java/dataflow/internal/$$f;\
118+
done

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ It contains two major components:
1212

1313
The goal of this project is to provide comprehensive static analysis support for Go in CodeQL.
1414

15+
For the queries and libraries that power CodeQL support for other languages, visit [the CodeQL
16+
repository](https://github.com/github/codeql).
17+
1518
## Installation
1619

1720
Simply clone this repository. There are no external dependencies.
@@ -21,9 +24,10 @@ Code workspace.
2124

2225
## Usage
2326

24-
To analyze a Go codebase, either use the CodeQL command-line interface to create a database
25-
yourself, or download a pre-built database from LGTM.com. You can then run any of the queries
26-
contained in this repository either on the command line or using the VS Code extension.
27+
To analyze a Go codebase, either use the [CodeQL command-line
28+
interface](https://help.semmle.com/codeql/codeql-cli.html) to create a database yourself, or
29+
download a pre-built database from [LGTM.com](https://lgtm.com/). You can then run any of the
30+
queries contained in this repository either on the command line or using the VS Code extension.
2731

2832
Note that the [lgtm.com](https://github.com/github/codeql-go/tree/lgtm.com) branch of this
2933
repository corresponds to the version of the queries that is currently deployed on LGTM.com.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The query "Bad redirect check" (`go/bad-redirect-check`) now requires that the checked variable is actually used in a redirect as opposed to relying on a name-based heuristic. This eliminates some false positive results, and adds more true positive results.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* Basic support for the [Macaron](https://go-macaron.com/) HTTP library has been added, which may lead to more results from the security queries.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lgtm,codescanning
2+
* The query "Clear-text logging of sensitive information" has been improved to recognize more logging APIs, which may lead to more alerts.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lgtm,codescanning
2+
* Basic support for the [Mux](https://github.com/gorilla/mux/) HTTP library has been added, which
3+
may lead to more results from the security queries.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lgtm,codescanning
2+
* The data-flow library has been improved, which affects and improves most security queries. In particular,
3+
flow through functions involving nested field reads and writes is now modeled more fully.

0 commit comments

Comments
 (0)