Skip to content

Commit 95b5eff

Browse files
author
Alvaro Muñoz
authored
Merge pull request #41 from github/js_extractor
Move from yaml to js extractor
2 parents 92cd503 + e5eb856 commit 95b5eff

File tree

756 files changed

+827
-885
lines changed

Some content is hidden

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

756 files changed

+827
-885
lines changed

.github/action/dist/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28604,7 +28604,7 @@ const toolcache = __importStar(__nccwpck_require__(7784));
2860428604
const toolrunner = __importStar(__nccwpck_require__(8159));
2860528605
async function newCodeQL() {
2860628606
return {
28607-
language: "yaml",
28607+
language: "javascript",
2860828608
path: await findCodeQL(),
2860928609
pack: "githubsecuritylab/actions-queries",
2861028610
suite: `codeql-suites/${core.getInput("suite") || "actions-code-scanning"}.qls`,
@@ -28771,16 +28771,16 @@ async function run() {
2877128771
var codeql = await cql.newCodeQL();
2877228772
core.debug(`CodeQL CLI found at '${codeql.path}'`);
2877328773
await cql.runCommand(codeql, ["version", "--format", "terse"]);
28774-
// check yaml support
28774+
// check javascript support
2877528775
var languages = await cql.runCommandJson(codeql, [
2877628776
"resolve",
2877728777
"languages",
2877828778
"--format",
2877928779
"json",
2878028780
]);
28781-
if (!languages.hasOwnProperty("yaml")) {
28782-
core.setFailed("CodeQL Yaml extractor not installed");
28783-
throw new Error("CodeQL Yaml extractor not installed");
28781+
if (!languages.hasOwnProperty("javascript")) {
28782+
core.setFailed("CodeQL javascript extractor not installed");
28783+
throw new Error("CodeQL javascript extractor not installed");
2878428784
}
2878528785
// download pack
2878628786
core.info(`Downloading CodeQL Actions pack '${codeql.pack}'`);

.github/action/src/codeql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface CodeQLConfig {
2424

2525
export async function newCodeQL(): Promise<CodeQLConfig> {
2626
return {
27-
language: "yaml",
27+
language: "javascript",
2828
path: await findCodeQL(),
2929
pack: "githubsecuritylab/actions-queries",
3030
suite: `codeql-suites/${core.getInput("suite") || "actions-code-scanning"}.qls`,

.github/action/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ export async function run(): Promise<void> {
1515

1616
await cql.runCommand(codeql, ["version", "--format", "terse"]);
1717

18-
// check yaml support
18+
// check javascript support
1919
var languages = await cql.runCommandJson(codeql, [
2020
"resolve",
2121
"languages",
2222
"--format",
2323
"json",
2424
]);
2525

26-
if (!languages.hasOwnProperty("yaml")) {
27-
core.setFailed("CodeQL Yaml extractor not installed");
28-
throw new Error("CodeQL Yaml extractor not installed");
26+
if (!languages.hasOwnProperty("javascript")) {
27+
core.setFailed("CodeQL javascript extractor not installed");
28+
throw new Error("CodeQL javascript extractor not installed");
2929
}
3030

3131
// download pack

ql/lib/codeql-pack.lock.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@ dependencies:
55
version: 1.0.0
66
codeql/dataflow:
77
version: 1.0.0
8+
codeql/javascript-all:
9+
version: 1.0.0
10+
codeql/mad:
11+
version: 1.0.0
12+
codeql/regex:
13+
version: 1.0.0
814
codeql/ssa:
915
version: 1.0.0
16+
codeql/tutorial:
17+
version: 1.0.0
1018
codeql/typetracking:
1119
version: 1.0.0
1220
codeql/util:
1321
version: 1.0.0
22+
codeql/xml:
23+
version: 1.0.0
1424
codeql/yaml:
1525
version: 1.0.0
1626
compiled: false

ql/lib/codeql/actions/dataflow/ExternalFlow.qll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ predicate externallyTriggerableEventsDataModel(string event) {
5555
* - output arg: To node (prefixed with either `env.` or `output.`)
5656
* - provenance: verification of the model
5757
*/
58-
predicate sourceModel(string action, string version, string output, string kind, string provenance) {
59-
Extensions::sourceModel(action, version, output, kind, provenance)
58+
predicate actionsSourceModel(string action, string version, string output, string kind, string provenance) {
59+
Extensions::actionsSourceModel(action, version, output, kind, provenance)
6060
}
6161

6262
/**
@@ -69,10 +69,10 @@ predicate sourceModel(string action, string version, string output, string kind,
6969
* - kind: Either 'Taint' or 'Value'
7070
* - provenance: verification of the model
7171
*/
72-
predicate summaryModel(
72+
predicate actionsSummaryModel(
7373
string action, string version, string input, string output, string kind, string provenance
7474
) {
75-
Extensions::summaryModel(action, version, input, output, kind, provenance)
75+
Extensions::actionsSummaryModel(action, version, input, output, kind, provenance)
7676
}
7777

7878
/**
@@ -84,13 +84,13 @@ predicate summaryModel(
8484
* - kind: sink kind
8585
* - provenance: verification of the model
8686
*/
87-
predicate sinkModel(string action, string version, string input, string kind, string provenance) {
88-
Extensions::sinkModel(action, version, input, kind, provenance)
87+
predicate actionsSinkModel(string action, string version, string input, string kind, string provenance) {
88+
Extensions::actionsSinkModel(action, version, input, kind, provenance)
8989
}
9090

9191
predicate externallyDefinedSource(DataFlow::Node source, string sourceType, string fieldName) {
9292
exists(Uses uses, string action, string version, string kind |
93-
sourceModel(action, version, fieldName, kind, _) and
93+
actionsSourceModel(action, version, fieldName, kind, _) and
9494
uses.getCallee() = action.toLowerCase() and
9595
(
9696
if version.trim() = "*"
@@ -113,7 +113,7 @@ predicate externallyDefinedStoreStep(
113113
DataFlow::Node pred, DataFlow::Node succ, DataFlow::ContentSet c
114114
) {
115115
exists(Uses uses, string action, string version, string input, string output |
116-
summaryModel(action, version, input, output, "taint", _) and
116+
actionsSummaryModel(action, version, input, output, "taint", _) and
117117
c = any(DataFlow::FieldContent ct | ct.getName() = output.replaceAll("output.", "")) and
118118
uses.getCallee() = action.toLowerCase() and
119119
(
@@ -135,7 +135,7 @@ predicate externallyDefinedStoreStep(
135135

136136
predicate externallyDefinedSink(DataFlow::Node sink, string kind) {
137137
exists(Uses uses, string action, string version, string input |
138-
sinkModel(action, version, input, kind, _) and
138+
actionsSinkModel(action, version, input, kind, _) and
139139
uses.getCallee() = action.toLowerCase() and
140140
(
141141
if input.trim().matches("env.%")

ql/lib/codeql/actions/dataflow/internal/ExternalFlowExtensions.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
/**
66
* Holds if a source model exists for the given parameters.
77
*/
8-
extensible predicate sourceModel(
8+
extensible predicate actionsSourceModel(
99
string action, string version, string output, string kind, string provenance
1010
);
1111

1212
/**
1313
* Holds if a summary model exists for the given parameters.
1414
*/
15-
extensible predicate summaryModel(
15+
extensible predicate actionsSummaryModel(
1616
string action, string version, string input, string output, string kind, string provenance
1717
);
1818

1919
/**
2020
* Holds if a sink model exists for the given parameters.
2121
*/
22-
extensible predicate sinkModel(
22+
extensible predicate actionsSinkModel(
2323
string action, string version, string input, string kind, string provenance
2424
);
2525

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extensions:
22
- addsTo:
33
pack: githubsecuritylab/actions-all
4-
extensible: sinkModel
4+
extensible: actionsSinkModel
55
data:
66
- ["8398a7/action-slack", "*", "input.custom_payload", "code-injection", "manual"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extensions:
22
- addsTo:
33
pack: githubsecuritylab/actions-all
4-
extensible: sinkModel
4+
extensible: actionsSinkModel
55
data:
66
- ["SonarSource/sonarcloud-github-action", "*", "input.args", "secret-exfiltration", "manual"]
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extensions:
22
- addsTo:
33
pack: githubsecuritylab/actions-all
4-
extensible: sinkModel
4+
extensible: actionsSinkModel
55
data:
66
- ["actions/github-script", "*", "input.script", "code-injection", "manual"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extensions:
22
- addsTo:
33
pack: githubsecuritylab/actions-all
4-
extensible: sourceModel
4+
extensible: actionsSourceModel
55
data:
66
- ["ahmadnassri/action-changed-files", "*", "output.files", "filename", "manual"]
77
- ["ahmadnassri/action-changed-files", "*", "output.json", "json", "manual"]

0 commit comments

Comments
 (0)