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
### 1. Automatically set minimum GITHUB_TOKEN permissions
61
64
@@ -79,7 +82,25 @@ In this pull request, minimum permissions are set automatically for the GITHUB_T
79
82
- It looks up the permissions needed by each Action in your workflow and sums the permissions up to come up with a final recommendation
80
83
- If you are the owner of a GitHub Action, please [contribute to the knowledge base](https://github.com/step-security/secure-repo/blob/main/knowledge-base/actions/README.md)
81
84
82
-
### 2. Pin Actions to a full length commit SHA
85
+
### 2. Add Harden-Runner GitHub Action to each job
86
+
87
+
#### Why is this needed?
88
+
89
+
[Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) installs a security agent on the Github-hosted runner to prevent exfiltration of credentials, monitor the build process, and detect compromised dependencies.
This pull request adds the Harden Runner GitHub Action to the workflow file.
96
+
97
+
<palign="center"><imgsrc="images/harden-runner-example.png"width="600"alt="Screenshot of Harden-Runner GitHub Action added to a workflow" /></p>
98
+
99
+
#### How does Secure-Repo fix this issue?
100
+
101
+
Secure-Repo updates the YAML file and adds [Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) as the first step to each job.
102
+
103
+
### 3. Pin Actions to a full length commit SHA
83
104
84
105
#### Why is this needed?
85
106
@@ -104,25 +125,32 @@ In this pull request, the workflow file has the GitHub Actions tags pinned autom
104
125
- Secure-Repo automates the process of getting the commit SHA for each mutable Action version or Docker image tag
105
126
- It does this by using GitHub and Docker registry APIs
106
127
107
-
### 3. Add Harden-Runner GitHub Action to each job
128
+
### 4. Pin image tags to digests in Dockerfiles
108
129
109
130
#### Why is this needed?
110
131
111
-
[Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) installs a security agent on the Github-hosted runner to prevent exfiltration of credentials, monitor the build process, and detect compromised dependencies.
132
+
- Docker tags are mutable, so use digests in place of tags when pulling images
133
+
- If the tag changes you will not have a chance to review the change before it gets used
134
+
- OpenSSF Scorecard [recommends pinning image tags for Dockerfiles used in building and releasing your project](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies).
Before the fix, your Dockerfile uses image:tag, e.g. `rust:latest`
116
139
117
-
This pull request adds the Harden Runner GitHub Action to the workflow file.
140
+
After the fix, Secure-Repo pins each docker image to an immutable checksum, e.g. `rust:latest@sha256:02a53e734724bef4a58d856c694f826aa9e7ea84353516b76d9a6d241e9da60e`.
118
141
119
-
<palign="center"><imgsrc="images/harden-runner-example.png"width="600"alt="Screenshot of Harden-Runner GitHub Action added to a workflow" /></p>
In this pull request, the Docker file has tags pinned automatically to their checksum.
145
+
146
+
<palign="center"><imgsrc="images/pin-docker-example.png"alt="Screenshot of docker image pinned to checksum"width="600" /></p>
120
147
121
148
#### How does Secure-Repo fix this issue?
122
149
123
-
Secure-Repo updates the YAML file and adds [Harden-Runner GitHub Action](https://github.com/step-security/harden-runner) as the first step to each job.
150
+
- Secure-Repo automates the process of getting the checksum for each Docker image tag
151
+
- It does this by using Docker registry APIs
124
152
125
-
### 4. Add or update Dependabot configuration
153
+
### 5. Add or update Dependabot configuration
126
154
127
155
#### Why is this needed?
128
156
@@ -145,7 +173,7 @@ This pull request updates the Dependabot configuration.
145
173
146
174
Secure-Repo updates the `dependabot.yml` file to add missing ecosystems. For example, if the Dependabot configuration updates npm packages but not GitHub Actions, it is updated to add the GitHub Actions ecosystem.
147
175
148
-
### 5. Add CodeQL workflow (SAST)
176
+
### 6. Add CodeQL workflow (SAST)
149
177
150
178
#### Why is this needed?
151
179
@@ -165,6 +193,48 @@ This pull request adds CodeQL to the list of workflows.
165
193
166
194
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default CodeQL workflow, which gets added as part of the pull request. The placeholder for languages in the template gets replaced with languages for your GitHub repository.
167
195
196
+
### 7. Add Dependency review workflow
197
+
198
+
#### Why is this needed?
199
+
200
+
- The Dependency review workflow scans for vulnerable versions of dependencies introduced by package version changes in pull requests, and warns you about the associated security vulnerabilities.
201
+
- This gives you better visibility of what's changing in a pull request, and helps prevent vulnerabilities being added to your repository.
202
+
203
+
#### Before and After the fix
204
+
205
+
Before the fix, you do not have a dependency review workflow.
206
+
207
+
After the fix, a `depdendency-review.yml` GitHub Actions workflow gets added to your project.
This pull request adds GitHub's `actions/dependency-review-action` workflow to the list of workflows.
212
+
213
+
#### How does Secure-Repo fix this issue?
214
+
215
+
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default dependency review workflow, which gets added as part of the pull request.
216
+
217
+
### 8. Add OpenSSF Scorecard workflow
218
+
219
+
#### Why is this needed?
220
+
221
+
- OpenSSF Scorecard is an automated tool that assesses a number of important heuristics ("checks") associated with software security and assigns each check a score of 0-10.
222
+
- You can use these scores to understand specific areas to improve in order to strengthen the security posture of your project.
223
+
224
+
#### Before and After the fix
225
+
226
+
Before the fix, you do not have a OpenSSF Scorecard workflow.
227
+
228
+
After the fix, a `scorecards.yml` GitHub Actions workflow gets added to your project.
This pull request adds OpenSSF Scorecard to the list of workflows.
233
+
234
+
#### How does Secure-Repo fix this issue?
235
+
236
+
Secure-Repo has a [workflow-templates](https://github.com/step-security/secure-repo/tree/main/workflow-templates) folder. This folder has the default Scorecard workflow, which gets added as part of the pull request.
0 commit comments