Skip to content

Commit ecb88c2

Browse files
authored
Update manage-runners.md
1 parent 9461d6c commit ecb88c2

File tree

1 file changed

+66
-68
lines changed

1 file changed

+66
-68
lines changed

learn-pr/github/manage-github-actions-enterprise/includes/manage-runners.md

Lines changed: 66 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following table compares GitHub-hosted runners versus self-hosted runners. U
2222

2323
Managing runners for the enterprise involves configuring and securing both GitHub-hosted and self-hosted runners to ensure efficient and secure CI/CD workflows. This includes setting up IP allow lists to control access, enhancing security by restricting runner access to specific IP addresses, and ensuring compliance with organizational policies. Proper configuration of IP allow lists for both GitHub-hosted and self-hosted runners is crucial for maintaining secure and reliable interactions between internal applications and GitHub Actions runners. Regular updates and reviews of these configurations are necessary to adapt to changes in IP address ranges and maintain optimal security.
2424

25-
### Configuring IP Allow Lists on GitHub-hosted and Self-hosted Runners
25+
### Configuring IP allow lists on GitHub-hosted and self-hosted runners
2626

2727
Configuring IP allow lists helps control access to runners by restricting them to specific IP addresses. This enhances security by preventing unauthorized access but may require additional network configurations.
2828

@@ -37,85 +37,83 @@ Configuring IP allow lists helps control access to runners by restricting them t
3737

3838
An **allowed IP list** is a security feature that restricts access to services or resources based on predefined IP addresses. By configuring an IP allow list, organizations can:
3939

40-
- **Enhance Security:** Prevent unauthorized access by allowing only trusted IP addresses.
41-
- **Control Network Traffic:** Restrict inbound and outbound requests to known and verified IPs.
42-
- **Improve Compliance:** Ensure regulatory compliance by limiting access to authorized networks.
40+
- **Enhance security:** Prevent unauthorized access by allowing only trusted IP addresses.
41+
- **Control network Traffic:** Restrict inbound and outbound requests to known and verified IPs.
42+
- **Improve compliance:** Ensure regulatory compliance by limiting access to authorized networks.
4343

4444
| **This guide provides a detailed explanation of how** | **Self-hosted runners** |
4545
|----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
4646
| Organizations must allow GitHub's published IP ranges, which change periodically. | Admins can define specific IP addresses that are allowed to access the runners. |
4747
| GitHub-hosted runners can be configured via GitHub’s security settings. | Self-hosted runners work well with firewalls, VPNs, or cloud security groups. |
4848

4949

50-
### Configuring IP Allow Lists for Internal Applications to Interact with GitHub-Hosted Runners
50+
### Configuring IP allow lists for internal applications to interact with GitHub-Hosted Runners
5151

5252
To configure IP allow lists for internal applications and systems to interact with GitHub-hosted runners, you can refer to the following official GitHub documentation:
5353

54-
#### 1. Understand GitHub's IP Address Ranges
54+
#### 1. Understand GitHub's IP address ranges
5555
GitHub-hosted runners operate within specific IP address ranges. To ensure your internal applications can communicate with these runners, you need to allow these IP ranges through your firewall. GitHub provides a meta API endpoint https://api.github.com/meta that lists all current IP address ranges used by GitHub services, including those for Actions runners. Regularly updating your allow lists based on this information is essential, as IP ranges can change.
5656

5757
![alt text](image-8.png)
5858

59-
#### 2. Configure Your Firewall
59+
#### 2. Configure your firewall
6060

61-
##### a. Obtain GitHub's IP Ranges:
61+
##### a. Obtain GitHub's IP ranges:
6262
- Use the meta API endpoint to retrieve the latest IP address ranges used by GitHub Actions runners.
6363

64-
##### b. Update Firewall Rules:
64+
##### b. Update rirewall rules:
6565
- Add rules to your firewall to permit inbound and outbound traffic to and from these IP ranges. This ensures that your internal systems can interact with GitHub-hosted runners without connectivity issues.
6666

67-
#### 3. Consider Using Self-Hosted Runners
67+
#### 3. Consider using self-hosted runners
6868
If maintaining an IP allow list for GitHub-hosted runners is challenging due to frequent changes in IP ranges, consider setting up self-hosted runners within your network. This approach allows you to have more control over the runner environment and network configurations. However, be aware that using self-hosted runners requires additional maintenance and infrastructure management.
6969

