Skip to content
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

✨ Add dangerous workflow check with untrusted code checkout pattern #1168

Merged
merged 21 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docs/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,18 @@ participants.

Risk: `High` (vulnerable to repository compromise)

This check determines whether the project has dangerous code patterns.

The first check is misuse of potentially dangerous triggers. This checks if a
`pull_request_target` workflow trigger was used in conjunction with an explicit
pull request checkout. Workflows triggered with `pull_request_target` have write
permission to the target repository and access to target repository secrets. With
the PR checkout, PR authors may compromise the repository, for example, by using
build scripts controlled by the author of the PR or reading token in memory.

This check does not detect whether untrusted code checkouts are used safely, for
example, only on pull request that have been assigned a label.
This check determines whether the project's GitHub Action workflows has dangerous
code patterns. Some examples of these patterns are untrusted code checkouts,
logging github context and secrets, or use of potentially untrusted inputs in scripts.

The first code pattern checked is the misuse of potentially dangerous triggers.
This checks if a `pull_request_target` workflow trigger was used in conjunction
with an explicit pull request checkout. Workflows triggered with `pull_request_target`
have write permission to the target repository and access to target repository
secrets. With the PR checkout, PR authors may compromise the repository, for
example, by using build scripts controlled by the author of the PR or reading
token in memory. This check does not detect whether untrusted code checkouts are
used safely, for example, only on pull request that have been assigned a label.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check is only supported on GitHub. @olivekl do we need to use merge request instead of pull request in this sentence?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's only on GitHub I think pull request is fine.


The highest score is awarded when all workflows avoid the dangerous code patterns.

Expand Down
25 changes: 13 additions & 12 deletions docs/checks/internal/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -632,21 +632,22 @@ checks:
risk: High
tags: supply-chain, security, infrastructure
repos: GitHub, local
short: Determines if the project's workflows avoid dangerous patterns.
short: Determines if the project's GitHub Action workflows avoid dangerous patterns.
description: |
Risk: `High` (vulnerable to repository compromise)

This check determines whether the project has dangerous code patterns.

The first check is misuse of potentially dangerous triggers. This checks if a
`pull_request_target` workflow trigger was used in conjunction with an explicit
pull request checkout. Workflows triggered with `pull_request_target` have write
permission to the target repository and access to target repository secrets. With
the PR checkout, PR authors may compromise the repository, for example, by using
build scripts controlled by the author of the PR or reading token in memory.

This check does not detect whether untrusted code checkouts are used safely, for
example, only on pull request that have been assigned a label.
This check determines whether the project's GitHub Action workflows has dangerous
code patterns. Some examples of these patterns are untrusted code checkouts,
logging github context and secrets, or use of potentially untrusted inputs in scripts.

The first code pattern checked is the misuse of potentially dangerous triggers.
This checks if a `pull_request_target` workflow trigger was used in conjunction
with an explicit pull request checkout. Workflows triggered with `pull_request_target`
have write permission to the target repository and access to target repository
secrets. With the PR checkout, PR authors may compromise the repository, for
example, by using build scripts controlled by the author of the PR or reading
token in memory. This check does not detect whether untrusted code checkouts are
used safely, for example, only on pull request that have been assigned a label.

The highest score is awarded when all workflows avoid the dangerous code patterns.
remediation:
Expand Down