Skip to content

Commit 9b4ea88

Browse files
committed
Merge branch 'am0o0-python-codeExec' of https://github.com/amammad/codeql into am0o0-python-codeExec
2 parents b20b733 + 4a2ab49 commit 9b4ea88

File tree

4,943 files changed

+370501
-421375
lines changed

Some content is hidden

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

4,943 files changed

+370501
-421375
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ build:linux --cxxopt=-std=c++20
1414
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
1515
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
1616

17+
common --registry=file:///%workspace%/misc/bazel/registry
18+
common --registry=https://bcr.bazel.build
19+
1720
try-import %workspace%/local.bazelrc

.bazelrc.internal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# this file should contain bazel settings required to build things from `semmle-code`
2+
3+
common --registry=file:///%workspace%/ql/misc/bazel/registry
4+
common --registry=https://bcr.bazel.build

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.2
1+
7.1.0

.gitattributes

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ go/extractor/opencsv/CSVReader.java -text
6767
# for those testing dbscheme files.
6868
*/ql/lib/upgrades/initial/*.dbscheme -text
6969

70-
# Generated test files - these are synced from the standard JavaScript libraries using
71-
# `javascript/ql/experimental/adaptivethreatmodeling/test/update_endpoint_test_files.py`.
72-
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.js linguist-generated=true -merge
73-
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.ts linguist-generated=true -merge
74-
7570
# Auto-generated modeling for Python
7671
python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true
72+
73+
# auto-generated bazel lock file
74+
ruby/extractor/cargo-bazel-lock.json linguist-generated=true
75+
ruby/extractor/cargo-bazel-lock.json -merge

.github/labeler.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Java:
1515
- change-notes/**/*java.*
1616

1717
JS:
18-
- any: [ 'javascript/**/*', '!javascript/ql/experimental/adaptivethreatmodeling/**/*' ]
18+
- any: [ 'javascript/**/*' ]
1919
- change-notes/**/*javascript*
2020

2121
Kotlin:
2222
- java/kotlin-extractor/**/*
23-
- java/ql/test/kotlin/**/*
23+
- java/ql/test-kotlin*/**/*
2424

2525
Python:
2626
- python/**/*
@@ -46,6 +46,3 @@ documentation:
4646
# Since these are all shared files that need to be synced, just pick _one_ copy of each.
4747
"DataFlow Library":
4848
- "shared/dataflow/**/*"
49-
50-
"ATM":
51-
- javascript/ql/experimental/adaptivethreatmodeling/**/*

.github/workflows/buildifier.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check bazel formatting
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.bazel"
7+
- "**.bzl"
8+
branches:
9+
- main
10+
- "rc/*"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Check bazel formatting
22+
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
23+
with:
24+
extra_args: >
25+
buildifier --all-files 2>&1 ||
26+
(
27+
echo -e "In order to format all bazel files, please run:\n bazel run //:buildifier"; exit 1
28+
)

.github/workflows/compile-queries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
key: all-queries
3030
- name: check formatting
31-
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
31+
run: find shared */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
3232
- name: compile queries - check-only
3333
# run with --check-only if running in a PR (github.sha != main)
3434
if : ${{ github.event_name == 'pull_request' }}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Code scanning - C++"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'rc/*'
8+
pull_request:
9+
branches:
10+
- main
11+
- 'rc/*'
12+
paths:
13+
- 'swift/**'
14+
- '.github/codeql/**'
15+
- '.github/workflows/cpp-swift-analysis.yml'
16+
schedule:
17+
- cron: '0 9 * * 1'
18+
19+
jobs:
20+
CodeQL-Build:
21+
22+
runs-on: ubuntu-latest
23+
24+
permissions:
25+
contents: read
26+
security-events: write
27+
pull-requests: read
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
# Initializes the CodeQL tools for scanning.
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@main
36+
# Override language selection by uncommenting this and choosing your languages
37+
with:
38+
languages: cpp
39+
config-file: ./.github/codeql/codeql-config.yml
40+
41+
- name: "[Ubuntu] Remove GCC 13 from runner image"
42+
shell: bash
43+
run: |
44+
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
45+
sudo apt-get update
46+
sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-*
47+
48+
- name: "Build Swift extractor using Bazel"
49+
run: |
50+
bazel clean --expunge
51+
bazel run //swift:create-extractor-pack --nouse_action_cache --noremote_accept_cached --noremote_upload_local_results --spawn_strategy=local --features=-layering_check
52+
bazel shutdown
53+
54+
- name: Perform CodeQL Analysis
55+
uses: github/codeql-action/analyze@main

.github/workflows/ruby-build.yml