7070
![alt text](image-5.png)
7171

72-
#### 4. Regularly Review and Update Allow Lists
72+
#### 4. Regularly review and update allow lists
7373
Since GitHub's IP address ranges can change, it's crucial to periodically review and update your firewall's IP allow lists. Automating this process by scripting the retrieval of IP ranges from GitHub's meta API can help ensure your allow lists remain current without manual intervention.
7474

75-
----
75+
### Effects and potential abuse vectors of enabling self-hosted runners on public repositories
7676

77-
### Effects and Potential Abuse Vectors of Enabling Self-Hosted Runners on Public Repositories
78-
79-
#### Effects of Enabling Self-Hosted Runners
80-
1. **Customization & Performance Optimization**
77+
#### Effects of enabling self-hosted runners
78+
1. **Customization & performance optimization**
8179
- Self-hosted runners allow control over hardware, installed software, and environment settings.
8280
- Workflows can be optimized for performance by using dedicated, high-performance machines.
8381

84-
2. **Cost Savings**
82+
2. **Cost savings**
8583
- Unlike GitHub-hosted runners (which have limited free usage), self-hosted runners run on your infrastructure, reducing cost constraints.
8684

87-
3. **State Persistence**
85+
3. **State persistence**
8886
- Self-hosted runners do **not** reset between jobs like GitHub-hosted runners.
8987
- This allows **caching dependencies**, reusing large datasets, and maintaining persistent states.
9088

91-
4. **Security & Maintenance Responsibility**
89+
4. **Security & maintenance responsibility**
9290
- **Security patches, dependency updates, and system monitoring** become the runner owner's responsibility.
9391
- Misconfigurations could expose the runner to external threats.
9492

95-
#### Potential Abuse Vectors of Self-Hosted Runners
93+
#### Potential abuse vectors of self-hosted runners
9694
Enabling self-hosted runners on public repositories introduces significant security risks. Since **anyone** can trigger workflows by submitting a pull request, attackers can exploit this feature in various ways:
9795

98-
1. **Arbitrary Code Execution (RCE) by Malicious Actors**
99-
- Attackers can submit pull requests containing **malicious scripts**, which the self-hosted runner executes automatically.
96+
1. **Arbitrary Code Execution (RCE) by malicious actors**
97+
- Attackers can submit pull requests containing **malicious scripts**, which the self-hosted runner executes automatically.
10098
- If the runner has **elevated privileges**, the attacker gains **full system access**.
10199

102-
2. **Cryptocurrency Mining & Resource Exploitation**
100+
2. **Cryptocurrency mining & resource exploitation**
103101
- Attackers may abuse self-hosted runners to mine cryptocurrency, causing **unexpected high CPU and GPU usage**.
104102
- This increases **operational costs** and **reduces availability** for legitimate workflows.
105103

106-
3. **Data Exfiltration & Credential Theft**
104+
3. **Data exfiltration & credential theft**
107105
- If secrets (API keys, database credentials, SSH keys) are stored on the runner, attackers could extract them.
108106
- **Example attack vector**: A malicious pull request could read and send stored environment variables to an external server.
109107

110-
4. **Denial of Service (DoS) Attacks**
108+
4. **Denial of Service (DoS) attacks**
111109
- Attackers can flood the repository with numerous pull requests to overload self-hosted runners.
112110
- If runners are on shared infrastructure, other critical workflows may be disrupted.
113111

114-
5. **Lateral Movement & Network Exploitation**
112+
5. **Lateral movement & network exploitation**
115113
- If the self-hosted runner is inside a **corporate network**, an attacker could **pivot** into internal systems.
116114
- This could lead to **data breaches**, **ransomware attacks**, or **persistent access** to private resources.
117115

118-
#### Mitigation Strategies
116+
#### Mitigation strategies
119117
To reduce security risks, follow these best practices:
120118

121119
- Restrict self-hosted runners to **private repositories only**
@@ -125,25 +123,25 @@ To reduce security risks, follow these best practices:
125123
- Limit access to **sensitive secrets** and store credentials securely
126124
- **Monitor and log** runner activity to detect anomalies
127125

