Skip to content

Commit 5e100cd

Browse files
committed
Add vAPI customizations pack and bundle create workflow
1 parent 562fb34 commit 5e100cd

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

.github/workflows/bundle.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create Bundle
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build-and-release:
7+
runs-on: ubuntu-latest
8+
name: Build and release bundle
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: CodeQL bundle
13+
id: codeql-bundle
14+
uses: advanced-security/codeql-bundle-action@v1
15+
with:
16+
packs: "advanced-security-demo/vapi-customizations"
17+
- name: Bundle release
18+
env:
19+
BUNDLE_PATH: ${{ steps.codeql-bundle.outputs.bundle-path }}
20+
BUNDLE_TAG: ${{ steps.codeql-bundle.outputs.bundle-tag }}
21+
GITHUB_TOKEN: ${{ github.token }}
22+
run: |
23+
if gh release view $BUNDLE_TAG; then
24+
gh release upload --clobber $BUNDLE_TAG $BUNDLE_PATH
25+
else
26+
gh release create $BUNDLE_TAG $BUNDLE_PATH --generate-notes
27+
fi
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import python
2+
private import semmle.python.ApiGraphs
3+
private import semmle.python.dataflow.new.RemoteFlowSources
4+
5+
API::Node request() { result = API::moduleImport("connexion").getMember("request") }
6+
7+
private class ConnexionRequestSource extends RemoteFlowSource::Range {
8+
ConnexionRequestSource() {
9+
this = request().getAUse() and
10+
not any(Import imp).contains(this.asExpr()) and
11+
not exists(ControlFlowNode def | this.asVar().getSourceVariable().hasDefiningNode(def) |
12+
any(Import imp).contains(def.getNode())
13+
)
14+
}
15+
16+
override string getSourceType() { result = "connexion.request" }
17+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
dependencies:
3+
codeql/python-all:
4+
version: 0.4.1
5+
compiled: false
6+
lockVersion: 1.0.0

vapi-customizations/qlpack.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
library: true
3+
name: advanced-security-demo/vapi-customizations
4+
version: 0.0.1
5+
dependencies:
6+
codeql/python-all: 0.4.1
7+
extractor: python

0 commit comments

Comments
 (0)