You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compromised workflows, dependencies, and build tools typically make outbound calls to exfiltrate credentials, or may tamper source code, dependencies, or artifacts during the build.
31
31
32
-
Harden-Runner GitHub Action monitors process, file, and network activity to:
32
+
Harden-Runner monitors process, file, and network activity to:
| 1. | Block egress traffic at the DNS (Layer 7) and network layers (Layers 3 and 4) to prevent exfiltration of credentials | To prevent [Codecov breach](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/ExfiltratingCICDSecrets.md) scenario |
37
-
| 2. | Detect if source code is being overwritten during the build process to inject a backdoor | To detect [SolarWinds incident](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/TamperingDuringBuild.md) scenario |
36
+
| 1. | Block egress traffic at the DNS (Layer 7) and network layers (Layers 3 and 4) to prevent exfiltration of code and CI/CD credentials | To prevent [Codecov breach](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/ExfiltratingCICDSecrets.md) scenario |
37
+
| 2. | Detect if source code is being tampered during the build process to inject a backdoor | To detect [SolarWinds incident](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/TamperingDuringBuild.md) scenario |
38
38
| 3. | Detect poisoned workflows and compromised dependencies | To detect [Dependency confusion](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/ExfiltratingCICDSecrets.md#dependency-confusion-attacks) and [Malicious dependencies](https://github.com/step-security/github-actions-goat/blob/main/docs/Vulnerabilities/ExfiltratingCICDSecrets.md#compromised-dependencies)|
39
39
40
40
Read this [case study](https://infosecwriteups.com/detecting-malware-packages-in-github-actions-7b93a9985635) on how Harden-Runner detected malicious packages in the NPM registry.
41
41
42
42
## How
43
43
44
-
1. Add `step-security/harden-runner` to your GitHub Actions workflow file as the first step in each job.
44
+
### GitHub-Hosted Runners
45
+
46
+
1. Add `step-security/harden-runner` GitHub Action to your GitHub Actions workflow file as the first step in each job.
45
47
46
48
```yaml
47
49
steps:
@@ -68,6 +70,14 @@ Read this [case study](https://infosecwriteups.com/detecting-malware-packages-in
68
70
<img src="images/rec-policy1.png" alt="Policy recommended by harden-runner" >
69
71
</p>
70
72
73
+
### Actions Runner Controller (ARC) Runners
74
+
75
+
- Rather than incorporating the Harden-Runner GitHub Action into each workflow, you'll need to install the ARC Harden Runner daemonset on your Kubernetes cluster.
76
+
- Upon deployment, the ARC Harden Runner daemonset constantly monitors each workflow run; you do NOT need to add the Harden-Runner GitHub Action to each job for `audit` mode.
77
+
- You can access security insights and runtime detections under the Runtime Security tab in your dashboard.
78
+
- You do need to add the Harden-Runner GitHub Action for `block` mode.
79
+
- Explore demo workflows using self-hosted ARC Runner and ARC Harden Runner here: https://docs.stepsecurity.io/harden-runner/how-tos/enable-runtime-security-arc
80
+
71
81
## Support for ARC and Private Repositories
72
82
73
83
Actions Runner Controller (ARC) and Private repositories are supported with a commercial license. Check out the [documentation](https://docs.stepsecurity.io/stepsecurity-platform/billing) for more details.
@@ -86,11 +96,12 @@ For details, check out the documentation at https://docs.stepsecurity.io
86
96
87
97
### 🚦 Restrict egress traffic to allowed endpoints
88
98
99
+
> Applies to both GitHub-Hosted and self-hosted ARC Runners
100
+
89
101
Once allowed endpoints are set in the policy in the workflow file, or in the [Policy Store](https://docs.stepsecurity.io/harden-runner/how-tos/block-egress-traffic#2-add-the-policy-using-the-policy-store)
90
102
91
103
- Harden-Runner blocks egress traffic at the DNS (Layer 7) and network layers (Layers 3 and 4).
92
104
- It blocks DNS exfiltration, where attacker tries to send data out using DNS resolution
93
-
- Blocks outbound traffic using IP tables
94
105
- Wildcard domains are supported, e.g. you can add `*.data.mcr.microsoft.com:443` to the allowed list, and egress traffic will be allowed to `eastus.data.mcr.microsoft.com:443` and `westus.data.mcr.microsoft.com:443`.
95
106
96
107
<p align="left">
@@ -99,6 +110,8 @@ Once allowed endpoints are set in the policy in the workflow file, or in the [Po
99
110
100
111
### 🕵️ Detect tampering of source code during build
101
112
113
+
> Applies to both GitHub-Hosted and self-hosted ARC Runners
114
+
102
115
Harden-Runner monitors file writes and can detect if a file is overwritten.
103
116
104
117
- Source code overwrite is not expected in a release build
@@ -111,15 +124,19 @@ Harden-Runner monitors file writes and can detect if a file is overwritten.
111
124
112
125
### 🚫 Run your job without sudo access
113
126
127
+
> Applies to GitHub-Hosted Runners
128
+
114
129
GitHub-hosted runner uses passwordless sudo for running jobs.
115
130
116
131
- This means compromised build tools or dependencies can install attack tools
117
132
- If your job does not need sudo access, you see a policy
118
133
recommendation to disable sudo in the insights page
119
-
- When you set `disable-sudo` to `true`, the job steps run without sudo access to the Ubuntu VM
134
+
- When you set `disable-sudo` to `true`, the job steps run without sudo access to the GitHub-hosted Ubuntu VM
120
135
121
136
### 🔔 Get security alerts
122
137
138
+
> Applies to both GitHub-Hosted and self-hosted ARC Runners
139
+
123
140
Install the [StepSecurity Actions Security GitHub App](https://github.com/apps/stepsecurity-actions-security) to get security alerts.
If you have questions or ideas, please use [discussions](https://github.com/step-security/harden-runner/discussions). For support for ARC and Private repositories, email info@stepsecurity.io.
148
+
- If you have questions or ideas, please use [discussions](https://github.com/step-security/harden-runner/discussions).
149
+
- For support for ARC and Private repositories, email support@stepsecurity.io.
150
+
- If you use a different CI/CD Provider (e.g. Jenkins, Gitlab CI, etc), and would like to use Harden Runner in your environment, please email interest@stepsecurity.io
132
151
133
152
## How does it work?
134
153
154
+
### GitHub-Hosted Runners
155
+
135
156
For GitHub-hosted runners, Harden-Runner GitHub Action downloads and installs the StepSecurity Agent.
136
157
137
158
- The code to monitor file, process, and network activity is in the Agent.
138
159
- The agent is written in Go and is open source at https://github.com/step-security/agent
139
160
- The agent's build is reproducible. You can view the steps to reproduce the build [here](http://app.stepsecurity.io/github/step-security/agent/releases/latest)
140
161
141
-
## Limitations for GitHub-Hosted Runners
162
+
### Actions Runner Controller (ARC) Runners
163
+
164
+
- ARC Harden Runner daemonset uses eBPF
165
+
- You can find more details in this blog post: https://www.stepsecurity.io/blog/introducing-harden-runner-for-kubernetes-based-self-hosted-actions-runners
166
+
- ARC Harden Runner is NOT open source.
167
+
168
+
## Limitations
169
+
170
+
### GitHub-Hosted Runners
142
171
143
172
1. Only Ubuntu VM is supported. Windows and MacOS GitHub-hosted runners are not supported. There is a discussion about that [here](https://github.com/step-security/harden-runner/discussions/121).
144
-
2. Harden-Runner is not supported when [job is run in a container](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container) as it needs sudo access on the Ubuntu VM to run. It can be used to monitor jobs that use containers to run steps. The limitation is if the entire job is run in a container. That is not common for GitHub Actions workflows, as most of them run directly on `ubuntu-latest`.
173
+
2. Harden-Runner is not supported when [job is run in a container](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container) as it needs sudo access on the Ubuntu VM to run. It can be used to monitor jobs that use containers to run steps. The limitation is if the entire job is run in a container. That is not common for GitHub Actions workflows, as most of them run directly on `ubuntu-latest`. Note: This is not a limitation for ARC Harden Runner. With ARC Harden Runner, you can monitor jobs that run in a container.
174
+
175
+
### Actions Runner Controller (ARC) Runners
176
+
177
+
1. Since ARC Harden Runner uses eBPF, only Linux jobs are supported. Windows and MacOS jobs are not supported.
0 commit comments