128-
### Selecting Appropriate Runners to Support Workloads
126+
### Selecting appropriate runners to support workloads
129127

130-
#### Understanding GitHub Runners
128+
#### Understanding GitHub runners
131129
GitHub Actions supports two types of runners:
132130

133-
1. **GitHub-Hosted Runners**
131+
1. **GitHub-hosted runners**
134132
- Managed by GitHub, automatically provisioned and scaled.
135133
- Includes **pre-installed software, tools, and dependencies** for common workflows.
136134
- Available for **Windows, Linux, and macOS**.
137135
- Recommended for **general automation, open-source projects, and quick setup**.
138136

139-
2. **Self-Hosted Runners**
137+
2. **Self-hosted runners**
140138
- Managed by the user, providing **full control over environment and resources**.
141139
- Can be configured for **custom hardware, on-premises, or cloud infrastructure**.
142140
- Supports **persistent states between jobs**, allowing better caching and custom dependencies.
143141
- Recommended for **private repositories, enterprise workloads, and performance-intensive tasks**.
144142

145143

146-
#### Choosing Between GitHub-Hosted and Self-Hosted Runners
144+
#### Choosing Between GitHub-hosted and Self-hosted Runners
147145

148146
Two types of runners can execute GitHub Actions workflows: GitHub-hosted runners or self-hosted runners.
149147

@@ -162,79 +160,79 @@ The following table compares GitHub-hosted runners versus self-hosted runners. U
162160
| Use free minutes on your GitHub plan, with per-minute rates applied after surpassing the free minutes. | Are free to use with GitHub Actions, but you're responsible for the cost of maintaining your runner machines. |
163161

164162

165-
#### Choosing the Right Operating System for Runners
166-
##### 1. Linux Runners (Default)
167-
Best for most workloads
168-
Fast, cost-effective, and widely supported
169-
Used in **CI/CD, scripting, Docker, and automation**
163+
#### Choosing the right operating system for runners
164+
##### 1. Linux runners (default)
165+
- Best for most workloads
166+
- Fast, cost-effective, and widely supported
167+
- Used in **CI/CD, scripting, Docker, and automation**
170168
Example: `ubuntu-latest`, `ubuntu-22.04`
171169

172-
##### 2. Windows Runners
173-
Needed for **.NET, Windows-based software, and GUI apps**
174-
Supports **PowerShell, Windows-specific dependencies**
170+
##### 2. Windows runners
171+
- Needed for **.NET, Windows-based software, and GUI apps**
172+
- Supports **PowerShell, Windows-specific dependencies**
175173
Example: `windows-latest`, `windows-2022`
176174

177-
##### 3. macOS Runners
178-
Required for **iOS, macOS, Xcode, and Apple-specific builds**
179-
Supports **Swift, Objective-C, and macOS applications**
175+
##### 3. macOS runners
176+
- Required for **iOS, macOS, Xcode, and Apple-specific builds**
177+
- Supports **Swift, Objective-C, and macOS applications**
180178
Example: `macos-latest`, `macos-13`
181179

182-
#### Best Practices for Selecting Runners
183-
Use **GitHub-hosted runners** for general workflows and automation.
184-
se **self-hosted runners** for **custom environments, large workloads, or security-sensitive applications**.
185-
Choose **Linux runners** for most workloads due to performance and cost efficiency.
186-
Use **Windows or macOS runners** only when required for compatibility.
187-
**Regularly update and monitor self-hosted runners** to prevent security risks.
180+
#### Best practices for Selecting Runners
181+
- Use **GitHub-hosted runners** for general workflows and automation.
182+
- Use **self-hosted runners** for **custom environments, large workloads, or security-sensitive applications**.
183+
- Choose **Linux runners** for most workloads due to performance and cost efficiency.
184+
- Use **Windows or macOS runners** only when required for compatibility.
185+
- **Regularly update and monitor self-hosted runners** to prevent security risks.
188186

189-
### Contrast GitHub-Hosted and Self-Hosted Runners
187+
### Contrast GitHub-hosted and self-Hosted runners
190188

191189
GitHub Actions supports two types of runners for executing workflows:
192190