Lines changed: 8 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ jobs:
5151
run: |
5252
brew install gnu-tar
5353
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
54-
- name: Install cargo-cross
55-
if: runner.os == 'Linux'
56-
run: cargo install cross --version 0.2.5
54+
- name: Prepare Windows
55+
if: runner.os == 'Windows'
56+
shell: powershell
57+
run: |
58+
git config --global core.longpaths true
5759
- uses: ./.github/actions/os-version
5860
id: os_version
5961
- name: Cache entire extractor
@@ -82,16 +84,8 @@ jobs:
8284
- name: Run tests
8385
if: steps.cache-extractor.outputs.cache-hit != 'true'
8486
run: cd extractor && cargo test --verbose
85-
# On linux, build the extractor via cross in a centos7 container.
86-
# This ensures we don't depend on glibc > 2.17.
87-
- name: Release build (linux)
88-
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os == 'Linux'
89-
run: |
90-
cd extractor
91-
cross build --release
92-
mv target/x86_64-unknown-linux-gnu/release/codeql-extractor-ruby target/release/
93-
- name: Release build (windows and macos)
94-
if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os != 'Linux'
87+
- name: Release build
88+
if: steps.cache-extractor.outputs.cache-hit != 'true'
9589
run: cd extractor && cargo build --release
9690
- name: Generate dbscheme
9791
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
@@ -123,7 +117,7 @@ jobs:
123117
- name: Cache compilation cache
124118
id: query-cache
125119
uses: ./.github/actions/cache-query-compilation
126-
with:
120+
with:
127121
key: ruby-build
128122
- name: Build Query Pack
129123
run: |
@@ -235,54 +229,3 @@ jobs:
235229
shell: bash
236230
run: |
237231
codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls
238-
239-
# This is a copy of the 'test' job that runs in a centos7 container.
240-
# This tests that the extractor works correctly on systems with an old glibc.
241-
test-centos7:
242-
defaults:
243-
run:
244-
working-directory: ${{ github.workspace }}
245-
strategy:
246-
fail-fast: false
247-
runs-on: ubuntu-latest
248-
container:
249-
image: centos:centos7
250-
env:
251-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252-
needs: [package]
253-
steps:
254-
- name: Install gh cli
255-
run: |
256-
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
257-
# fetch-codeql requires unzip and jq
258-
# jq is available in epel-release (https://docs.fedoraproject.org/en-US/epel/)
259-
yum install -y gh unzip epel-release
260-
yum install -y jq
261-
- uses: actions/checkout@v3
262-
- name: Fetch CodeQL
263-
uses: ./.github/actions/fetch-codeql
264-
265-
# Due to a bug in Actions, we can't use runner.temp in the run blocks here.
266-
# https://github.com/actions/runner/issues/2185
267-
268-
- name: Download Ruby bundle
269-
uses: actions/download-artifact@v3
270-
with:
271-
name: codeql-ruby-bundle
272-
path: ${{ runner.temp }}
273-
- name: Unzip Ruby bundle
274-
shell: bash
275-
run: unzip -q -d "$RUNNER_TEMP"/ruby-bundle "$RUNNER_TEMP"/codeql-ruby-bundle.zip
276-
277-
- name: Run QL test
278-
shell: bash
279-
run: |
280-
codeql test run --search-path "$RUNNER_TEMP"/ruby-bundle --additional-packs "$RUNNER_TEMP"/ruby-bundle ruby/ql/test/library-tests/ast/constants/
281-
- name: Create database
282-
shell: bash
283-
run: |
284-
codeql database create --search-path "$RUNNER_TEMP"/ruby-bundle --language ruby --source-root ruby/ql/test/library-tests/ast/constants/ ../database
285-
- name: Analyze database
286-
shell: bash
287-
run: |
288-
codeql database analyze --search-path "$RUNNER_TEMP"/ruby-bundle --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls

.github/workflows/swift.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- "swift/**"
77
- "misc/bazel/**"
88
- "misc/codegen/**"
9+
- "shared/**"
910
- "*.bazel*"
1011
- .github/workflows/swift.yml
1112
- .github/actions/**
@@ -22,10 +23,12 @@ on:
2223
- "swift/**"
2324
- "misc/bazel/**"
2425
- "misc/codegen/**"
26+
- "shared/**"
2527
- "*.bazel*"
2628
- .github/workflows/swift.yml
2729
- .github/actions/**
2830
- codeql-workspace.yml
31+
- .pre-commit-config.yaml
2932
- "!**/*.md"
3033
- "!**/*.qhelp"
3134
branches:

0 commit comments

Comments
 (0)