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
Copy file name to clipboardExpand all lines: learn-pr/github/manage-github-actions-enterprise/includes/manage-runners.md
+66-68Lines changed: 66 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The following table compares GitHub-hosted runners versus self-hosted runners. U
22
22
23
23
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.
24
24
25
-
### Configuring IP Allow Lists on GitHub-hosted and Self-hosted Runners
25
+
### Configuring IP allow lists on GitHub-hosted and self-hosted runners
26
26
27
27
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.
28
28
@@ -37,85 +37,83 @@ Configuring IP allow lists helps control access to runners by restricting them t
37
37
38
38
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:
39
39
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.
43
43
44
44
|**This guide provides a detailed explanation of how**|**Self-hosted runners**|
| Organizations must allow GitHub's published IP ranges, which change periodically. | Admins can define specific IP addresses that are allowed to access the runners. |
47
47
| GitHub-hosted runners can be configured via GitHub’s security settings. | Self-hosted runners work well with firewalls, VPNs, or cloud security groups. |
48
48
49
49
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
51
51
52
52
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:
53
53
54
-
#### 1. Understand GitHub's IP Address Ranges
54
+
#### 1. Understand GitHub's IP address ranges
55
55
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.
56
56
57
57

58
58
59
-
#### 2. Configure Your Firewall
59
+
#### 2. Configure your firewall
60
60
61
-
##### a. Obtain GitHub's IP Ranges:
61
+
##### a. Obtain GitHub's IP ranges:
62
62
- Use the meta API endpoint to retrieve the latest IP address ranges used by GitHub Actions runners.
63
63
64
-
##### b. Update Firewall Rules:
64
+
##### b. Update rirewall rules:
65
65
- 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.
66
66
67
-
#### 3. Consider Using Self-Hosted Runners
67
+
#### 3. Consider using self-hosted runners
68
68
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.
69
69
70
70

71
71
72
-
#### 4. Regularly Review and Update Allow Lists
72
+
#### 4. Regularly review and update allow lists
73
73
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.
74
74
75
-
----
75
+
### Effects and potential abuse vectors of enabling self-hosted runners on public repositories
76
76
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**
81
79
- Self-hosted runners allow control over hardware, installed software, and environment settings.
82
80
- Workflows can be optimized for performance by using dedicated, high-performance machines.
83
81
84
-
2.**Cost Savings**
82
+
2.**Cost savings**
85
83
- Unlike GitHub-hosted runners (which have limited free usage), self-hosted runners run on your infrastructure, reducing cost constraints.
86
84
87
-
3.**State Persistence**
85
+
3.**State persistence**
88
86
- Self-hosted runners do **not** reset between jobs like GitHub-hosted runners.
89
87
- This allows **caching dependencies**, reusing large datasets, and maintaining persistent states.
90
88
91
-
4.**Security & Maintenance Responsibility**
89
+
4.**Security & maintenance responsibility**
92
90
-**Security patches, dependency updates, and system monitoring** become the runner owner's responsibility.
93
91
- Misconfigurations could expose the runner to external threats.
94
92
95
-
#### Potential Abuse Vectors of Self-Hosted Runners
93
+
#### Potential abuse vectors of self-hosted runners
96
94
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:
97
95
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.
100
98
- If the runner has **elevated privileges**, the attacker gains **full system access**.
- Attackers may abuse self-hosted runners to mine cryptocurrency, causing **unexpected high CPU and GPU usage**.
104
102
- This increases **operational costs** and **reduces availability** for legitimate workflows.
105
103
106
-
3.**Data Exfiltration & Credential Theft**
104
+
3.**Data exfiltration & credential theft**
107
105
- If secrets (API keys, database credentials, SSH keys) are stored on the runner, attackers could extract them.
108
106
-**Example attack vector**: A malicious pull request could read and send stored environment variables to an external server.
109
107
110
-
4.**Denial of Service (DoS) Attacks**
108
+
4.**Denial of Service (DoS) attacks**
111
109
- Attackers can flood the repository with numerous pull requests to overload self-hosted runners.
112
110
- If runners are on shared infrastructure, other critical workflows may be disrupted.
113
111
114
-
5.**Lateral Movement & Network Exploitation**
112
+
5.**Lateral movement & network exploitation**
115
113
- If the self-hosted runner is inside a **corporate network**, an attacker could **pivot** into internal systems.
116
114
- This could lead to **data breaches**, **ransomware attacks**, or **persistent access** to private resources.
117
115
118
-
#### Mitigation Strategies
116
+
#### Mitigation strategies
119
117
To reduce security risks, follow these best practices:
120
118
121
119
- Restrict self-hosted runners to **private repositories only**
@@ -125,25 +123,25 @@ To reduce security risks, follow these best practices:
125
123
- Limit access to **sensitive secrets** and store credentials securely
126
124
-**Monitor and log** runner activity to detect anomalies
127
125
128
-
### Selecting Appropriate Runners to Support Workloads
126
+
### Selecting appropriate runners to support workloads
129
127
130
-
#### Understanding GitHub Runners
128
+
#### Understanding GitHub runners
131
129
GitHub Actions supports two types of runners:
132
130
133
-
1.**GitHub-Hosted Runners**
131
+
1.**GitHub-hosted runners**
134
132
- Managed by GitHub, automatically provisioned and scaled.
135
133
- Includes **pre-installed software, tools, and dependencies** for common workflows.
136
134
- Available for **Windows, Linux, and macOS**.
137
135
- Recommended for **general automation, open-source projects, and quick setup**.
138
136
139
-
2.**Self-Hosted Runners**
137
+
2.**Self-hosted runners**
140
138
- Managed by the user, providing **full control over environment and resources**.
141
139
- Can be configured for **custom hardware, on-premises, or cloud infrastructure**.
142
140
- Supports **persistent states between jobs**, allowing better caching and custom dependencies.
143
141
- Recommended for **private repositories, enterprise workloads, and performance-intensive tasks**.
144
142
145
143
146
-
#### Choosing Between GitHub-Hosted and Self-Hosted Runners
144
+
#### Choosing Between GitHub-hosted and Self-hosted Runners
147
145
148
146
Two types of runners can execute GitHub Actions workflows: GitHub-hosted runners or self-hosted runners.
149
147
@@ -162,79 +160,79 @@ The following table compares GitHub-hosted runners versus self-hosted runners. U
162
160
| 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. |
163
161
164
162
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**
170
168
Example: `ubuntu-latest`, `ubuntu-22.04`
171
169
172
-
##### 2. Windows Runners
173
-
Needed for **.NET, Windows-based software, and GUI apps**
0 commit comments