193-
1. **GitHub-Hosted Runners** – Managed by GitHub, automatically provisioned, and pre-configured with common development tools.
194-
2. **Self-Hosted Runners** – Managed by the user, allowing complete control over the environment, resources, and configurations.
191+
1. **GitHub-hosted runners** – Managed by GitHub, automatically provisioned, and pre-configured with common development tools.
192+
2. **Self-hosted runners** – Managed by the user, allowing complete control over the environment, resources, and configurations.
195193

196194
This section highlights the key differences between GitHub-hosted and self-hosted runners.
197195

198-
#### Comparison: GitHub-Hosted vs. Self-Hosted Runners
196+
#### Comparison: GitHub-hosted vs. Self-hosted runners
199197

200-
| Feature | GitHub-Hosted Runner | Self-Hosted Runner |
198+
| Feature | GitHub-hosted runner | Self-hosted runner |
201199
|---------|----------------------|--------------------|
202-
| **Setup & Maintenance** | No setup required; GitHub manages everything | User must install, configure, and maintain |
200+
| **Setup & maintenance** | No setup required; GitHub manages everything | User must install, configure, and maintain |
203201
| **Scalability** | Auto-scales dynamically | Must manually provision additional runners |
204202
| **Security** | High security; fresh virtual environment for each job | Requires manual security hardening |
205203
| **Customization** | Limited; pre-installed tools only | Fully customizable; user can install any dependencies |
206204
| **Performance** | Standardized compute resources | Can use high-performance hardware |
207-
| **State Persistence** | Resets after every job | Can persist data between jobs |
205+
| **State persistence** | Resets after every job | Can persist data between jobs |
208206
| **Cost** | Free for public repos; limited free usage for private repos | No GitHub costs, but requires infrastructure investment |
209-
| **Network Access** | No direct access to internal networks | Can access internal/private networks |
210-
| **Use Case** | Best for general CI/CD, automation, and open-source projects | Best for enterprise environments, secure builds, and large workloads |
207+
| **Network access** | No direct access to internal networks | Can access internal/private networks |
208+
| **Use case** | Best for general CI/CD, automation, and open-source projects | Best for enterprise environments, secure builds, and large workloads |
211209

212-
#### Key Differences & Considerations
210+
#### Key differences & considerations
213211

214-
##### 1. Setup & Maintenance
215-
- **GitHub-Hosted Runners** require **zero setup**; users can start running workflows immediately.
216-
- **Self-Hosted Runners** need **manual installation, configuration, updates, and security management**.
212+
##### 1. Setup & maintenance
213+
- **GitHub-hosted runners** require **zero setup**; users can start running workflows immediately.
214+
- **Self-hosted runners** need **manual installation, configuration, updates, and security management**.
217215

218-
##### 2. Security Risks
216+
##### 2. Security risks
219217
- GitHub-hosted runners **run in isolated virtual machines** that reset after each job, minimizing attack surfaces.
220218
- Self-hosted runners **persist across jobs**, meaning a compromised runner can be exploited across multiple workflow runs.
221219

222-
##### 3. Performance & Cost Considerations
220+
##### 3. Performance & cost considerations
223221
- GitHub-hosted runners **provide a standard environment** but have **usage limits** (e.g., free minutes per month for private repositories).
224222
- Self-hosted runners **allow better performance tuning** (e.g., running on high-end servers) but require **infrastructure and maintenance costs**.
225223

226-
##### 4. Networking & Access
224+
##### 4. Networking & access
227225
- GitHub-hosted runners **cannot access private/internal resources** without additional configurations.
228226
- Self-hosted runners **can access internal systems**, making them ideal for **private repositories, internal tools, and on-premises deployments**.
229227

230-
#### When to Use Each Runner?
228+
#### When to use each runner?
231229

232-
**Use GitHub-Hosted Runners If:**
230+
**Use GitHub-hosted runners if:**
233231
- You need a **quick and easy setup** without infrastructure management.
234232
- Your workflow **doesn’t require custom dependencies** beyond the pre-installed tools.
235233
- You're working on an **open-source or public repository** with **free hosted runner minutes**.
236234

237-
**Use Self-Hosted Runners If:**
235+
**Use Self-hosted runners if:**
238236
- Your workflow requires **specific dependencies, configurations, or persistent states**.
239237
- You need to **access private network resources** (e.g., on-premises databases, internal services).
240238
- You require **higher performance machines** for **large-scale CI/CD pipelines**.

0 commit comments

Comments
 (0)