-
Notifications
You must be signed in to change notification settings - Fork 45
[PM-41997] [TEST] Test pull_request_target workflows from fork #1387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # This workflow is intended to be run when we need to build the Android SDK and produce artifacts that require secrets | ||
| # when the PR source branch does not have access to secrets (e.g. a fork). | ||
| # This workflow will run in the context of the target of the PR and have access to secrets. | ||
| # This should only be done after reviewing the PR to ensure that no malicious code has been introduced, | ||
| # as it could allow the code on the forked branch to have access to workflow secrets. | ||
|
|
||
| name: Build Android on PR Target | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] | ||
| branches: | ||
| - main | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| check-run: | ||
| name: Check PR run | ||
| uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main | ||
| permissions: | ||
| contents: read | ||
|
|
||
| run-workflow: | ||
| name: Build Android | ||
| needs: check-run | ||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
| uses: ./.github/workflows/build-android.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| id-token: write | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||
| # This workflow is intended to be run when we need to build the WASM SDK and produce artifacts that require secrets | ||||||||||||||||||
| # when the PR source branch does not have access to secrets (e.g. a fork). | ||||||||||||||||||
| # This workflow will run in the context of the target of the PR and have access to secrets. | ||||||||||||||||||
| # This should only be done after reviewing the PR to ensure that no malicious code has been introduced, | ||||||||||||||||||
| # as it could allow the code on the forked branch to have access to workflow secrets. | ||||||||||||||||||
|
|
||||||||||||||||||
| name: Build @bitwarden/sdk-internal on PR Target | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| pull_request_target: | ||||||||||||||||||
| types: [opened, synchronize, reopened] | ||||||||||||||||||
| branches: | ||||||||||||||||||
| - main | ||||||||||||||||||
|
Comment on lines
+10
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using unsafe GitHub Actions trigger may allow privilege escalation via CI/CD - critical severity Show fix
Suggested change
Reply |
||||||||||||||||||
|
|
||||||||||||||||||
| defaults: | ||||||||||||||||||
| run: | ||||||||||||||||||
| shell: bash | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| check-run: | ||||||||||||||||||
| name: Check PR run | ||||||||||||||||||
| uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main | ||||||||||||||||||
| permissions: | ||||||||||||||||||
| contents: read | ||||||||||||||||||
|
|
||||||||||||||||||
| run-workflow: | ||||||||||||||||||
| name: Build @bitwarden/sdk-internal | ||||||||||||||||||
| needs: check-run | ||||||||||||||||||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||||||||||||||||||
| uses: ./.github/workflows/build-wasm-internal.yml | ||||||||||||||||||
| secrets: inherit | ||||||||||||||||||
| permissions: | ||||||||||||||||||
| contents: read | ||||||||||||||||||
| pull-requests: write | ||||||||||||||||||
| id-token: write | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # This workflow is intended to be run when we need to enforce PR labels | ||
| # when the PR source branch does not have access to secrets (e.g. a fork). | ||
| # This workflow will run in the context of the target of the PR and have access to secrets. | ||
| # This should only be done after reviewing the PR to ensure that no malicious code has been introduced, | ||
| # as it could allow the code on the forked branch to have access to workflow secrets. | ||
|
|
||
| name: Enforce PR labels on PR Target | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [labeled, unlabeled, opened, edited, synchronize] | ||
| branches: | ||
| - main | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| check-run: | ||
| name: Check PR run | ||
| uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main | ||
| permissions: | ||
| contents: read | ||
|
|
||
| run-workflow: | ||
| name: Enforce Labels | ||
| needs: check-run | ||
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | ||
| uses: ./.github/workflows/enforce-labels.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| pull-requests: read |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using unsafe GitHub Actions trigger may allow privilege escalation via CI/CD - critical severity
Using pull_request_target or workflow_run as a trigger is not recommended, as it may allow an attacker to elevate its privileges via the CI/CD pipeline by exfiltrating secrets (e.g. by reading out the caches of the GitHub Actions pipeline or listing loaded secrets in the environment). If the affected repository is open source, the attacker doesn't have to be an insider but could be any GitHub user.
Show fix
Reply
@AikidoSec ignore: [REASON]to ignore this issue.More info