|
1 | | -# workflow-script-injection |
| 1 | +<h1 align="center">Understanding the risk of script Injections in GitHub Actions workflows</h1> |
| 2 | +<h5 align="center">@robandpdx</h5> |
| 3 | +<h5 align="center">@decyjphr</h5> |
2 | 4 |
|
3 | | -The [Check issue title](.github/workflows/check-issue-title.yml) workflow simply checks if the title of the workflow begins with `octocat`. If so, the workflow succeeds. If not, the workflow fails. |
| 5 | +<p align="center"> |
| 6 | + <a href="#mega-prerequisites">Prerequisites</a> • |
| 7 | + <a href="#books-resources">Resources</a> • |
| 8 | + <a href="#learning-objectives">Learning Objectives</a> |
| 9 | +</p> |
4 | 10 |
|
5 | | -The [Check issue comment](.github/workflows/check-issue-comment.yml) workflow simply checks if the issue comment begins with `octocat`. If so, the workflow succeeds. If not, the workflow fails. |
| 11 | +> Please provide a description of your workshop. |
6 | 12 |
|
7 | | -These workflows are vulnerable to script injection. Let's find out why. |
| 13 | +- **Who is this for**: developers, devops engineers |
| 14 | +- **What you'll learn**: the risk of script Injections in GitHub Actions workflows, and how to migirate that risk |
| 15 | +- **What you'll build**: workflows that are not vulnerable to script injection attacks |
8 | 16 |
|
| 17 | +## Learning Objectives |
| 18 | + |
| 19 | +In this workshop, you will: |
| 20 | + |
| 21 | + - learn about script injection vulnerabilities in GitHub actions workflows |
| 22 | + - learn how to mitigate script injection vulnerabilities in GitHub actions workflows |
| 23 | + - learn how Github Advanced Security can help you build secure GitHub actions workfows |
| 24 | + |
| 25 | +## :mega: Prerequisites |
| 26 | +Before joining the workshop, there are a few items that you will need to install or bring with you. |
| 27 | +- an org with actions enabled |
| 28 | +- an org with GHAS enabled |
| 29 | + |
| 30 | +## :bomb: Exercise 1: Script injection in the run command |
| 31 | + |
| 32 | +The [Check issue title workflow](.github/workflows/check-issue-title.yml) simply checks if the title of the workflow begins with octocat. If so, the workflow succeeds. If not, the workflow fails. |
| 33 | + |
| 34 | +This workflow is vulnerable to script injection. Let's find out why. |
9 | 35 | [Exercise 1](./exercises/exercise-1.md) |
| 36 | + |
| 37 | +## :bomb: Exercise 2 - Script injection in github-script action |
| 38 | + |
| 39 | +The [Check issue comment](.github/workflows/check-issue-comment.yml) workflow simply checks if the issue comment begins with `octocat`. If so, the workflow succeeds. If not, the workflow fails. |
| 40 | + |
| 41 | +This workflow is vulnerable to script injection. Let's find out why. |
10 | 42 | [Exercise 2](./exercises/exercise-2.md) |
| 43 | + |
| 44 | +## :lock: Exercise 3 - Mitigate script injection in the run command |
| 45 | + |
| 46 | +Let's see how we can mitigate script injection vulnerability in the run command. |
11 | 47 | [Exercise 3](./exercises/exercise-3.md) |
| 48 | + |
| 49 | +## :lock: Exercise 4 - Migrate script injection in github-script action |
| 50 | + |
| 51 | +Let's see how we can mitigate script injection vulnerability in github-script action. |
12 | 52 | [Exercise 4](./exercises/exercise-4.md) |
| 53 | + |
| 54 | +## :mag: Exercise 5 - Mitigate using CodeQL Action Workflow |
| 55 | + |
| 56 | +Let's create an actions workflow to scan our workflow files using CodeQL. |
13 | 57 | [Exercise 5](./exercises/exercise-5.md) |
| 58 | + |
| 59 | +## :european_castle: Exercise 6 - Enhance the detection of vulnerabilities using third party queries |
| 60 | + |
| 61 | +Now let's look at another way we can use CodeQL to secure our GitHub actions workflows. |
| 62 | +[Exercise 6](./exercises/exercise-6.md) |
| 63 | + |
| 64 | +## :books: Resources |
| 65 | +- [Understanding the risk of script injections](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections) |
| 66 | +- [Security hardening for GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions/security-guides/security-hardening-for-github-actions) |
| 67 | +- [CodeQL queries](https://github.com/advanced-security/codeql-queries/) |
0 commit comments