Skip to content

Commit 33ae3b1

Browse files
author
Alvaro Muñoz
committed
minor updates
1 parent 367531a commit 33ae3b1

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

ql/lib/codeql/actions/security/PoisonableSteps.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract class PoisonableStep extends Step { }
55
// source: https://github.com/boostsecurityio/poutine/blob/main/opa/rego/rules/untrusted_checkout_exec.rego#L16
66
private string dangerousActions() {
77
result =
8-
["pre-commit/action", "oxsecurity/megalinter", "bridgecrewio/checkov-action", "ruby/setup-ruby"]
8+
["pre-commit/action", "oxsecurity/megalinter", "bridgecrewio/checkov-action", "ruby/setup-ruby", "actions/jekyll-build-pages"]
99
}
1010

1111
class DangerousActionUsesStep extends PoisonableStep, UsesStep {

ql/lib/codeql/actions/security/UntrustedCheckoutQuery.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ class ActionsMutableRefCheckout extends MutableRefCheckoutStep instanceof UsesSt
108108
exists(StepsExpression e |
109109
this.getArgumentExpr("ref") = e and
110110
(
111-
e.getStepId().matches(["%ref%", "%branch%"]) or
112-
e.getFieldName().matches(["%ref%", "%branch%"])
111+
e.getStepId().matches(["%head%", "%pull_request%", "%_pr_%"]) or
112+
e.getFieldName().matches(["%head%", "%pull_request%", "%_pr_%"])
113113
)
114114
)
115115
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
# Runs on pull requests targeting the default branch
5+
pull_request_target:
6+
branches: ["main"]
7+
8+
jobs:
9+
build:
10+
# Limit permissions of the GITHUB_TOKEN for untrusted code
11+
permissions:
12+
contents: read
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
20+
- name: Setup Pages
21+
uses: actions/configure-pages@v5
22+
- name: Build with Jekyll
23+
uses: actions/jekyll-build-pages@v1
24+
with:
25+
source: ./
26+
destination: ./_site
27+

0 commit comments

Comments
 (0)